diff --git a/generator.go b/generator.go index 50ab8ca..7e597f1 100644 --- a/generator.go +++ b/generator.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore +// +build generator package main @@ -18,6 +18,8 @@ import ( "path/filepath" "runtime" "strings" + + "modernc.org/ccgo/v3/lib" ) // gcc @@ -592,10 +594,11 @@ func makeTestfixture(goos, goarch string, more []string) { files[i] = filepath.Join(sqliteSrcDir, filepath.FromSlash(v)) } configure(goos, goarch) - cmd := newCmd( - "ccgo", + + task := ccgo.NewTask( join( []string{ + "ccgo", "-DSQLITE_OMIT_LOAD_EXTENSION", "-DSQLITE_SERIES_CONSTRAINT_VERIFY=1", "-DSQLITE_SERVER=1", @@ -623,18 +626,21 @@ func makeTestfixture(goos, goarch string, more []string) { }, files, more, - configTest)..., + configTest, + ), + nil, + nil, ) - if err := cmd.Run(); err != nil { + if err := task.Main(); err != nil { fail("%s\n", err) } } func makeSpeedTest(goos, goarch string, more []string) { - cmd := newCmd( - "ccgo", + task := ccgo.NewTask( join( []string{ + "ccgo", "-export-defines", "", "-o", filepath.FromSlash(fmt.Sprintf("speedtest1/main_%s_%s.go", goos, goarch)), "-trace-translation-units", @@ -643,18 +649,21 @@ func makeSpeedTest(goos, goarch string, more []string) { "-l", "modernc.org/sqlite/lib", }, more, - configProduction)..., + configProduction, + ), + nil, + nil, ) - if err := cmd.Run(); err != nil { + if err := task.Main(); err != nil { fail("%s\n", err) } } func makeMpTest(goos, goarch string, more []string) { - cmd := newCmd( - "ccgo", + task := ccgo.NewTask( join( []string{ + "ccgo", "-export-defines", "", "-o", filepath.FromSlash(fmt.Sprintf("internal/mptest/main_%s_%s.go", goos, goarch)), "-trace-translation-units", @@ -663,18 +672,21 @@ func makeMpTest(goos, goarch string, more []string) { "-l", "modernc.org/sqlite/lib", }, more, - configProduction)..., + configProduction, + ), + nil, + nil, ) - if err := cmd.Run(); err != nil { + if err := task.Main(); err != nil { fail("%s\n", err) } } func makeSqliteProduction(goos, goarch string, more []string) { - cmd := newCmd( - "ccgo", + task := ccgo.NewTask( join( []string{ + "ccgo", "-DSQLITE_PRIVATE=", "-export-defines", "", "-export-enums", "", @@ -687,18 +699,21 @@ func makeSqliteProduction(goos, goarch string, more []string) { filepath.Join(sqliteDir, "sqlite3.c"), }, more, - configProduction)..., + configProduction, + ), + nil, + nil, ) - if err := cmd.Run(); err != nil { + if err := task.Main(); err != nil { fail("%s\n", err) } } func makeSqliteTest(goos, goarch string, more []string) { - cmd := newCmd( - "ccgo", + task := ccgo.NewTask( join( []string{ + "ccgo", "-DSQLITE_PRIVATE=", "-export-defines", "", "-export-enums", "", @@ -712,9 +727,12 @@ func makeSqliteTest(goos, goarch string, more []string) { filepath.Join(sqliteDir, "sqlite3.c"), }, more, - configTest)..., + configTest, + ), + nil, + nil, ) - if err := cmd.Run(); err != nil { + if err := task.Main(); err != nil { fail("%s\n", err) } } diff --git a/go.mod b/go.mod index 63cc27c..2d8e632 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( github.com/mattn/go-sqlite3 v1.14.6 + modernc.org/ccgo/v3 v3.8.20-0.20210308191420-206751e6014b modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8 modernc.org/mathutil v1.2.2 modernc.org/tcl v1.4.5-0.20210308125415-9a47e1077a86 diff --git a/go.sum b/go.sum index c54aa49..a5bf1b2 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,48 @@ +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78 h1:M8tBwCtWD/cZV9DZpFYRUgaymAYAr+aIUTWzDaM3uPs= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +modernc.org/cc/v3 v3.31.5-0.20210308123301-7a3e9dab9009 h1:u0oCo5b9wyLr++HF3AN9JicGhkUxJhMz51+8TIZH9N0= +modernc.org/cc/v3 v3.31.5-0.20210308123301-7a3e9dab9009/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878= +modernc.org/ccgo/v3 v3.8.20-0.20210308191420-206751e6014b h1:bcpyPqDPI22u/iMOLWCrRpHAgAV9zDHQQf1exZEAI0A= +modernc.org/ccgo/v3 v3.8.20-0.20210308191420-206751e6014b/go.mod h1:nQbgkn8mwzPdp4mm6BT6+p85ugQ7FrGgIcYaE7nSrpY= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8 h1:m/p34a6Fq+riVqUMSO0swBCBads6NXwzQ5WfTWJfrTA= @@ -17,7 +52,13 @@ modernc.org/mathutil v1.2.2 h1:+yFk8hBprV+4c0U9GjFtL+dV3N8hOJ8JCituQcMShFY= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.0.4 h1:utMBrFcpnQDdNsmM6asmyH/FM9TqLPS7XF7otpJmrwM= modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= +modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc= +modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/tcl v1.4.5-0.20210308125415-9a47e1077a86 h1:sG15pAGzpWLD9dO6mt5VYEk30vcngjoUD5NjD1C0ztQ= modernc.org/tcl v1.4.5-0.20210308125415-9a47e1077a86/go.mod h1:gb57hj4pO8fRrK54zveIfFXBaMHK3SKJNWcmRw1cRzc= +modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.0.1-0.20210308123920-1f282aa71362 h1:xUpazXgMcN3whs6DGzAUHVlZyQl4sahj6Lvv2kFj73w= modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= diff --git a/internal/testfixture/testfixture_darwin_arm64.go b/internal/testfixture/testfixture_darwin_arm64.go index 3f0047a..f67ff15 100644 --- a/internal/testfixture/testfixture_darwin_arm64.go +++ b/internal/testfixture/testfixture_darwin_arm64.go @@ -4413,6 +4413,343 @@ const ( /* qos.h:130:1: */ QOS_CLASS_UNSPECIFIED = 0 ) +// Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ +// - +// Copyright (c) 1990, 1993 +// The Regents of the University of California. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)string.h 8.1 (Berkeley) 6/2/93 + +// Security checking functions. +// Copyright (c) 2017 Apple Inc. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ + +// Copyright (c) 2000-2018 Apple Inc. All rights reserved. +// +// @APPLE_OSREFERENCE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. The rights granted to you under the License +// may not be used to create, or enable the creation or redistribution of, +// unlawful or unlicensed copies of an Apple operating system, or to +// circumvent, violate, or enable the circumvention or violation of, any +// terms of an Apple operating system software license agreement. +// +// Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_OSREFERENCE_LICENSE_HEADER_END@ +// Copyright 1995 NeXT Computer, Inc. All rights reserved. +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + +// Copyright (c) 2007-2016 by Apple Inc.. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ + +// Copyright (c) 2007, 2008 Apple Inc. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ + +// bcopy and bzero + +// Removed in Issue 7 + +// void bcopy(const void *src, void *dst, size_t len) + +// void bzero(void *s, size_t n) + +// Security checking functions. +// Copyright (c) 2007,2017 Apple Inc. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ + +// Copyright (c) 2000-2018 Apple Inc. All rights reserved. +// +// @APPLE_OSREFERENCE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. The rights granted to you under the License +// may not be used to create, or enable the creation or redistribution of, +// unlawful or unlicensed copies of an Apple operating system, or to +// circumvent, violate, or enable the circumvention or violation of, any +// terms of an Apple operating system software license agreement. +// +// Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_OSREFERENCE_LICENSE_HEADER_END@ +// Copyright 1995 NeXT Computer, Inc. All rights reserved. +// Copyright (c) 1991, 1993 +// The Regents of the University of California. All rights reserved. +// +// This code is derived from software contributed to Berkeley by +// Berkeley Software Design, Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. All advertising materials mentioning features or use of this software +// must display the following acknowledgement: +// This product includes software developed by the University of +// California, Berkeley and its contributors. +// 4. Neither the name of the University nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// +// @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + +// Copyright (c) 2007-2016 by Apple Inc.. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ + +// Copyright (c) 2007, 2008 Apple Inc. All rights reserved. +// +// @APPLE_LICENSE_HEADER_START@ +// +// This file contains Original Code and/or Modifications of Original Code +// as defined in and that are subject to the Apple Public Source License +// Version 2.0 (the 'License'). You may not use this file except in +// compliance with the License. Please obtain a copy of the License at +// http://www.opensource.apple.com/apsl/ and read it before using this +// file. +// +// The Original Code and all software distributed under the License are +// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +// Please see the License for the specific language governing rights and +// limitations under the License. +// +// @APPLE_LICENSE_HEADER_END@ + +// + +// memccpy, memcpy, mempcpy, memmove, memset, strcpy, strlcpy, stpcpy, +// strncpy, stpncpy, strcat, strlcat, and strncat + +// void *memcpy(void *dst, const void *src, size_t n) + +// void *memmove(void *dst, const void *src, size_t len) + +// void *memset(void *b, int c, size_t len) + +// char *strcpy(char *dst, const char *src) + +// char *stpcpy(char *dst, const char *src) + +// char *stpncpy(char *dst, const char *src, size_t n) + +// char *strncpy(char *dst, const char *src, size_t n) + +// char *strcat(char *s1, const char *s2) + +// char *strncat(char *s1, const char *s2, size_t n) + // Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved. // // @APPLE_LICENSE_HEADER_START@ @@ -8715,7 +9052,7 @@ func idxHashString(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3expert.c for i = 0; i < n; i++ { ret = ret + ((ret << 3) + uint32((uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))) } - return (int32(ret % IDX_HASH_SIZE)) + return (int32(ret % uint32(IDX_HASH_SIZE))) } // If zKey is already present in the hash table, return non-zero and do @@ -20601,7 +20938,7 @@ func amatchLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3152, /* "%s: maximum stri..." */ libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, AMATCH_MX_LENGTH)) rc = SQLITE_ERROR - } else if (iLang < int64(0)) || (iLang > AMATCH_MX_LANGID) { + } else if (iLang < int64(0)) || (iLang > int64(AMATCH_MX_LANGID)) { *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3184, /* "%s: iLang must b..." */ libc.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, AMATCH_MX_LANGID)) rc = SQLITE_ERROR @@ -22034,7 +22371,7 @@ func carrayFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp return int64(0) }() if idxNum < 3 { - (*carray_cursor)(unsafe.Pointer(pCur)).FeType = CARRAY_INT32 + (*carray_cursor)(unsafe.Pointer(pCur)).FeType = uint8(CARRAY_INT32) } else { var i uint8 var zType uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) @@ -23157,7 +23494,7 @@ func csv_getc_refill(tls *libc.TLS, p uintptr) int32 { /* csv.c:151:25: */ // Only called on an empty input buffer // Only called if reading froma file - got = libc.Xfread(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn, uint64(1), CSV_INBUFSZ, (*CsvReader)(unsafe.Pointer(p)).Fin) + got = libc.Xfread(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn, uint64(1), uint64(CSV_INBUFSZ), (*CsvReader)(unsafe.Pointer(p)).Fin) if got == uint64(0) { return -1 } @@ -23998,7 +24335,7 @@ func csvtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp // for testing certain kinds of virtual table behavior. func csvtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* csv.c:833:12: */ (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1000000) - if ((*CsvTable)(unsafe.Pointer((tab))).FtstFlags & CSVTEST_FIDX) != uint32(0) { + if ((*CsvTable)(unsafe.Pointer((tab))).FtstFlags & uint32(CSVTEST_FIDX)) != uint32(0) { // The usual (and sensible) case is to always do a full table scan. // The code in this branch only runs when testflags=1. This code // generates an artifical and unrealistic plan which is useful @@ -31863,7 +32200,7 @@ func fuzzerLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3152, /* "%s: maximum stri..." */ libc.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, FUZZER_MX_LENGTH)) rc = SQLITE_ERROR - } else if (iRuleset < int64(0)) || (iRuleset > FUZZER_MX_RULEID) { + } else if (iRuleset < int64(0)) || (iRuleset > int64(FUZZER_MX_RULEID)) { *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+5048, /* "%s: ruleset must..." */ libc.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, FUZZER_MX_RULEID)) rc = SQLITE_ERROR @@ -32162,7 +32499,7 @@ func fuzzerHash(tls *libc.TLS, z uintptr) uint32 { /* fuzzer.c:647:21: */ for *(*int8)(unsafe.Pointer(z)) != 0 { h = (((h << 3) ^ (h >> 29)) ^ uint32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) } - return (h % FUZZER_HASH) + return (h % uint32(FUZZER_HASH)) } // Current cost of a stem @@ -39081,97 +39418,97 @@ type u16 = uint16 /* spellfix.c:34:26 */ // The following table gives the character class for non-initial ASCII // characters. var midClass = [128]uint8{ - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_SPACE /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_SPACE, - /* ! */ CCLASS_OTHER /* " */, CCLASS_OTHER /* # */, CCLASS_OTHER, - /* $ */ CCLASS_OTHER /* % */, CCLASS_OTHER /* & */, CCLASS_OTHER, - /* ' */ CCLASS_SILENT /* ( */, CCLASS_OTHER /* ) */, CCLASS_OTHER, - /* * */ CCLASS_OTHER /* + */, CCLASS_OTHER /* , */, CCLASS_OTHER, - /* - */ CCLASS_OTHER /* . */, CCLASS_OTHER /* / */, CCLASS_OTHER, - /* 0 */ CCLASS_DIGIT /* 1 */, CCLASS_DIGIT /* 2 */, CCLASS_DIGIT, - /* 3 */ CCLASS_DIGIT /* 4 */, CCLASS_DIGIT /* 5 */, CCLASS_DIGIT, - /* 6 */ CCLASS_DIGIT /* 7 */, CCLASS_DIGIT /* 8 */, CCLASS_DIGIT, - /* 9 */ CCLASS_DIGIT /* : */, CCLASS_OTHER /* ; */, CCLASS_OTHER, - /* < */ CCLASS_OTHER /* = */, CCLASS_OTHER /* > */, CCLASS_OTHER, - /* ? */ CCLASS_OTHER /* @ */, CCLASS_OTHER /* A */, CCLASS_VOWEL, - /* B */ CCLASS_B /* C */, CCLASS_C /* D */, CCLASS_D, - /* E */ CCLASS_VOWEL /* F */, CCLASS_B /* G */, CCLASS_C, - /* H */ CCLASS_SILENT /* I */, CCLASS_VOWEL /* J */, CCLASS_C, - /* K */ CCLASS_C /* L */, CCLASS_L /* M */, CCLASS_M, - /* N */ CCLASS_M /* O */, CCLASS_VOWEL /* P */, CCLASS_B, - /* Q */ CCLASS_C /* R */, CCLASS_R /* S */, CCLASS_C, - /* T */ CCLASS_D /* U */, CCLASS_VOWEL /* V */, CCLASS_B, - /* W */ CCLASS_B /* X */, CCLASS_C /* Y */, CCLASS_VOWEL, - /* Z */ CCLASS_C /* [ */, CCLASS_OTHER /* \ */, CCLASS_OTHER, - /* ] */ CCLASS_OTHER /* ^ */, CCLASS_OTHER /* _ */, CCLASS_OTHER, - /* ` */ CCLASS_OTHER /* a */, CCLASS_VOWEL /* b */, CCLASS_B, - /* c */ CCLASS_C /* d */, CCLASS_D /* e */, CCLASS_VOWEL, - /* f */ CCLASS_B /* g */, CCLASS_C /* h */, CCLASS_SILENT, - /* i */ CCLASS_VOWEL /* j */, CCLASS_C /* k */, CCLASS_C, - /* l */ CCLASS_L /* m */, CCLASS_M /* n */, CCLASS_M, - /* o */ CCLASS_VOWEL /* p */, CCLASS_B /* q */, CCLASS_C, - /* r */ CCLASS_R /* s */, CCLASS_C /* t */, CCLASS_D, - /* u */ CCLASS_VOWEL /* v */, CCLASS_B /* w */, CCLASS_B, - /* x */ CCLASS_C /* y */, CCLASS_VOWEL /* z */, CCLASS_C, - /* { */ CCLASS_OTHER /* | */, CCLASS_OTHER /* } */, CCLASS_OTHER, - /* ~ */ CCLASS_OTHER /* */, CCLASS_OTHER, + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_SPACE), + /* ! */ uint8(CCLASS_OTHER) /* " */, uint8(CCLASS_OTHER) /* # */, uint8(CCLASS_OTHER), + /* $ */ uint8(CCLASS_OTHER) /* % */, uint8(CCLASS_OTHER) /* & */, uint8(CCLASS_OTHER), + /* ' */ uint8(CCLASS_SILENT) /* ( */, uint8(CCLASS_OTHER) /* ) */, uint8(CCLASS_OTHER), + /* * */ uint8(CCLASS_OTHER) /* + */, uint8(CCLASS_OTHER) /* , */, uint8(CCLASS_OTHER), + /* - */ uint8(CCLASS_OTHER) /* . */, uint8(CCLASS_OTHER) /* / */, uint8(CCLASS_OTHER), + /* 0 */ uint8(CCLASS_DIGIT) /* 1 */, uint8(CCLASS_DIGIT) /* 2 */, uint8(CCLASS_DIGIT), + /* 3 */ uint8(CCLASS_DIGIT) /* 4 */, uint8(CCLASS_DIGIT) /* 5 */, uint8(CCLASS_DIGIT), + /* 6 */ uint8(CCLASS_DIGIT) /* 7 */, uint8(CCLASS_DIGIT) /* 8 */, uint8(CCLASS_DIGIT), + /* 9 */ uint8(CCLASS_DIGIT) /* : */, uint8(CCLASS_OTHER) /* ; */, uint8(CCLASS_OTHER), + /* < */ uint8(CCLASS_OTHER) /* = */, uint8(CCLASS_OTHER) /* > */, uint8(CCLASS_OTHER), + /* ? */ uint8(CCLASS_OTHER) /* @ */, uint8(CCLASS_OTHER) /* A */, uint8(CCLASS_VOWEL), + /* B */ uint8(CCLASS_B) /* C */, uint8(CCLASS_C) /* D */, uint8(CCLASS_D), + /* E */ uint8(CCLASS_VOWEL) /* F */, uint8(CCLASS_B) /* G */, uint8(CCLASS_C), + /* H */ uint8(CCLASS_SILENT) /* I */, uint8(CCLASS_VOWEL) /* J */, uint8(CCLASS_C), + /* K */ uint8(CCLASS_C) /* L */, uint8(CCLASS_L) /* M */, uint8(CCLASS_M), + /* N */ uint8(CCLASS_M) /* O */, uint8(CCLASS_VOWEL) /* P */, uint8(CCLASS_B), + /* Q */ uint8(CCLASS_C) /* R */, uint8(CCLASS_R) /* S */, uint8(CCLASS_C), + /* T */ uint8(CCLASS_D) /* U */, uint8(CCLASS_VOWEL) /* V */, uint8(CCLASS_B), + /* W */ uint8(CCLASS_B) /* X */, uint8(CCLASS_C) /* Y */, uint8(CCLASS_VOWEL), + /* Z */ uint8(CCLASS_C) /* [ */, uint8(CCLASS_OTHER) /* \ */, uint8(CCLASS_OTHER), + /* ] */ uint8(CCLASS_OTHER) /* ^ */, uint8(CCLASS_OTHER) /* _ */, uint8(CCLASS_OTHER), + /* ` */ uint8(CCLASS_OTHER) /* a */, uint8(CCLASS_VOWEL) /* b */, uint8(CCLASS_B), + /* c */ uint8(CCLASS_C) /* d */, uint8(CCLASS_D) /* e */, uint8(CCLASS_VOWEL), + /* f */ uint8(CCLASS_B) /* g */, uint8(CCLASS_C) /* h */, uint8(CCLASS_SILENT), + /* i */ uint8(CCLASS_VOWEL) /* j */, uint8(CCLASS_C) /* k */, uint8(CCLASS_C), + /* l */ uint8(CCLASS_L) /* m */, uint8(CCLASS_M) /* n */, uint8(CCLASS_M), + /* o */ uint8(CCLASS_VOWEL) /* p */, uint8(CCLASS_B) /* q */, uint8(CCLASS_C), + /* r */ uint8(CCLASS_R) /* s */, uint8(CCLASS_C) /* t */, uint8(CCLASS_D), + /* u */ uint8(CCLASS_VOWEL) /* v */, uint8(CCLASS_B) /* w */, uint8(CCLASS_B), + /* x */ uint8(CCLASS_C) /* y */, uint8(CCLASS_VOWEL) /* z */, uint8(CCLASS_C), + /* { */ uint8(CCLASS_OTHER) /* | */, uint8(CCLASS_OTHER) /* } */, uint8(CCLASS_OTHER), + /* ~ */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), } /* spellfix.c:75:28 */ // This tables gives the character class for ASCII characters that form the // initial character of a word. The only difference from midClass is with // the letters H, W, and Y. var initClass = [128]uint8{ - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_SPACE /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_SPACE, - /* ! */ CCLASS_OTHER /* " */, CCLASS_OTHER /* # */, CCLASS_OTHER, - /* $ */ CCLASS_OTHER /* % */, CCLASS_OTHER /* & */, CCLASS_OTHER, - /* ' */ CCLASS_OTHER /* ( */, CCLASS_OTHER /* ) */, CCLASS_OTHER, - /* * */ CCLASS_OTHER /* + */, CCLASS_OTHER /* , */, CCLASS_OTHER, - /* - */ CCLASS_OTHER /* . */, CCLASS_OTHER /* / */, CCLASS_OTHER, - /* 0 */ CCLASS_DIGIT /* 1 */, CCLASS_DIGIT /* 2 */, CCLASS_DIGIT, - /* 3 */ CCLASS_DIGIT /* 4 */, CCLASS_DIGIT /* 5 */, CCLASS_DIGIT, - /* 6 */ CCLASS_DIGIT /* 7 */, CCLASS_DIGIT /* 8 */, CCLASS_DIGIT, - /* 9 */ CCLASS_DIGIT /* : */, CCLASS_OTHER /* ; */, CCLASS_OTHER, - /* < */ CCLASS_OTHER /* = */, CCLASS_OTHER /* > */, CCLASS_OTHER, - /* ? */ CCLASS_OTHER /* @ */, CCLASS_OTHER /* A */, CCLASS_VOWEL, - /* B */ CCLASS_B /* C */, CCLASS_C /* D */, CCLASS_D, - /* E */ CCLASS_VOWEL /* F */, CCLASS_B /* G */, CCLASS_C, - /* H */ CCLASS_SILENT /* I */, CCLASS_VOWEL /* J */, CCLASS_C, - /* K */ CCLASS_C /* L */, CCLASS_L /* M */, CCLASS_M, - /* N */ CCLASS_M /* O */, CCLASS_VOWEL /* P */, CCLASS_B, - /* Q */ CCLASS_C /* R */, CCLASS_R /* S */, CCLASS_C, - /* T */ CCLASS_D /* U */, CCLASS_VOWEL /* V */, CCLASS_B, - /* W */ CCLASS_B /* X */, CCLASS_C /* Y */, CCLASS_Y, - /* Z */ CCLASS_C /* [ */, CCLASS_OTHER /* \ */, CCLASS_OTHER, - /* ] */ CCLASS_OTHER /* ^ */, CCLASS_OTHER /* _ */, CCLASS_OTHER, - /* ` */ CCLASS_OTHER /* a */, CCLASS_VOWEL /* b */, CCLASS_B, - /* c */ CCLASS_C /* d */, CCLASS_D /* e */, CCLASS_VOWEL, - /* f */ CCLASS_B /* g */, CCLASS_C /* h */, CCLASS_SILENT, - /* i */ CCLASS_VOWEL /* j */, CCLASS_C /* k */, CCLASS_C, - /* l */ CCLASS_L /* m */, CCLASS_M /* n */, CCLASS_M, - /* o */ CCLASS_VOWEL /* p */, CCLASS_B /* q */, CCLASS_C, - /* r */ CCLASS_R /* s */, CCLASS_C /* t */, CCLASS_D, - /* u */ CCLASS_VOWEL /* v */, CCLASS_B /* w */, CCLASS_B, - /* x */ CCLASS_C /* y */, CCLASS_Y /* z */, CCLASS_C, - /* { */ CCLASS_OTHER /* | */, CCLASS_OTHER /* } */, CCLASS_OTHER, - /* ~ */ CCLASS_OTHER /* */, CCLASS_OTHER, + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_SPACE), + /* ! */ uint8(CCLASS_OTHER) /* " */, uint8(CCLASS_OTHER) /* # */, uint8(CCLASS_OTHER), + /* $ */ uint8(CCLASS_OTHER) /* % */, uint8(CCLASS_OTHER) /* & */, uint8(CCLASS_OTHER), + /* ' */ uint8(CCLASS_OTHER) /* ( */, uint8(CCLASS_OTHER) /* ) */, uint8(CCLASS_OTHER), + /* * */ uint8(CCLASS_OTHER) /* + */, uint8(CCLASS_OTHER) /* , */, uint8(CCLASS_OTHER), + /* - */ uint8(CCLASS_OTHER) /* . */, uint8(CCLASS_OTHER) /* / */, uint8(CCLASS_OTHER), + /* 0 */ uint8(CCLASS_DIGIT) /* 1 */, uint8(CCLASS_DIGIT) /* 2 */, uint8(CCLASS_DIGIT), + /* 3 */ uint8(CCLASS_DIGIT) /* 4 */, uint8(CCLASS_DIGIT) /* 5 */, uint8(CCLASS_DIGIT), + /* 6 */ uint8(CCLASS_DIGIT) /* 7 */, uint8(CCLASS_DIGIT) /* 8 */, uint8(CCLASS_DIGIT), + /* 9 */ uint8(CCLASS_DIGIT) /* : */, uint8(CCLASS_OTHER) /* ; */, uint8(CCLASS_OTHER), + /* < */ uint8(CCLASS_OTHER) /* = */, uint8(CCLASS_OTHER) /* > */, uint8(CCLASS_OTHER), + /* ? */ uint8(CCLASS_OTHER) /* @ */, uint8(CCLASS_OTHER) /* A */, uint8(CCLASS_VOWEL), + /* B */ uint8(CCLASS_B) /* C */, uint8(CCLASS_C) /* D */, uint8(CCLASS_D), + /* E */ uint8(CCLASS_VOWEL) /* F */, uint8(CCLASS_B) /* G */, uint8(CCLASS_C), + /* H */ uint8(CCLASS_SILENT) /* I */, uint8(CCLASS_VOWEL) /* J */, uint8(CCLASS_C), + /* K */ uint8(CCLASS_C) /* L */, uint8(CCLASS_L) /* M */, uint8(CCLASS_M), + /* N */ uint8(CCLASS_M) /* O */, uint8(CCLASS_VOWEL) /* P */, uint8(CCLASS_B), + /* Q */ uint8(CCLASS_C) /* R */, uint8(CCLASS_R) /* S */, uint8(CCLASS_C), + /* T */ uint8(CCLASS_D) /* U */, uint8(CCLASS_VOWEL) /* V */, uint8(CCLASS_B), + /* W */ uint8(CCLASS_B) /* X */, uint8(CCLASS_C) /* Y */, uint8(CCLASS_Y), + /* Z */ uint8(CCLASS_C) /* [ */, uint8(CCLASS_OTHER) /* \ */, uint8(CCLASS_OTHER), + /* ] */ uint8(CCLASS_OTHER) /* ^ */, uint8(CCLASS_OTHER) /* _ */, uint8(CCLASS_OTHER), + /* ` */ uint8(CCLASS_OTHER) /* a */, uint8(CCLASS_VOWEL) /* b */, uint8(CCLASS_B), + /* c */ uint8(CCLASS_C) /* d */, uint8(CCLASS_D) /* e */, uint8(CCLASS_VOWEL), + /* f */ uint8(CCLASS_B) /* g */, uint8(CCLASS_C) /* h */, uint8(CCLASS_SILENT), + /* i */ uint8(CCLASS_VOWEL) /* j */, uint8(CCLASS_C) /* k */, uint8(CCLASS_C), + /* l */ uint8(CCLASS_L) /* m */, uint8(CCLASS_M) /* n */, uint8(CCLASS_M), + /* o */ uint8(CCLASS_VOWEL) /* p */, uint8(CCLASS_B) /* q */, uint8(CCLASS_C), + /* r */ uint8(CCLASS_R) /* s */, uint8(CCLASS_C) /* t */, uint8(CCLASS_D), + /* u */ uint8(CCLASS_VOWEL) /* v */, uint8(CCLASS_B) /* w */, uint8(CCLASS_B), + /* x */ uint8(CCLASS_C) /* y */, uint8(CCLASS_Y) /* z */, uint8(CCLASS_C), + /* { */ uint8(CCLASS_OTHER) /* | */, uint8(CCLASS_OTHER) /* } */, uint8(CCLASS_OTHER), + /* ~ */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), } /* spellfix.c:125:28 */ // Mapping from the character class number (0-13) to a symbol for each @@ -46212,7 +46549,7 @@ func zipfileReadCDS(tls *libc.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfil var aRead uintptr = aBuf var sig u321 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }() var rc int32 = SQLITE_OK - if sig != ZIPFILE_SIGNATURE_CDS { + if sig != uint64(ZIPFILE_SIGNATURE_CDS) { rc = SQLITE_ERROR } else { (*ZipfileCDS)(unsafe.Pointer(pCDS)).FiVersionMadeBy = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }() @@ -46245,7 +46582,7 @@ func zipfileReadLFH(tls *libc.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zip var rc int32 = SQLITE_OK var sig u321 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }() - if sig != ZIPFILE_SIGNATURE_LFH { + if sig != uint64(ZIPFILE_SIGNATURE_LFH) { rc = SQLITE_ERROR } else { (*ZipfileLFH)(unsafe.Pointer(pLFH)).FiVersionExtract = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }() @@ -46445,9 +46782,9 @@ func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8919 /* "failed to read C..." */, libc.VaList(bp, iOff)) } else if aBlob == uintptr(0) { rc = zipfileReadData(tls, - pFile, aRead, (nExtra + nFile), (iOff + ZIPFILE_CDS_FIXED_SZ), pzErr) + pFile, aRead, (nExtra + nFile), (iOff + int64(ZIPFILE_CDS_FIXED_SZ)), pzErr) } else { - aRead = (aBlob + uintptr((iOff + ZIPFILE_CDS_FIXED_SZ))) + aRead = (aBlob + uintptr((iOff + int64(ZIPFILE_CDS_FIXED_SZ)))) } } @@ -46474,7 +46811,7 @@ func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF rc = zipfileReadLFH(tls, aRead, bp+32 /* &lfh */) if rc == SQLITE_OK { - (*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff = (i64((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset + ZIPFILE_LFH_FIXED_SZ)) + (*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff = (i64((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset + uint64(ZIPFILE_LFH_FIXED_SZ))) *(*i64)(unsafe.Pointer(pNew + 96 /* &.iDataOff */)) += (i64(int32((*ZipfileLFH)(unsafe.Pointer(bp+32 /* &lfh */)).FnFile) + int32((*ZipfileLFH)(unsafe.Pointer(bp+32 /* &lfh */)).FnExtra))) if (aBlob != 0) && ((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed != 0) { (*ZipfileEntry)(unsafe.Pointer(pNew)).FaData = ((*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra + uintptr(nExtra)) @@ -46517,7 +46854,7 @@ func zipfileNext(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */ var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab rc = zipfileGetEntry(tls, pTab, uintptr(0), 0, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FiNextOff, bp /* &p */) if rc == SQLITE_OK { - *(*i64)(unsafe.Pointer(pCsr + 32 /* &.iNextOff */)) += (ZIPFILE_CDS_FIXED_SZ) + *(*i64)(unsafe.Pointer(pCsr + 32 /* &.iNextOff */)) += (int64(ZIPFILE_CDS_FIXED_SZ)) *(*i64)(unsafe.Pointer(pCsr + 32 /* &.iNextOff */)) += (i64((int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fcds.FnExtra) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fcds.FnFile)) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fcds.FnComment))) } (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent = *(*uintptr)(unsafe.Pointer(bp /* p */)) @@ -46697,7 +47034,7 @@ func zipfileColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* // it to be a directory either if the mode suggests so, or if // the final character in the name is '/'. var mode u321 = ((*ZipfileCDS)(unsafe.Pointer(pCDS)).FiExternalAttr >> 16) - if !((mode & S_IFDIR) != 0) && (int32(*(*int8)(unsafe.Pointer((*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile + uintptr((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile) - 1))))) != '/') { + if !((mode & uint64(S_IFDIR)) != 0) && (int32(*(*int8)(unsafe.Pointer((*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile + uintptr((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile) - 1))))) != '/') { sqlite3.Xsqlite3_result_blob(tls, ctx, ts+488 /* "" */, 0, uintptr(0)) } } @@ -46832,7 +47169,7 @@ func zipfileLoadDirectory(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int3 if rc == SQLITE_OK { zipfileAddEntry(tls, pTab, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */))) - iOff = iOff + (ZIPFILE_CDS_FIXED_SZ) + iOff = iOff + (int64(ZIPFILE_CDS_FIXED_SZ)) iOff = iOff + (i64((int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */)))).Fcds.FnExtra) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */)))).Fcds.FnFile)) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */)))).Fcds.FnComment))) } } @@ -46955,7 +47292,7 @@ func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* /* Write the LFH itself */ { - zipfilePutU32(tls, a, ZIPFILE_SIGNATURE_LFH) + zipfilePutU32(tls, a, uint64(ZIPFILE_SIGNATURE_LFH)) a += uintptr(4) } @@ -47015,7 +47352,7 @@ func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* /* The "extra" data */ { - zipfilePutU16(tls, a, ZIPFILE_EXTRA_TIMESTAMP) + zipfilePutU16(tls, a, uint16(ZIPFILE_EXTRA_TIMESTAMP)) a += uintptr(2) } @@ -47095,13 +47432,13 @@ __5: } goto __6 __7: - mode = mode | (S_IFREG) + mode = mode | (uint64(S_IFREG)) goto __6 __8: - mode = mode | (S_IFDIR) + mode = mode | (uint64(S_IFDIR)) goto __6 __9: - mode = mode | (S_IFLNK) + mode = mode | (uint64(S_IFLNK)) goto __6 __10: goto parse_error @@ -47137,7 +47474,7 @@ __4: ; __2: ; - if !((libc.Bool32((mode & S_IFDIR) == uint64(0))) == bIsDir) { + if !((libc.Bool32((mode & uint64(S_IFDIR)) == uint64(0))) == bIsDir) { goto __17 } // The "mode" attribute is a directory, but data has been specified. @@ -47545,8 +47882,8 @@ __28: goto __39 __38: (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiVersionMadeBy = (u16((int32(3) << 8) + 30)) - (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiVersionExtract = ZIPFILE_NEWENTRY_REQUIRED - (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fflags = ZIPFILE_NEWENTRY_FLAGS + (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiVersionExtract = u16(ZIPFILE_NEWENTRY_REQUIRED) + (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fflags = u16(ZIPFILE_NEWENTRY_FLAGS) (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiCompression = u16(iMethod) zipfileMtimeToDos(tls, (pNew /* &.cds */), mTime) (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fcrc32 = iCrc32 @@ -47602,7 +47939,7 @@ zipfile_update_done: func zipfileSerializeEOCD(tls *libc.TLS, p uintptr, aBuf uintptr) int32 { /* zipfile.c:1716:12: */ var a uintptr = aBuf { - zipfilePutU32(tls, a, ZIPFILE_SIGNATURE_EOCD) + zipfilePutU32(tls, a, uint64(ZIPFILE_SIGNATURE_EOCD)) a += uintptr(4) } @@ -47662,7 +47999,7 @@ func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* } { - zipfilePutU32(tls, a, ZIPFILE_SIGNATURE_CDS) + zipfilePutU32(tls, a, uint64(ZIPFILE_SIGNATURE_CDS)) a += uintptr(4) } @@ -47756,7 +48093,7 @@ func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* } else { { - zipfilePutU16(tls, a, ZIPFILE_EXTRA_TIMESTAMP) + zipfilePutU16(tls, a, uint16(ZIPFILE_EXTRA_TIMESTAMP)) a += uintptr(2) } @@ -48128,8 +48465,8 @@ __17: // Assemble the ZipfileEntry object for the new zip archive entry (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiVersionMadeBy = (u16((int32(3) << 8) + 30)) - (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiVersionExtract = ZIPFILE_NEWENTRY_REQUIRED - (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fflags = ZIPFILE_NEWENTRY_FLAGS + (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiVersionExtract = u16(ZIPFILE_NEWENTRY_REQUIRED) + (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fflags = u16(ZIPFILE_NEWENTRY_FLAGS) (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiCompression = u16(iMethod) zipfileMtimeToDos(tls, (bp + 16 /* &e */ /* &.cds */), (*ZipfileEntry)(unsafe.Pointer(bp+16 /* &e */)).FmUnixTime) (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fcrc32 = iCrc32 @@ -49203,7 +49540,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui var pCmd uintptr switch type1 { - case SQLITE_TRACE_STMT: + case uint32(SQLITE_TRACE_STMT): { var pStmt uintptr = pd var zSql uintptr = xd @@ -49224,7 +49561,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui break } - case SQLITE_TRACE_PROFILE: + case uint32(SQLITE_TRACE_PROFILE): { var pStmt uintptr = pd var ns sqlite3_int64 = *(*sqlite3_int64)(unsafe.Pointer(xd)) @@ -49245,7 +49582,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui break } - case SQLITE_TRACE_ROW: + case uint32(SQLITE_TRACE_ROW): { var pStmt uintptr = pd @@ -49263,7 +49600,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui break } - case SQLITE_TRACE_CLOSE: + case uint32(SQLITE_TRACE_CLOSE): { var db uintptr = pd @@ -49939,7 +50276,7 @@ func dbPrepare(tls *libc.TLS, pDb uintptr, zSql uintptr, ppStmt uintptr, pzOut u // flags, which uses less lookaside memory. But if the cache is small, // omit that flag to make full use of lookaside if (*SqliteDb)(unsafe.Pointer(pDb)).FmaxStmt > 5 { - prepFlags = SQLITE_PREPARE_PERSISTENT + prepFlags = uint32(SQLITE_PREPARE_PERSISTENT) } return sqlite3.Xsqlite3_prepare_v3(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSql, -1, prepFlags, ppStmt, pzOut) @@ -52813,7 +53150,7 @@ __32: rc = TCL_ERROR goto __283 __282: - pData1 = sqlite3.Xsqlite3_serialize(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSchema1, bp+1400 /* &sz */, SQLITE_SERIALIZE_NOCOPY) + pData1 = sqlite3.Xsqlite3_serialize(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSchema1, bp+1400 /* &sz */, uint32(SQLITE_SERIALIZE_NOCOPY)) if !(pData1 != 0) { goto __284 } @@ -53087,16 +53424,16 @@ __321: } goto __333 __334: - wMask = wMask | (SQLITE_TRACE_STMT) + wMask = wMask | (int64(SQLITE_TRACE_STMT)) goto __333 __335: - wMask = wMask | (SQLITE_TRACE_PROFILE) + wMask = wMask | (int64(SQLITE_TRACE_PROFILE)) goto __333 __336: - wMask = wMask | (SQLITE_TRACE_ROW) + wMask = wMask | (int64(SQLITE_TRACE_ROW)) goto __333 __337: - wMask = wMask | (SQLITE_TRACE_CLOSE) + wMask = wMask | (int64(SQLITE_TRACE_CLOSE)) goto __333 __333: ; @@ -53111,7 +53448,7 @@ __319: ; goto __315 __314: - wMask = SQLITE_TRACE_STMT // use the "legacy" default + wMask = int64(SQLITE_TRACE_STMT) // use the "legacy" default __315: ; if !((*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2 != 0) { @@ -57176,8 +57513,8 @@ func test_create_function(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i var pVal uintptr sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmutex) pVal = sqlite3.Xsqlite3ValueNew(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */))) - sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+14728 /* "x_sqlite_exec" */, SQLITE_UTF8, uintptr(0)) - zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+14728 /* "x_sqlite_exec" */, uint8(SQLITE_UTF8), uintptr(0)) + zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) if (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).FmallocFailed != 0 { rc = SQLITE_NOMEM } else { @@ -57410,7 +57747,7 @@ func sqlite3_mprintf_int64(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc return TCL_ERROR } for i = 2; i < 5; i++ { - if sqlite3.Xsqlite3Atoi64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), (bp+88 /* &a */ +uintptr((i-2))*8), sqlite3.Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))), SQLITE_UTF8) != 0 { + if sqlite3.Xsqlite3Atoi64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), (bp+88 /* &a */ +uintptr((i-2))*8), sqlite3.Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))), uint8(SQLITE_UTF8)) != 0 { tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+14842 /* "argument is not ..." */, 0)) return TCL_ERROR } @@ -59177,7 +59514,7 @@ __2: __3: ; rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+15985 /* "test_collate" */, SQLITE_UTF8, - SQLITE_UTF8, func() uintptr { + uintptr(SQLITE_UTF8), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -59195,7 +59532,7 @@ __3: __5: ; rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+15985 /* "test_collate" */, SQLITE_UTF16LE, - SQLITE_UTF16LE, func() uintptr { + uintptr(SQLITE_UTF16LE), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -59212,8 +59549,8 @@ __6: sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))).Fmutex) pVal = sqlite3.Xsqlite3ValueNew(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))) - sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+15985 /* "test_collate" */, SQLITE_UTF8, uintptr(0)) - zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+15985 /* "test_collate" */, uint8(SQLITE_UTF8), uintptr(0)) + zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) if !((*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))).FmallocFailed != 0) { goto __7 } @@ -59221,7 +59558,7 @@ __6: goto __8 __7: rc = sqlite3.Xsqlite3_create_collation16(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), zUtf16, SQLITE_UTF16BE, - SQLITE_UTF16BE, func() uintptr { + uintptr(SQLITE_UTF16BE), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -59478,7 +59815,7 @@ func test_function_utf8(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { sqlite3.Xsqlite3_result_text(tls, pCtx, tcl.XTcl_GetStringResult(tls, interp), -1, libc.UintptrFromInt32(-1)) pVal = sqlite3.Xsqlite3ValueNew(tls, uintptr(0)) sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, tcl.XTcl_GetStringResult(tls, interp), - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) sqlite3.Xsqlite3_result_text16be(tls, pCtx, sqlite3.Xsqlite3_value_text16be(tls, pVal), -1, libc.UintptrFromInt32(-1)) sqlite3.Xsqlite3ValueFree(tls, pVal) @@ -59502,7 +59839,7 @@ func test_function_utf16le(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr } pVal = sqlite3.Xsqlite3ValueNew(tls, uintptr(0)) sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, tcl.XTcl_GetStringResult(tls, interp), - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) sqlite3.Xsqlite3_result_text(tls, pCtx, sqlite3.Xsqlite3_value_text(tls, pVal), -1, libc.UintptrFromInt32(-1)) sqlite3.Xsqlite3ValueFree(tls, pVal) } @@ -59525,7 +59862,7 @@ func test_function_utf16be(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr } pVal = sqlite3.Xsqlite3ValueNew(tls, uintptr(0)) sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, tcl.XTcl_GetStringResult(tls, interp), - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) sqlite3.Xsqlite3_result_text16(tls, pCtx, sqlite3.Xsqlite3_value_text16le(tls, pVal), -1, libc.UintptrFromInt32(-1)) sqlite3.Xsqlite3_result_text16be(tls, pCtx, sqlite3.Xsqlite3_value_text16le(tls, pVal), @@ -67432,7 +67769,7 @@ func test_value_overhead(tls *libc.TLS, clientData uintptr, interp uintptr, objc (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fflags = (u16((MEM_Str | MEM_Term) | MEM_Static)) (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fz = ts + 25291 /* "hello world" */ - (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fenc = u8(SQLITE_UTF8) for i = 0; i < *(*int32)(unsafe.Pointer(bp + 32 /* repeat_count */)); i++ { if *(*int32)(unsafe.Pointer(bp + 36 /* do_calls */)) != 0 { @@ -67448,10 +67785,10 @@ func name_to_enc(tls *libc.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94 defer tls.Free(104) *(*[5]EncName)(unsafe.Pointer(bp + 24 /* encnames */)) = [5]EncName{ - {FzName: ts + 25303 /* "UTF8" */, Fenc: SQLITE_UTF8}, - {FzName: ts + 25308 /* "UTF16LE" */, Fenc: SQLITE_UTF16LE}, - {FzName: ts + 25316 /* "UTF16BE" */, Fenc: SQLITE_UTF16BE}, - {FzName: ts + 25324 /* "UTF16" */, Fenc: SQLITE_UTF16}, + {FzName: ts + 25303 /* "UTF8" */, Fenc: u8(SQLITE_UTF8)}, + {FzName: ts + 25308 /* "UTF16LE" */, Fenc: u8(SQLITE_UTF16LE)}, + {FzName: ts + 25316 /* "UTF16BE" */, Fenc: u8(SQLITE_UTF16BE)}, + {FzName: ts + 25324 /* "UTF16" */, Fenc: u8(SQLITE_UTF16)}, {}, } var pEnc uintptr @@ -67465,7 +67802,7 @@ func name_to_enc(tls *libc.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94 tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25330 /* "No such encoding..." */, z, 0)) } if int32((*EncName)(unsafe.Pointer(pEnc)).Fenc) == SQLITE_UTF16 { - return SQLITE_UTF16LE + return u8(SQLITE_UTF16LE) } return (*EncName)(unsafe.Pointer(pEnc)).Fenc } @@ -75184,26 +75521,26 @@ var aFuncs = [20]struct { FeTextRep uint32 FxFunc uintptr }{ - {FzName: ts + 30251 /* "randstr" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30259 /* "test_destructor" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30275 /* "test_destructor1..." */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30293 /* "hex_to_utf16be" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30308 /* "hex_to_utf16le" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30323 /* "hex_to_utf8" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30335 /* "test_destructor_..." */, FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30357 /* "test_auxdata" */, FnArg: int8(-1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30370 /* "test_error" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30370 /* "test_error" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30381 /* "test_eval" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30391 /* "test_isolation" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30406 /* "test_counter" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30419 /* "real2hex" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30428 /* "test_decode" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30440 /* "test_extract" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, + {FzName: ts + 30251 /* "randstr" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30259 /* "test_destructor" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30275 /* "test_destructor1..." */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30293 /* "hex_to_utf16be" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30308 /* "hex_to_utf16le" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30323 /* "hex_to_utf8" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30335 /* "test_destructor_..." */, FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30357 /* "test_auxdata" */, FnArg: int8(-1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30370 /* "test_error" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30370 /* "test_error" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30381 /* "test_eval" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30391 /* "test_isolation" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30406 /* "test_counter" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30419 /* "real2hex" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30428 /* "test_decode" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30440 /* "test_extract" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, {FzName: ts + 30453 /* "test_zeroblob" */, FnArg: int8(1), FeTextRep: (uint32(SQLITE_UTF8 | SQLITE_DETERMINISTIC)), FxFunc: 0}, - {FzName: ts + 30467 /* "test_getsubtype" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30483 /* "test_setsubtype" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30499 /* "test_frombind" */, FnArg: int8(-1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, + {FzName: ts + 30467 /* "test_getsubtype" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30483 /* "test_setsubtype" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30499 /* "test_frombind" */, FnArg: int8(-1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, } /* test_func.c:674:5 */ // TCLCMD: autoinstall_test_functions @@ -80368,7 +80705,7 @@ func multiplexOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fl (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(sqlite3.Xsqlite3_uri_boolean(tls, zUri, ts+17691, /* "truncate" */ (libc.Bool32((flags & SQLITE_OPEN_MAIN_DB) == 0)))) (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = uint32(int32(sqlite3.Xsqlite3_uri_int64(tls, zUri, ts+33718, /* "chunksize" */ - SQLITE_MULTIPLEX_CHUNK_SIZE))) + int64(SQLITE_MULTIPLEX_CHUNK_SIZE)))) (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = (((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk + uint32(0xffff)) & libc.Uint32FromInt32(libc.CplInt32(0xffff))) if zName != 0 { var p uintptr = (pGroup + 1*40) @@ -82931,7 +83268,7 @@ func fsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite (((*fs_file)(unsafe.Pointer(p)).FeType == JOURNAL_FILE) && ((sqlite_int64(iAmt) + iOfst) > sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnJournal))) { rc = (SQLITE_IOERR | (int32(2) << 8)) } else if (*fs_file)(unsafe.Pointer(p)).FeType == DATABASE_FILE { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, zBuf, iAmt, (iOfst + BLOCKSIZE)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, zBuf, iAmt, (iOfst + int64(BLOCKSIZE))) } else { // Journal file. var iRem int32 = iAmt @@ -82964,10 +83301,10 @@ func fsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit var pF uintptr = (*fs_real_file)(unsafe.Pointer(pReal)).FpFile if (*fs_file)(unsafe.Pointer(p)).FeType == DATABASE_FILE { - if ((sqlite_int64(iAmt) + iOfst) + BLOCKSIZE) > (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - (*fs_real_file)(unsafe.Pointer(pReal)).FnJournal)) { + if ((sqlite_int64(iAmt) + iOfst) + int64(BLOCKSIZE)) > (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - (*fs_real_file)(unsafe.Pointer(pReal)).FnJournal)) { rc = SQLITE_FULL } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, zBuf, iAmt, (iOfst + BLOCKSIZE)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, zBuf, iAmt, (iOfst + int64(BLOCKSIZE))) if rc == SQLITE_OK { (*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase = func() int32 { if (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase)) > (sqlite_int64(iAmt) + iOfst) { @@ -86270,7 +86607,7 @@ func testpcacheCreate(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int (*testpcache)(unsafe.Pointer(p)).FnPinned = 0 (*testpcache)(unsafe.Pointer(p)).FiRand = testpcacheGlobal.FprngSeed (*testpcache)(unsafe.Pointer(p)).FbPurgeable = bPurgeable - (*testpcache)(unsafe.Pointer(p)).FiMagic = TESTPCACHE_VALID + (*testpcache)(unsafe.Pointer(p)).FiMagic = uint32(TESTPCACHE_VALID) i = 0 __1: if !(i < TESTPCACHE_NPAGE) { @@ -86354,7 +86691,7 @@ func testpcacheFetch(tls *libc.TLS, pCache uintptr, key uint32, createFlag int32 // Find a free page to allocate if there are any free pages. // Withhold TESTPCACHE_RESERVE free pages until createFlag is 2. if ((*testpcache)(unsafe.Pointer(p)).FnFree > TESTPCACHE_RESERVE) || ((createFlag == 2) && ((*testpcache)(unsafe.Pointer(p)).FnFree > 0)) { - j = (int32(testpcacheRandom(tls, p) % TESTPCACHE_NPAGE)) + j = (int32(testpcacheRandom(tls, p) % uint32(TESTPCACHE_NPAGE))) i = 0 __1: if !(i < TESTPCACHE_NPAGE) { @@ -86392,7 +86729,7 @@ func testpcacheFetch(tls *libc.TLS, pCache uintptr, key uint32, createFlag int32 // If there are no free pages, recycle a page. The page to // recycle is selected at random from all unpinned pages. - j = (int32(testpcacheRandom(tls, p) % TESTPCACHE_NPAGE)) + j = (int32(testpcacheRandom(tls, p) % uint32(TESTPCACHE_NPAGE))) i = 0 __4: if !(i < TESTPCACHE_NPAGE) { @@ -86497,7 +86834,7 @@ func testpcacheTruncate(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* test_ var p uintptr = pCache var i uint32 - for i = uint32(0); i < TESTPCACHE_NPAGE; i++ { + for i = uint32(0); i < uint32(TESTPCACHE_NPAGE); i++ { if (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(i)*24)).Fkey >= iLimit { (*testpcachePage)(unsafe.Pointer((p + 32 /* &.a */) + uintptr(i)*24)).Fkey = uint32(0) if (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(i)*24)).FisPinned != 0 { @@ -90012,9 +90349,9 @@ type ServerState = struct { // State information about the server is stored in a static variable // named "g" as follows: var g4 = ServerState{ - FqueueMutex: pthread_mutex_t{F__sig: X_PTHREAD_MUTEX_SIG_init}, - FserverMutex: pthread_mutex_t{F__sig: X_PTHREAD_MUTEX_SIG_init}, - FserverWakeup: pthread_cond_t{F__sig: X_PTHREAD_COND_SIG_init}} /* test_server.c:259:3 */ + FqueueMutex: pthread_mutex_t{F__sig: int64(X_PTHREAD_MUTEX_SIG_init)}, + FserverMutex: pthread_mutex_t{F__sig: int64(X_PTHREAD_MUTEX_SIG_init)}, + FserverWakeup: pthread_cond_t{F__sig: int64(X_PTHREAD_COND_SIG_init)}} /* test_server.c:259:3 */ // Send a message to the server. Block until we get a reply. // diff --git a/lib/sqlite_darwin_arm64.go b/lib/sqlite_darwin_arm64.go index 1812e10..77991f1 100644 --- a/lib/sqlite_darwin_arm64.go +++ b/lib/sqlite_darwin_arm64.go @@ -15933,16 +15933,16 @@ var Xsqlite3Config = Sqlite3Config{ FbMemstat: SQLITE_DEFAULT_MEMSTATUS, // bMemstat FbCoreMutex: U8(1), // bCoreMutex FbFullMutex: (U8(libc.Bool32(SQLITE_THREADSAFE == 1))), // bOpenUri - FbUseCis: SQLITE_ALLOW_COVERING_INDEX_SCAN, // bSmallMalloc + FbUseCis: U8(SQLITE_ALLOW_COVERING_INDEX_SCAN), // bSmallMalloc FbExtraSchemaChecks: U8(1), // bExtraSchemaChecks FmxStrlen: 0x7ffffffe, // neverCorrupt FszLookaside: 1200, FnLookaside: 40, // szLookaside, nLookaside - FnStmtSpill: (64 * 1024), // szMmap - FmxMmap: SQLITE_MAX_MMAP_SIZE, // szPage - FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled - FszPma: SQLITE_SORTER_PMASZ, // bLocaltimeFault - FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold - FszSorterRef: SQLITE_DEFAULT_SORTERREF_SIZE, // iPrngSeed + FnStmtSpill: (64 * 1024), // szMmap + FmxMmap: int64(SQLITE_MAX_MMAP_SIZE), // szPage + FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled + FszPma: U32(SQLITE_SORTER_PMASZ), // bLocaltimeFault + FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold + FszSorterRef: U32(SQLITE_DEFAULT_SORTERREF_SIZE), // iPrngSeed } /* sqlite3.c:20578:48 */ // Hash table for global functions - functions common to all @@ -17425,7 +17425,7 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i return 0 } else if (Xsqlite3StrICmp(tls, zDate, ts+315 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) { return setDateTimeToCurrent(tls, context, p) - } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), SQLITE_UTF8) > 0 { + } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp /* r */))) return 0 } @@ -17733,7 +17733,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i // weekday N where 0==Sunday, 1==Monday, and so forth. If the // date is already on the appropriate weekday, this is a no-op. if ((((Xsqlite3_strnicmp(tls, z, ts+400 /* "weekday " */, 8) == 0) && - (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), SQLITE_UTF8) > 0)) && + (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), uint8(SQLITE_UTF8)) > 0)) && ((float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) { var Z Sqlite3_int64 computeYMD_HMS(tls, p) @@ -17812,7 +17812,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i var i int32 for n = 1; ((*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ':')) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))]) & 0x01) != 0); n++ { } - if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, SQLITE_UTF8) <= 0 { + if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, uint8(SQLITE_UTF8)) <= 0 { *(*int32)(unsafe.Pointer(bp /* rc */)) = 1 break } @@ -19871,7 +19871,7 @@ func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite } return dbMallocRawFinish(tls, db, n) } - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ @@ -19906,7 +19906,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* if (Uptr(p)) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { return p } } else if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { @@ -20114,31 +20114,31 @@ type Et_info = et_info /* sqlite3.c:28197:3 */ var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 663 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28210:19 */ var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 696 /* "-x0\x00X0" */)) /* sqlite3.c:28211:19 */ var fmtinfo = [23]Et_info{ - {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtSTRING}, - {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(30)}, - {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtDYNSTRING}, - {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE}, - {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE2}, - {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtSQLESCAPE3}, - {Ffmttype: int8('c'), Ftype: EtCHARX}, + {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtByte(EtSTRING)}, + {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(30)}, + {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtByte(EtDYNSTRING)}, + {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE)}, + {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE2)}, + {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE3)}, + {Ffmttype: int8('c'), Ftype: EtByte(EtCHARX)}, {Ffmttype: int8('o'), Fbase: EtByte(8), Fprefix: EtByte(2)}, - {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtDECIMAL}, + {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtByte(EtDECIMAL)}, {Ffmttype: int8('x'), Fbase: EtByte(16), Fcharset: EtByte(16), Fprefix: EtByte(1)}, {Ffmttype: int8('X'), Fbase: EtByte(16), Fprefix: EtByte(4)}, - {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtFLOAT}, - {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(30)}, - {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(14)}, - {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(14)}, - {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('n'), Ftype: EtSIZE}, - {Ffmttype: int8('%'), Ftype: EtPERCENT}, - {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtPOINTER, Fprefix: EtByte(1)}, + {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtByte(EtFLOAT)}, + {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(30)}, + {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(14)}, + {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(14)}, + {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('n'), Ftype: EtByte(EtSIZE)}, + {Ffmttype: int8('%'), Ftype: EtByte(EtPERCENT)}, + {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtByte(EtPOINTER), Fprefix: EtByte(1)}, // All the rest are undocumented and are for internal use only - {Ffmttype: int8('T'), Ftype: EtTOKEN}, - {Ffmttype: int8('S'), Ftype: EtSRCLIST}, - {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtORDINAL}, + {Ffmttype: int8('T'), Ftype: EtByte(EtTOKEN)}, + {Ffmttype: int8('S'), Ftype: EtByte(EtSRCLIST)}, + {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtORDINAL)}, } /* sqlite3.c:28212:22 */ // Floating point constants used for rounding @@ -20221,12 +20221,12 @@ func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* return uintptr(0) } if (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc)) && (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc)) { - setStrAccumError(tls, pAccum, SQLITE_TOOBIG) + setStrAccumError(tls, pAccum, uint8(SQLITE_TOOBIG)) return uintptr(0) } z = Xsqlite3DbMallocRaw(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n)) if z == uintptr(0) { - setStrAccumError(tls, pAccum, SQLITE_NOMEM) + setStrAccumError(tls, pAccum, uint8(SQLITE_NOMEM)) } return z } @@ -20314,7 +20314,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_lis var pSrc uintptr var k1 int32 var pItem uintptr - xtype = EtINVALID + xtype = EtByte(EtINVALID) zExtra = uintptr(0) pArgList = uintptr(0) // Conversion buffer @@ -20580,7 +20580,7 @@ __14: // Fetch the info entry for the field infop = (uintptr(unsafe.Pointer(&fmtinfo))) - xtype = EtINVALID + xtype = EtByte(EtINVALID) idx = 0 __54: if !(idx < (int32(uint64(unsafe.Sizeof(fmtinfo)) / uint64(unsafe.Sizeof(Et_info{}))))) { @@ -21042,11 +21042,11 @@ __142: if !((exp < -4) || (exp > precision)) { goto __146 } - xtype = EtEXP + xtype = EtByte(EtEXP) goto __147 __146: precision = (precision - exp) - xtype = EtFLOAT + xtype = EtByte(EtFLOAT) __147: ; goto __145 @@ -21070,7 +21070,7 @@ __149: } return int64(0) }()) + I64(precision)) + I64(width)) + int64(15)) - if !(szBufNeeded > SQLITE_PRINT_BUF_SIZE) { + if !(szBufNeeded > int64(SQLITE_PRINT_BUF_SIZE)) { goto __150 } bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded)) @@ -21360,7 +21360,7 @@ __70: goto __198 } bufpt = getTextArg(tls, pArgList) - xtype = EtSTRING + xtype = EtByte(EtSTRING) goto __199 __198: bufpt = libc.VaUintptr(&ap) @@ -21703,7 +21703,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite return 0 } if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc == U32(0) { - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return (int32(((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar) - U32(1))) } else { var zOld uintptr @@ -21721,7 +21721,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite } if szNew > I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return 0 } else { (*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(int32(szNew)) @@ -21741,7 +21741,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) return 0 } } @@ -21802,7 +21802,7 @@ func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:2915 libc.X__builtin___memcpy_chk(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1))), libc.X__builtin_object_size(tls, zText, 0)) *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) } (*StrAccum)(unsafe.Pointer(p)).FzText = zText return zText @@ -21822,7 +21822,7 @@ func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:291 // sqlite3_malloc() fails to provide space for a real one. This // sqlite3_str object accepts no new text and always returns // an SQLITE_NOMEM error. -var sqlite3OomStr = Sqlite3_str{FaccError: SQLITE_NOMEM} /* sqlite3.c:29185:20 */ +var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)} /* sqlite3.c:29185:20 */ // Finalize a string created using sqlite3_str_new(). func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191:17: */ @@ -21924,7 +21924,7 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui Xsqlite3StrAccumInit(tls, bp /* &acc */, db, bp+32 /* &zBase[0] */, int32(unsafe.Sizeof([70]int8{})), *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = SQLITE_PRINTF_INTERNAL + (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) Xsqlite3_str_vappendf(tls, bp /* &acc */, zFormat, ap) z = Xsqlite3StrAccumFinish(tls, bp /* &acc */) if int32((*StrAccum)(unsafe.Pointer(bp /* &acc */)).FaccError) == SQLITE_NOMEM { @@ -22717,10 +22717,10 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: var b1 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz)) var b2 U8 = *(*U8)(unsafe.Pointer((((*Mem)(unsafe.Pointer(pMem)).Fz) + uintptr(1)))) if (int32(b1) == 0xFE) && (int32(b2) == 0xFF) { - bom = SQLITE_UTF16BE + bom = U8(SQLITE_UTF16BE) } if (int32(b1) == 0xFF) && (int32(b2) == 0xFE) { - bom = SQLITE_UTF16LE + bom = U8(SQLITE_UTF16LE) } } @@ -23124,7 +23124,7 @@ func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uin ap = va z = Xsqlite3VMPrintf(tls, db, zFormat, ap) _ = ap - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) } } @@ -23228,7 +23228,7 @@ func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31439:21: */ if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))))) == '"' { return (uint32(EP_Quoted | EP_DblQuoted)) } - return EP_Quoted + return uint32(EP_Quoted) }()) Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } @@ -23961,7 +23961,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq } return 2 } else { - return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) } return int32(0) } @@ -24183,7 +24183,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -24192,13 +24192,13 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -24212,7 +24212,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -24244,7 +24244,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -24258,7 +24258,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -24267,7 +24267,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -24290,7 +24290,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) @@ -24482,7 +24482,7 @@ func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548 func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32565:20: */ var magic U32 magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic - if ((magic != SQLITE_MAGIC_SICK) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { + if ((magic != U32(SQLITE_MAGIC_SICK)) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { logBadConnection(tls, ts+810 /* "invalid" */) return 0 @@ -24839,8 +24839,8 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:329 var elem uintptr var next_elem uintptr // For looping over existing elements - if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > SQLITE_MALLOC_SOFT_LIMIT { - new_size = (uint32(SQLITE_MALLOC_SOFT_LIMIT / uint64(unsafe.Sizeof(_ht{})))) + if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { + new_size = (uint32(uint64(SQLITE_MALLOC_SOFT_LIMIT) / uint64(unsafe.Sizeof(_ht{})))) } if new_size == (*Hash)(unsafe.Pointer(pH)).Fhtsize { return 0 @@ -34219,7 +34219,7 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 if m != 0 { m2 = m } else { - m2 = SQLITE_DEFAULT_FILE_PERMISSIONS + m2 = uint16(SQLITE_DEFAULT_FILE_PERMISSIONS) } for 1 != 0 { fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, z, (f | O_CLOEXEC), int32(m2)) @@ -34618,7 +34618,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql // in the header of every SQLite database. In this way, if there // is a race condition such that another thread has already populated // the first page of the database, no damage is done. - if ((*stat)(unsafe.Pointer(bp /* &statbuf */)).Fst_size == int64(0)) && (((*UnixFile)(unsafe.Pointer(pFile)).FfsFlags & SQLITE_FSFLAGS_IS_MSDOS) != uint32(0)) { + if ((*stat)(unsafe.Pointer(bp /* &statbuf */)).Fst_size == int64(0)) && (((*UnixFile)(unsafe.Pointer(pFile)).FfsFlags & uint32(SQLITE_FSFLAGS_IS_MSDOS)) != uint32(0)) { for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__error(tls)))) == EINTR)) { rc = int32((*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 11*24 + 8 /* &.pCurrent */))))(tls, fd, ts+2592 /* "S" */, uint64(1))) } @@ -34743,10 +34743,10 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / if !(reserved != 0) && !(int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FbProcessLock) != 0) { // var lock flock at bp+8, 24 - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 1)) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_GETLK, libc.VaList(bp, bp+8 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(14) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) @@ -34801,10 +34801,10 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite if int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { // var lock flock at bp+16, 24 - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = SHARED_SIZE - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = int64(SHARED_SIZE) + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = int16(F_WRLCK) rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK, libc.VaList(bp, bp+16 /* &lock */)) if rc < 0 { return rc @@ -34931,7 +34931,7 @@ __2: goto __3 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ goto end_lock @@ -34942,16 +34942,16 @@ __3: // acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will // be released. (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) if !((eFileLock == SHARED_LOCK) || ((eFileLock == EXCLUSIVE_LOCK) && (int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) < PENDING_LOCK))) { goto __4 } (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = func() int16 { if eFileLock == SHARED_LOCK { - return F_RDLCK + return int16(F_RDLCK) } - return F_WRLCK + return int16(F_WRLCK) }() (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = Off_t(Xsqlite3PendingByte) if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) { @@ -34979,7 +34979,7 @@ __4: // Now get the read-lock (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) { goto __9 } @@ -34991,7 +34991,7 @@ __9: // Drop the temporary PENDING lock (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = Off_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) if !((unixFileLock(tls, pFile, bp /* &lock */) != 0) && (rc == SQLITE_OK)) { goto __10 } @@ -35013,7 +35013,7 @@ __13: goto end_lock goto __12 __11: - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared = 1 __12: @@ -35032,7 +35032,7 @@ __14: // assumed that there is a SHARED or greater lock on the file // already. ; - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_WRLCK) if !(eFileLock == RESERVED_LOCK) { goto __16 @@ -35042,7 +35042,7 @@ __14: goto __17 __16: (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE) __17: ; @@ -35074,8 +35074,8 @@ __20: if !(eFileLock == EXCLUSIVE_LOCK) { goto __22 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = PENDING_LOCK - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = PENDING_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(PENDING_LOCK) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) __22: ; __21: @@ -35153,8 +35153,8 @@ __1: } // Error code from system call errors divSize = (int64(SHARED_SIZE - 1)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = divSize if !(unixFileLock(tls, pFile, bp /* &lock */) == (-1)) { @@ -35166,8 +35166,8 @@ __1: goto end_unlock __6: ; - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_RDLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_RDLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = divSize if !(unixFileLock(tls, pFile, bp /* &lock */) == (-1)) { @@ -35184,10 +35184,10 @@ __8: goto end_unlock __7: ; - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = ((Off_t(Xsqlite3PendingByte + 2)) + divSize) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = (SHARED_SIZE - divSize) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = (int64(SHARED_SIZE) - divSize) if !(unixFileLock(tls, pFile, bp /* &lock */) == (-1)) { goto __9 } @@ -35200,10 +35200,10 @@ __9: goto __5 __4: - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_RDLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_RDLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) { goto __10 } @@ -35222,14 +35222,14 @@ __5: ; __3: ; - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = Off_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = 2 if !(unixFileLock(tls, pFile, bp /* &lock */) == 0) { goto __11 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = SHARED_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) goto __12 __11: rc = (SQLITE_IOERR | (int32(8) << 8)) @@ -35249,19 +35249,19 @@ __2: if !((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared == 0) { goto __14 } - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = libc.AssignPtrInt64(bp /* &lock */ +8 /* &.l_len */, 0) if !(unixFileLock(tls, pFile, bp /* &lock */) == 0) { goto __15 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) goto __16 __15: rc = (SQLITE_IOERR | (int32(8) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) __16: ; __14: @@ -35524,7 +35524,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite // To downgrade to shared, simply update our internal notion of the // lock state. No need to mess with the file on disk. if eFileLock == SHARED_LOCK { - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) return SQLITE_OK } @@ -35541,7 +35541,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite } return rc } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) return SQLITE_OK } @@ -35704,7 +35704,7 @@ func flockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3. if robust_flock(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, LOCK_UN) != 0 { return (SQLITE_IOERR | (int32(8) << 8)) } else { - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) return SQLITE_OK } return int32(0) @@ -35820,7 +35820,7 @@ func afpSetLock(tls *libc.TLS, path uintptr, pFile uintptr, offset uint64, lengt (*ByteRangeLockPB2)(unsafe.Pointer(bp /* &pb */)).Flength = length (*ByteRangeLockPB2)(unsafe.Pointer(bp /* &pb */)).Ffd = (*UnixFile)(unsafe.Pointer(pFile)).Fh - err = libc.Xfsctl(tls, path, ((((uint64(0x80000000 | X__uint32_t(0x40000000))) | (uint64((uint64(unsafe.Sizeof(ByteRangeLockPB2{})) & IOCPARM_MASK)) << 16)) | (uint64(int32(('z')) << 8))) | (uint64(23))), bp /* &pb */, uint32(0)) + err = libc.Xfsctl(tls, path, ((((uint64(0x80000000 | X__uint32_t(0x40000000))) | (uint64((uint64(unsafe.Sizeof(ByteRangeLockPB2{})) & uint64(IOCPARM_MASK))) << 16)) | (uint64(int32(('z')) << 8))) | (uint64(23))), bp /* &pb */, uint32(0)) if err == -1 { var rc int32 var tErrno int32 = *(*int32)(unsafe.Pointer(libc.X__error(tls))) @@ -35966,7 +35966,7 @@ __2: goto __3 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ goto afp_end_lock @@ -36039,7 +36039,7 @@ __11: rc = lrc1 goto __14 __13: - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared = 1 __14: @@ -36089,7 +36089,7 @@ __17: failed2 = SQLITE_OK // now attemmpt to get the exclusive lock range failed1 = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, (uint64(Xsqlite3PendingByte + 2)), - SHARED_SIZE, 1) + uint64(SHARED_SIZE), 1) if !((failed1 != 0) && (libc.AssignInt32(&failed2, afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, ((uint64(Xsqlite3PendingByte+2))+(*UnixInodeInfo)(unsafe.Pointer(pInode)).FsharedByte), uint64(1), 1)) != 0)) { goto __22 @@ -36132,8 +36132,8 @@ __24: if !(eFileLock == EXCLUSIVE_LOCK) { goto __26 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = PENDING_LOCK - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = PENDING_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(PENDING_LOCK) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) __26: ; __25: @@ -36166,7 +36166,7 @@ func afpUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c: if int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) > SHARED_LOCK { if int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) == EXCLUSIVE_LOCK { - rc = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, (uint64(Xsqlite3PendingByte + 2)), SHARED_SIZE, 0) + rc = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, (uint64(Xsqlite3PendingByte + 2)), uint64(SHARED_SIZE), 0) if (rc == SQLITE_OK) && ((eFileLock == SHARED_LOCK) || ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared > 1)) { // only re-establish the shared lock if necessary var sharedLockByte int32 = (int32((uint64(Xsqlite3PendingByte + 2)) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FsharedByte)) @@ -36185,7 +36185,7 @@ func afpUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c: } } if (rc == SQLITE_OK) && ((eFileLock == SHARED_LOCK) || ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared > 1)) { - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = SHARED_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) } } if (rc == SQLITE_OK) && (eFileLock == NO_LOCK) { @@ -36201,8 +36201,8 @@ func afpUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c: rc = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, sharedLockByte, uint64(1), 0) } if !(rc != 0) { - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) } } if rc == SQLITE_OK { @@ -36772,13 +36772,13 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { } case SQLITE_FCNTL_PERSIST_WAL: { - unixModeBit(tls, pFile, UNIXFILE_PERSIST_WAL, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PERSIST_WAL), pArg) return SQLITE_OK } case SQLITE_FCNTL_POWERSAFE_OVERWRITE: { - unixModeBit(tls, pFile, UNIXFILE_PSOW, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PSOW), pArg) return SQLITE_OK } @@ -36926,7 +36926,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, var res int32 // Initialize the locking parameters (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_type = int16(lockType) - (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = Off_t(ofst) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = Off_t(n) res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_SETLK, libc.VaList(bp, bp+8 /* &f */)) @@ -37019,10 +37019,10 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // 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. - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (int64(((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK)) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK, libc.VaList(bp, bp+8 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(15) << 8)) } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_UNLCK { @@ -37928,7 +37928,7 @@ func autolockIoFinderImpl(tls *libc.TLS, filePath uintptr, pNew uintptr) uintptr return uintptr(unsafe.Pointer(&nolockIoMethods)) } if libc.Xstatfs(tls, filePath, bp+8 /* &fsInfo */) != -1 { - if ((*statfs)(unsafe.Pointer(bp+8 /* &fsInfo */)).Ff_flags & MNT_RDONLY) != 0 { + if ((*statfs)(unsafe.Pointer(bp+8 /* &fsInfo */)).Ff_flags & Uint32_t(MNT_RDONLY)) != 0 { return uintptr(unsafe.Pointer(&nolockIoMethods)) } for i = 0; aMap[i].FzFilesystem != 0; i++ { @@ -37943,8 +37943,8 @@ func autolockIoFinderImpl(tls *libc.TLS, filePath uintptr, pNew uintptr) uintptr // assume that the file-system supports POSIX style locks. (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_len = int64(1) (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_start = int64(0) - (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_whence = SEEK_SET - (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_type = F_RDLCK + (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_whence = int16(SEEK_SET) + (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_type = int16(F_RDLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pNew)).Fh, F_GETLK, libc.VaList(bp, bp+2176 /* &lockInfo */)) != -1 { if libc.Xstrcmp(tls, bp+8 /* &fsInfo */ +72 /* &.f_fstypename */, ts+2736 /* "nfs" */) == 0 { return uintptr(unsafe.Pointer(&nfsIoMethods)) @@ -38620,13 +38620,13 @@ __26: if !(0 == libc.Xstrncmp(tls, ts+2858 /* "msdos" */, bp+528 /* &fsInfo */ +72 /* &.f_fstypename */, uint64(5))) { goto __27 } - *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (SQLITE_FSFLAGS_IS_MSDOS) + *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (uint32(SQLITE_FSFLAGS_IS_MSDOS)) __27: ; if !(0 == libc.Xstrncmp(tls, ts+2864 /* "exfat" */, bp+528 /* &fsInfo */ +72 /* &.f_fstypename */, uint64(5))) { goto __28 } - *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (SQLITE_FSFLAGS_IS_MSDOS) + *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (uint32(SQLITE_FSFLAGS_IS_MSDOS)) __28: ; @@ -38677,7 +38677,7 @@ __33: useProxy = (libc.Bool32(libc.Xatoi(tls, envforce) > 0)) goto __36 __35: - useProxy = libc.BoolInt32(!(((*statfs)(unsafe.Pointer(bp+528 /* &fsInfo */)).Ff_flags & MNT_LOCAL) != 0)) + useProxy = libc.BoolInt32(!(((*statfs)(unsafe.Pointer(bp+528 /* &fsInfo */)).Ff_flags & Uint32_t(MNT_LOCAL)) != 0)) __36: ; if !(useProxy != 0) { @@ -39732,7 +39732,7 @@ func proxyCreateLockPath(tls *libc.TLS, lockPath uintptr) int32 { /* sqlite3.c:4 if (((i - start) > 2) || ((((i - start) == 1) && (int32(*(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(start)))) != '.')) && (int32(*(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(start)))) != '/'))) || ((((i - start) == 2) && (int32(*(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(start)))) != '.')) && (int32(*(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr((start + 1))))) != '.')) { *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(i))) = int8(0) - if (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 18*24 + 8 /* &.pCurrent */))))(tls, bp /* &buf[0] */, SQLITE_DEFAULT_PROXYDIR_PERMISSIONS) != 0 { + if (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 18*24 + 8 /* &.pCurrent */))))(tls, bp /* &buf[0] */, uint16(SQLITE_DEFAULT_PROXYDIR_PERMISSIONS)) != 0 { var err int32 = *(*int32)(unsafe.Pointer(libc.X__error(tls))) if err != EEXIST { @@ -39885,7 +39885,7 @@ func proxyGetHostID(tls *libc.TLS, pHostID uintptr, pError uintptr) int32 { /* s bp := tls.Alloc(16) defer tls.Free(16) - libc.X__builtin___memset_chk(tls, pHostID, 0, PROXY_HOSTIDLEN, libc.X__builtin_object_size(tls, pHostID, 0)) + libc.X__builtin___memset_chk(tls, pHostID, 0, uint64(PROXY_HOSTIDLEN), libc.X__builtin_object_size(tls, pHostID, 0)) { *(*timespec)(unsafe.Pointer(bp /* timeout */)) = timespec{Ftv_sec: int64(1)} // 1 sec timeout if libc.Xgethostuuid(tls, pHostID, bp /* &timeout */) != 0 { @@ -39935,8 +39935,8 @@ func proxyBreakConchLock(tls *libc.TLS, pFile uintptr, myHostID uintptr) int32 { _ = myHostID // create a new path by replace the trailing '-conch' with '-break' - pathLen = libc.Xstrlcpy(tls, bp+64 /* &tPath[0] */, cPath, PATH_MAX) - if !(((pathLen > PATH_MAX) || (pathLen < uint64(6))) || (libc.Xstrlcpy(tls, (bp+64 /* &tPath */ +uintptr((pathLen-uint64(5)))), ts+3008 /* "break" */, uint64(6)) != uint64(5))) { + pathLen = libc.Xstrlcpy(tls, bp+64 /* &tPath[0] */, cPath, uint64(PATH_MAX)) + if !(((pathLen > uint64(PATH_MAX)) || (pathLen < uint64(6))) || (libc.Xstrlcpy(tls, (bp+64 /* &tPath */ +uintptr((pathLen-uint64(5)))), ts+3008 /* "break" */, uint64(6)) != uint64(5))) { goto __1 } Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+1088 /* &errmsg[0] */, ts+3014 /* "path error (len ..." */, libc.VaList(bp, int32(pathLen))) @@ -40045,9 +40045,9 @@ func proxyConchLock(tls *libc.TLS, pFile uintptr, myHostID uintptr, lockType int storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) return (SQLITE_IOERR | (int32(15) << 8)) } - if (len > (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) && (int32(*(*int8)(unsafe.Pointer(bp + 160 /* &tBuf[0] */))) == int32(PROXY_CONCHVERSION)) { + if (len > (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) && (int32(*(*int8)(unsafe.Pointer(bp + 160 /* &tBuf[0] */))) == int32(int8(PROXY_CONCHVERSION))) { // don't break the lock if the host id doesn't match - if 0 != libc.Xmemcmp(tls, (bp+160 /* &tBuf */ +1), myHostID, PROXY_HOSTIDLEN) { + if 0 != libc.Xmemcmp(tls, (bp+160 /* &tBuf */ +1), myHostID, uint64(PROXY_HOSTIDLEN)) { return SQLITE_BUSY } } else { @@ -40154,7 +40154,7 @@ __4: goto end_takeconch goto __6 __5: - if !((readLen <= (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) || (int32(*(*int8)(unsafe.Pointer(bp + 20 /* &readBuf[0] */))) != int32(PROXY_CONCHVERSION))) { + if !((readLen <= (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) || (int32(*(*int8)(unsafe.Pointer(bp + 20 /* &readBuf[0] */))) != int32(int8(PROXY_CONCHVERSION)))) { goto __7 } // a short read or version format mismatch means we need to create a new @@ -40173,7 +40173,7 @@ __8: // in case we need to try again for an :auto: named lock file goto __11 } hostIdMatch = libc.BoolInt32(!(libc.Xmemcmp(tls, (bp+20 /* &readBuf */ +1), bp, /* &myHostID[0] */ - PROXY_HOSTIDLEN) != 0)) + uint64(PROXY_HOSTIDLEN)) != 0)) // if the conch has data compare the contents if !(!(int32((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath) != 0)) { goto __12 @@ -40185,7 +40185,7 @@ __8: // in case we need to try again for an :auto: named lock file } pathLen = (Size_t(readLen - (PROXY_HEADERLEN + PROXY_HOSTIDLEN))) - if !(pathLen >= PATH_MAX) { + if !(pathLen >= uint64(PATH_MAX)) { goto __15 } pathLen = (uint64(PATH_MAX - 1)) @@ -40228,7 +40228,7 @@ __17: if !(!(int32((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath) != 0)) { goto __18 } - proxyGetLockPath(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FdbPath, bp+1061 /* &lockPath[0] */, PATH_MAX) + proxyGetLockPath(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FdbPath, bp+1061 /* &lockPath[0] */, uint64(PATH_MAX)) tempLockPath = bp + 1061 /* &lockPath[0] */ // create a copy of the lock path _only_ if the conch is taken __18: @@ -40262,16 +40262,16 @@ __20: } writeSize = 0 - *(*int8)(unsafe.Pointer(bp + 2085 /* &writeBuffer[0] */)) = PROXY_CONCHVERSION - libc.X__builtin___memcpy_chk(tls, (bp + 2085 /* &writeBuffer */ + 1), bp /* &myHostID[0] */, PROXY_HOSTIDLEN, libc.X__builtin_object_size(tls, (bp+2085 /* &writeBuffer */ +1), 0)) + *(*int8)(unsafe.Pointer(bp + 2085 /* &writeBuffer[0] */)) = int8(PROXY_CONCHVERSION) + libc.X__builtin___memcpy_chk(tls, (bp + 2085 /* &writeBuffer */ + 1), bp /* &myHostID[0] */, uint64(PROXY_HOSTIDLEN), libc.X__builtin_object_size(tls, (bp+2085 /* &writeBuffer */ +1), 0)) if !((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != (uintptr(0))) { goto __24 } libc.Xstrlcpy(tls, (bp + 2085 /* &writeBuffer */ + 17), (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath, - PATH_MAX) + uint64(PATH_MAX)) goto __25 __24: - libc.Xstrlcpy(tls, (bp + 2085 /* &writeBuffer */ + 17), tempLockPath, PATH_MAX) + libc.Xstrlcpy(tls, (bp + 2085 /* &writeBuffer */ + 17), tempLockPath, uint64(PATH_MAX)) __25: ; writeSize = (int32((uint64(PROXY_HEADERLEN + PROXY_HOSTIDLEN)) + libc.Xstrlen(tls, (bp+2085 /* &writeBuffer */ +17)))) @@ -40467,7 +40467,7 @@ func switchLockProxyPath(tls *libc.TLS, pFile uintptr, path uintptr) int32 { /* } // nothing to do if the path is NULL, :auto: or matches the existing path - if ((!(path != 0) || (int32(*(*int8)(unsafe.Pointer(path))) == 0)) || !(libc.Xstrcmp(tls, path, ts+2897 /* ":auto:" */) != 0)) || ((oldPath != 0) && !(libc.Xstrncmp(tls, oldPath, path, PATH_MAX) != 0)) { + if ((!(path != 0) || (int32(*(*int8)(unsafe.Pointer(path))) == 0)) || !(libc.Xstrcmp(tls, path, ts+2897 /* ":auto:" */) != 0)) || ((oldPath != 0) && !(libc.Xstrncmp(tls, oldPath, path, uint64(PATH_MAX)) != 0)) { return SQLITE_OK } else { var lockProxy uintptr = (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxy @@ -40498,7 +40498,7 @@ func proxyGetDbPathForUnixFile(tls *libc.TLS, pFile uintptr, dbPath uintptr) int // of the struct libc.Xstrlcpy(tls, dbPath, (*AfpLockingContext)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FlockingContext)).FdbPath, - PATH_MAX) + uint64(PATH_MAX)) } else if (*UnixFile)(unsafe.Pointer(pFile)).FpMethod == uintptr(unsafe.Pointer(&dotlockIoMethods)) { // dot lock style uses the locking context to store the dot lock // file path @@ -40507,7 +40507,7 @@ func proxyGetDbPathForUnixFile(tls *libc.TLS, pFile uintptr, dbPath uintptr) int } else { // all other styles use the locking context to store the db file path - libc.Xstrlcpy(tls, dbPath, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, PATH_MAX) + libc.Xstrlcpy(tls, dbPath, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, uint64(PATH_MAX)) } return SQLITE_OK } @@ -40561,7 +40561,7 @@ func proxyTransformUnixFile(tls *libc.TLS, pFile uintptr, path uintptr) int32 { if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*24 + 8 /* &.pCurrent */))))(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FconchFilePath, bp+1032 /* &conchInfo */) == -1 { var err int32 = *(*int32)(unsafe.Pointer(libc.X__error(tls))) if (err == ENOENT) && (libc.Xstatfs(tls, bp /* &dbPath[0] */, bp+1176 /* &fsInfo */) != -1) { - goLockless = (libc.Bool32(((*statfs)(unsafe.Pointer(bp+1176 /* &fsInfo */)).Ff_flags & MNT_RDONLY) == MNT_RDONLY)) + goLockless = (libc.Bool32(((*statfs)(unsafe.Pointer(bp+1176 /* &fsInfo */)).Ff_flags & Uint32_t(MNT_RDONLY)) == Uint32_t(MNT_RDONLY))) } } if goLockless != 0 { @@ -40641,7 +40641,7 @@ func proxyFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { if isProxyStyle != 0 { var pCtx uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext if !(libc.Xstrcmp(tls, pArg, ts+2897 /* ":auto:" */) != 0) || - (((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != 0) && !(libc.Xstrncmp(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath, proxyPath, PATH_MAX) != 0)) { + (((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != 0) && !(libc.Xstrncmp(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath, proxyPath, uint64(PATH_MAX)) != 0)) { rc = SQLITE_OK } else { rc = switchLockProxyPath(tls, pFile, proxyPath) @@ -40878,15 +40878,15 @@ func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlit return 0 } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM)))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) } else { - var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { if *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i { return 1 } - h = (U32((uint64(h + U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64(h + U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) } return 0 } @@ -40922,7 +40922,7 @@ __1: i-- __2: - if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { + if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { goto __3 } bin = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor) @@ -40943,21 +40943,21 @@ __4: goto __2 __3: ; - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) { goto __6 } - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) return SQLITE_OK __6: ; - h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) // if there wasn't a hash collision, and this doesn't // completely fill the hash, then just add it without // worring about sub-dividing and re-hashing. if !(!(int32(*(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4))) != 0)) { goto __7 } - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { goto __8 } goto bitvec_set_end @@ -40978,7 +40978,7 @@ __10: __13: ; h++ - if !(uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __14 } h = U32(0) @@ -40996,7 +40996,7 @@ __12: // available free spot. check to see if this is going to // make our hash too "full". bitvec_set_rehash: - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { goto __15 } aiValues = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(unsafe.Sizeof([124]U32{}))) @@ -41008,11 +41008,11 @@ bitvec_set_rehash: __16: libc.X__builtin___memcpy_chk(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})), libc.X__builtin_object_size(tls, aiValues, 0)) libc.X__builtin___memset_chk(tls, p+16 /* &.u */ /* &.apSub */, 0, uint64(unsafe.Sizeof([62]uintptr{})), libc.X__builtin_object_size(tls, p+16 /* &.u */ /* &.apSub */, 0)) - (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) + (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) rc = Xsqlite3BitvecSet(tls, p, i) j = uint32(0) __18: - if !(uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __20 } if !(*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) { @@ -41058,21 +41058,21 @@ func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sql return } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) } else { var j uint32 var aiValues uintptr = pBuf libc.X__builtin___memcpy_chk(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})), libc.X__builtin_object_size(tls, aiValues, 0)) libc.X__builtin___memset_chk(tls, p+16 /* &.u */ /* &.aHash */, 0, uint64(unsafe.Sizeof([124]U32{})), libc.X__builtin_object_size(tls, p+16 /* &.u */ /* &.aHash */, 0)) (*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0) - for j = uint32(0); uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { + for j = uint32(0); uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { if (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) && (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != (i + U32(1))) { - var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) (*Bitvec)(unsafe.Pointer(p)).FnSet++ for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { h++ - if uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { + if uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { h = U32(0) } } @@ -41089,7 +41089,7 @@ func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */ } if (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 { var i uint32 - for i = uint32(0); uint64(i) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { + for i = uint32(0); uint64(i) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer((p + 16 /* &.u */ /* &.apSub */) + uintptr(i)*8))) } } @@ -41156,7 +41156,7 @@ func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* // bits to act as the reference pBitvec = Xsqlite3BitvecCreate(tls, uint32(sz)) pV = Xsqlite3MallocZero(tls, (uint64(((sz + 7) / 8) + 1))) - pTmpSpace = Xsqlite3_malloc64(tls, BITVEC_SZ) + pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if !(((pBitvec == uintptr(0)) || (pV == uintptr(0))) || (pTmpSpace == uintptr(0))) { goto __1 } @@ -41568,7 +41568,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u libc.X__builtin___memset_chk(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8), libc.X__builtin_object_size(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0)) (*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache (*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno - (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = PGHDR_CLEAN + (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = U16(PGHDR_CLEAN) return Xsqlite3PcacheFetchFinish(tls, pCache, pgno, pPage) } @@ -41599,7 +41599,7 @@ func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49388:37: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { pcacheUnpin(tls, p) } else { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } } @@ -41617,7 +41617,7 @@ func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */ func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0 { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) } (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1) @@ -41632,7 +41632,7 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) ^= U16((PGHDR_DIRTY | PGHDR_CLEAN)) - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_ADD) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD)) } } @@ -41642,7 +41642,7 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: // make it so. func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: */ - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((PGHDR_DIRTY | PGHDR_NEED_SYNC) | PGHDR_WRITEABLE)))) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) |= U16((PGHDR_CLEAN)) @@ -41686,7 +41686,7 @@ func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:4 (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 72 /* &.xRekey */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno) (*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno if ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0) && ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_NEED_SYNC) != 0) { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } @@ -43123,7 +43123,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174: (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) + p) (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint64(N) - (((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) / uint64(unsafe.Sizeof(RowSetEntry{})))) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) (*RowSet)(unsafe.Pointer(p)).FiBatch = 0 } return p @@ -43145,7 +43145,7 @@ func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: * (*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) } // Deallocate all chunks from a RowSet. This frees all memory that @@ -44888,7 +44888,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, // of two greater than or equal to 512 or 32, and not greater than their // respective compile time maximum limits. if (((((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) < U32(512)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) < U32(32))) || - (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > SQLITE_MAX_PAGE_SIZE)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > MAX_SECTOR_SIZE)) || + (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > U32(SQLITE_MAX_PAGE_SIZE))) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > U32(MAX_SECTOR_SIZE))) || (((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */))) != U32(0))) || (((*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */))) != U32(0)) { // If the either the page-size or sector-size in the journal-header is // invalid, then the process that wrote the journal-header must have @@ -45060,7 +45060,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) { var rc int32 // Error code returned by pagerUnlockDb() var iDc int32 @@ -45093,7 +45093,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ // without clearing the error code. This is intentional - the error // code is cleared and the cache reset in the block below. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } // If Pager.errCode is set, the contents of the pager cache cannot be @@ -45105,13 +45105,13 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { pager_reset(tls, pPager) (*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(0) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else { (*Pager)(unsafe.Pointer(pPager)).FeState = func() uint8 { if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) { - return PAGER_OPEN + return uint8(PAGER_OPEN) } - return PAGER_READER + return uint8(PAGER_READER) }() } if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 { @@ -45148,7 +45148,7 @@ func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:5 if (rc2 == SQLITE_FULL) || (rc2 == SQLITE_IOERR) { (*Pager)(unsafe.Pointer(pPager)).FerrCode = rc - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) } return rc @@ -45333,7 +45333,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi (!((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || (Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0)) { rc2 = pagerUnlockDb(tls, pPager, SHARED_LOCK) } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0) return func() int32 { @@ -46311,7 +46311,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720: // bytes 92..95 store the change counter for which the version number // is valid. Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(92)), change_counter) - Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), SQLITE_VERSION_NUMBER) + Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(SQLITE_VERSION_NUMBER)) } // This function is invoked once for each page that has already been @@ -46546,7 +46546,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 rc = Xsqlite3PagerOpenWal(tls, pPager, uintptr(0)) } } else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_WAL { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_DELETE + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_DELETE) } } } @@ -46783,26 +46783,26 @@ func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: // Numeric values associated with these states are OFF==1, NORMAL=2, // and FULL=3. func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55248:21: */ - var level uint32 = (pgFlags & PAGER_SYNCHRONOUS_MASK) + var level uint32 = (pgFlags & uint32(PAGER_SYNCHRONOUS_MASK)) if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 { (*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1) (*Pager)(unsafe.Pointer(pPager)).FfullSync = U8(0) (*Pager)(unsafe.Pointer(pPager)).FextraSync = U8(0) } else { (*Pager)(unsafe.Pointer(pPager)).FnoSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_OFF { + if level == uint32(PAGER_SYNCHRONOUS_OFF) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FfullSync = func() uint8 { - if level >= PAGER_SYNCHRONOUS_FULL { + if level >= uint32(PAGER_SYNCHRONOUS_FULL) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FextraSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_EXTRA { + if level == uint32(PAGER_SYNCHRONOUS_EXTRA) { return uint8(1) } return uint8(0) @@ -46810,19 +46810,19 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s } if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 { (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(0) - } else if (pgFlags & PAGER_FULLFSYNC) != 0 { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_FULL + } else if (pgFlags & uint32(PAGER_FULLFSYNC)) != 0 { + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_FULL) } else { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_NORMAL) } (*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = (U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2)) if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))) } - if ((pgFlags & PAGER_CKPT_FULLFSYNC) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { + if ((pgFlags & uint32(PAGER_CKPT_FULLFSYNC)) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32(SQLITE_SYNC_FULL) << 2)) } - if (pgFlags & PAGER_CACHESPILL) != 0 { + if (pgFlags & uint32(PAGER_CACHESPILL)) != 0 { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_OFF))) } else { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) |= U8((SPILLFLAG_OFF)) @@ -47166,7 +47166,7 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr return SQLITE_NOMEM } (*PgHdr)(unsafe.Pointer(p)).FpExtra = (p + 1*72) - (*PgHdr)(unsafe.Pointer(p)).Fflags = PGHDR_MMAP + (*PgHdr)(unsafe.Pointer(p)).Fflags = U16(PGHDR_MMAP) (*PgHdr)(unsafe.Pointer(p)).FnRef = int16(1) (*PgHdr)(unsafe.Pointer(p)).FpPager = pPager } @@ -47251,7 +47251,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq { var a uintptr = uintptr(0) - if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoCkptOnClose))) && + if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoCkptOnClose)))) && (SQLITE_OK == databaseIsUnmoved(tls, pPager)) { a = pTmp } @@ -47436,7 +47436,7 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3 // successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on // all pages. Xsqlite3PcacheClearSyncFlags(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_DBMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_DBMOD) return SQLITE_OK } @@ -47776,7 +47776,7 @@ func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u nPathname = 0 useJournal = (libc.Bool32((flags & PAGER_OMIT_JOURNAL) == 0)) pcacheSize = Xsqlite3PcacheSize(tls) - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_DEFAULT_PAGE_SIZE) zUri = uintptr(0) nUriByte = 1 nUri = 0 // Number of URI parameters @@ -48034,10 +48034,10 @@ __22: if !(*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize) { goto __27 } - if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > SQLITE_MAX_DEFAULT_PAGE_SIZE) { + if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) { goto __28 } - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_MAX_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_MAX_DEFAULT_PAGE_SIZE) goto __29 __28: *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize @@ -48071,9 +48071,9 @@ __23: // This branch also runs for files marked as immutable. act_like_temp_file: tempFile = 1 - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = PAGER_READER // Pretend we already have a lock - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = EXCLUSIVE_LOCK // Pretend we are in EXCLUSIVE mode - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = U8(PAGER_READER) // Pretend we already have a lock + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = U8(EXCLUSIVE_LOCK) // Pretend we are in EXCLUSIVE mode + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking readOnly = (vfsFlags & SQLITE_OPEN_READONLY) __24: ; @@ -48125,7 +48125,7 @@ __33: // pPager->stmtSize = 0; // pPager->stmtJSize = 0; // pPager->nPage = 0; - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = SQLITE_MAX_PAGE_COUNT + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = Pgno(SQLITE_MAX_PAGE_COUNT) // pPager->state = PAGER_UNLOCK; // pPager->errMask = 0; (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FtempFile = U8(tempFile) @@ -48144,7 +48144,7 @@ __33: __34: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FfullSync = U8(1) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FextraSync = U8(0) - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = U8(SQLITE_SYNC_NORMAL) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FwalSyncFlags = (U8(SQLITE_SYNC_NORMAL | (int32(SQLITE_SYNC_NORMAL) << 2))) __35: ; @@ -48158,13 +48158,13 @@ __35: if !(!(useJournal != 0)) { goto __36 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_OFF + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_OFF) goto __37 __36: if !((memDb != 0) || (0 != 0)) { goto __38 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_MEMORY + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_MEMORY) __38: ; __37: @@ -48483,7 +48483,7 @@ __8: goto __13 } rc = pager_playback(tls, pPager, libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) __13: ; goto __12 @@ -48594,7 +48594,7 @@ failed: goto __24 __23: - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock = U8(1) __24: ; @@ -49009,7 +49009,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5743 (*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) } else { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_CACHEMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_CACHEMOD) } return rc @@ -49077,7 +49077,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor // transactions may copy data from the sub-journal into the database // file as well as into the page cache. Which would be incorrect in // WAL mode. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_LOCKED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_LOCKED) (*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbFileSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize @@ -49673,7 +49673,7 @@ commit_phase_one_exit: if !((rc == SQLITE_OK) && !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) { goto __19 } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_FINISHED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_FINISHED) __19: ; return rc @@ -49717,7 +49717,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit ((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST) { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) return SQLITE_OK } @@ -49778,7 +49778,7 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // state to indicate that the contents of the cache may not be trusted. // Any active readers will get SQLITE_ABORT. (*Pager)(unsafe.Pointer(pPager)).FerrCode = SQLITE_ABORT - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) return rc } @@ -50432,8 +50432,8 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { rc = pagerOpenWal(tls, pPager) if rc == SQLITE_OK { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_WAL - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_WAL) + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } } else { *(*int32)(unsafe.Pointer(pbOpen)) = 1 @@ -51217,12 +51217,12 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt // Request a pointer to the required page from the VFS if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE { - *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))) + *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))) if !(int32(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))) != 0) { rc = SQLITE_NOMEM } } else { - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), ((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) if rc == SQLITE_OK { @@ -51326,7 +51326,7 @@ func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */ var nCksum int32 = int32((uintptr(0) + 40 /* &.aCksum */)) (*Wal)(unsafe.Pointer(pWal)).Fhdr.FisInit = U8(1) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = WALINDEX_MAX_VERSION + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(WALINDEX_MAX_VERSION) walChecksumBytes(tls, 1, (pWal + 72 /* &.hdr */), nCksum, uintptr(0), pWal+72 /* &.hdr */ +40 /* &.aCksum */) // Possible TSAN false-positive. See tag-20200519-1 libc.X__builtin___memcpy_chk(tls, (libc.AtomicLoadUintptr(&aHdr) + 1*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})), libc.X__builtin_object_size(tls, (libc.AtomicLoadUintptr(&aHdr)+1*48), 0)) @@ -51455,7 +51455,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 U32) int32 { /* sqlite3.c:60301:12: */ - return (int32((iPage * HASHTABLE_HASH_1) & (U32((HASHTABLE_NPAGE * 2) - 1)))) + return (int32((iPage * U32(HASHTABLE_HASH_1)) & (U32((HASHTABLE_NPAGE * 2) - 1)))) } func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60306:12: */ @@ -51500,7 +51500,7 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4) (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(0) } else { - (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) + (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) } (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + libc.UintptrFromInt32(-1)*4) } @@ -51512,7 +51512,7 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { // iFrame. The wal-index is broken up into 32KB pages. Wal-index pages // are numbered starting from 0. func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60365:12: */ - var iHash int32 = (int32((((uint64(iFrame + HASHTABLE_NPAGE)) - (HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / HASHTABLE_NPAGE)) + var iHash int32 = (int32((((uint64(iFrame + U32(HASHTABLE_NPAGE))) - (uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / uint64(HASHTABLE_NPAGE))) return iHash } @@ -51523,7 +51523,7 @@ func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60 if iHash == 0 { return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((((((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))+uint64(iFrame))-uint64(1)))*4)) } - return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(HASHTABLE_NPAGE-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%HASHTABLE_NPAGE))*4)) + return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(uint64(HASHTABLE_NPAGE)-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%uint64(HASHTABLE_NPAGE)))*4)) } // Remove entries from the hash table that point to WAL slots greater @@ -51702,7 +51702,7 @@ __1: __2: ; - if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > int64(WAL_HDRSIZE)) { goto __3 } // Buffer to load WAL header into aPrivate = uintptr(0) // Heap copy of *-shm hash being populated @@ -51723,7 +51723,7 @@ __4: // WAL file. magic = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */)) szPage = int32(Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 8))) - if !(((((magic & 0xFFFFFFFE) != WAL_MAGIC) || + if !(((((magic & 0xFFFFFFFE) != U32(WAL_MAGIC)) || ((szPage & (szPage - 1)) != 0)) || (szPage > SQLITE_MAX_PAGE_SIZE)) || (szPage < 512)) { @@ -51751,7 +51751,7 @@ __6: // Verify that the version number on the WAL format is one that // are able to understand version = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 4)) - if !(version != WAL_MAX_VERSION) { + if !(version != U32(WAL_MAX_VERSION)) { goto __7 } rc = Xsqlite3CantopenError(tls, 60635) @@ -51761,7 +51761,7 @@ __7: // Malloc a buffer to read frames into. szFrame = (szPage + WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))))) + aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))))) if !(!(aFrame != 0)) { goto __8 } @@ -51773,23 +51773,23 @@ __8: aPrivate = (aData + uintptr(szPage)) // Read all frames from the log file. - iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - WAL_HDRSIZE) / I64(szFrame))) + iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - int64(WAL_HDRSIZE)) / I64(szFrame))) iPg = U32(0) __9: if !(iPg <= U32(walFramePage(tls, iLastFrame))) { goto __11 } // Index of last frame read iLast = func() uint32 { - if (uint64(iLastFrame)) < ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE))) { + if (uint64(iLastFrame)) < ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE)))) { return iLastFrame } - return (uint32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE)))) + return (uint32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE))))) }() iFirst = (U32(uint64(1) + (func() uint64 { if iPg == U32(0) { return uint64(0) } - return ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * HASHTABLE_NPAGE))) + return ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * U32(HASHTABLE_NPAGE)))) }()))) rc = walIndexPage(tls, pWal, int32(iPg), bp+56 /* &aShare */) if !(rc != 0) { @@ -51805,7 +51805,7 @@ __13: if !(iFrame <= iLast) { goto __15 } - iOffset = (WAL_HDRSIZE + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header // Read and decode the next log frame. rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset) @@ -51864,7 +51864,7 @@ __15: // do that, according to the spec, but no memcpy() implementation that // we know of actually does that, which is why we say that memcpy() // is safe for this. Memcpy() is certainly a lot faster. - libc.X__builtin___memcpy_chk(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr)), libc.X__builtin_object_size(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */))+uintptr(nHdr32)*4), 0)) + libc.X__builtin___memcpy_chk(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr)), libc.X__builtin_object_size(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */))+uintptr(nHdr32)*4), 0)) if !(iFrame <= iLast) { goto __20 } @@ -52015,16 +52015,16 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt (*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(1) (*Wal)(unsafe.Pointer(pRet)).FexclusiveMode = func() uint8 { if bNoShm != 0 { - return WAL_HEAPMEMORY_MODE + return uint8(WAL_HEAPMEMORY_MODE) } - return WAL_NORMAL_MODE + return uint8(WAL_NORMAL_MODE) }() // Open file handle on the write-ahead log file. *(*int32)(unsafe.Pointer(bp /* flags */)) = ((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_WAL) rc = Xsqlite3OsOpen(tls, pVfs, zWalName, (*Wal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */) if (rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp /* flags */)) & SQLITE_OPEN_READONLY) != 0) { - (*Wal)(unsafe.Pointer(pRet)).FreadOnly = WAL_RDONLY + (*Wal)(unsafe.Pointer(pRet)).FreadOnly = U8(WAL_RDONLY) } if rc != SQLITE_OK { @@ -52250,8 +52250,8 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int // of memory will be freed before this function returns. aTmp = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Ht_slot(0))) * (func() uint64 { - if iLast > HASHTABLE_NPAGE { - return HASHTABLE_NPAGE + if iLast > U32(HASHTABLE_NPAGE) { + return uint64(HASHTABLE_NPAGE) } return uint64(iLast) }())))) @@ -52548,7 +52548,7 @@ __18: goto __16 __19: ; - iOffset = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset) if !(rc != SQLITE_OK) { @@ -52711,7 +52711,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, if (zBuf != uintptr(0)) && (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)))) { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = Xsqlite3WalCheckpoint(tls, pWal, db, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0), sync_flags, nBuf, zBuf, uintptr(0), uintptr(0)) @@ -52858,7 +52858,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // and there is no writer on hand to fix it. (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(1) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_HEAPMEMORY_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_HEAPMEMORY_MODE) *(*int32)(unsafe.Pointer(pChanged)) = 1 } else { return rc // Any other non-OK return is just an error @@ -52913,7 +52913,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // If the header is read successfully, check the version number to make // sure the wal-index was not constructed with some future format that // this version of SQLite cannot understand. - if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != WALINDEX_MAX_VERSION) { + if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION)) { rc = Xsqlite3CantopenError(tls, 61769) } if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { @@ -52928,7 +52928,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s rc = -1 } } - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) } return rc @@ -53022,7 +53022,7 @@ __1: // even if some external agent does a "chmod" to make the shared-memory // writable by us, until sqlite3OsShmUnmap() has been called. // This is a requirement on the VFS implementation. - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) // SQLITE_OK not possible for read-only connection if !(rc != (SQLITE_READONLY | (int32(5) << 8))) { goto __3 @@ -53051,7 +53051,7 @@ __3: goto begin_unreliable_shm_out __4: ; - if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < int64(WAL_HDRSIZE)) { goto __5 } // If the wal file is too small to contain a wal-header and the @@ -53108,7 +53108,7 @@ __8: // the caller. *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) - iOffset = (WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) __9: if !((iOffset + I64(szFrame)) <= *(*I64)(unsafe.Pointer(bp + 8 /* szWal */))) { goto __11 @@ -53477,7 +53477,7 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3. iDbOff = ((I64(pgno - U32(1))) * I64(szPage)) if (iDbOff + I64(szPage)) <= *(*I64)(unsafe.Pointer(bp /* szDb */)) { - iWalOff = ((WAL_HDRSIZE + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iWalOff = ((int64(WAL_HDRSIZE) + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff) if rc == SQLITE_OK { @@ -53705,7 +53705,7 @@ func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pO sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) sz = ((sz & 0xfe00) + ((sz & 0x0001) << 16)) - iOffset = ((WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 { if nOut > sz { @@ -54004,7 +54004,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(1) { iCksumOff = int64(24) } else { - iCksumOff = ((WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) + iCksumOff = ((int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) } rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (int32(uint64(unsafe.Sizeof(U32(0))) * uint64(2))), iCksumOff) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = Xsqlite3Get4byte(tls, aBuf) @@ -54013,7 +54013,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli iRead = (*Wal)(unsafe.Pointer(pWal)).FiReCksum (*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0) for ; (rc == SQLITE_OK) && (iRead <= iLast); iRead++ { - var iOff I64 = (WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + var iOff I64 = (int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (szPage + WAL_FRAME_HDRSIZE), iOff) if rc == SQLITE_OK { var iPgno U32 @@ -54073,7 +54073,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // Checksum for wal-header Xsqlite3Put4byte(tls, (bp /* &aWalHdr */), (uint32(WAL_MAGIC | SQLITE_BIGENDIAN))) - Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), WAL_MAX_VERSION) + Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), uint32(WAL_MAX_VERSION)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 8), uint32(szPage)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 12), (*Wal)(unsafe.Pointer(pWal)).FnCkpt) if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) { @@ -54085,7 +54085,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 28), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4))) (*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = SQLITE_BIGENDIAN + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(SQLITE_BIGENDIAN) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */)) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4)) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(1) @@ -54116,7 +54116,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = int64(0) (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FsyncFlags = sync_flags (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FszPage = szPage - iOffset = (WAL_HDRSIZE + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) szFrame = (szPage + WAL_FRAME_HDRSIZE) // Write all frames into the log file exactly once @@ -54132,7 +54132,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3WalFindFrame(tls, pWal, (*PgHdr)(unsafe.Pointer(p)).Fpgno, bp+40 /* &iWrite */) if *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) >= iFirst { - var iOff I64 = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + var iOff I64 = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) var pData uintptr if ((*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0)) || (*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum) { (*Wal)(unsafe.Pointer(pWal)).FiReCksum = *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) @@ -54212,8 +54212,8 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // journal size limit, if possible. if ((isCommit != 0) && ((*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0)) && ((*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0)) { var sz I64 = (*Wal)(unsafe.Pointer(pWal)).FmxWalSize - if (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { - sz = (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + if (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { + sz = (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) } walLimitSize(tls, pWal, sz) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0) @@ -54416,9 +54416,9 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* if op == 0 { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) if walLockShared(tls, pWal, (3+(int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) != SQLITE_OK { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) } else { @@ -54428,7 +54428,7 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* } else if op > 0 { walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) rc = 1 } else { rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) @@ -55669,7 +55669,7 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c: *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((BTS_EXCLUSIVE | BTS_PENDING)))) for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext { - (*BtLock)(unsafe.Pointer(pLock)).FeLock = READ_LOCK + (*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(READ_LOCK) } } } @@ -55715,7 +55715,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo if (int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags) & BTCF_Incrblob) != 0 { (*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(1) if ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot) && ((isClearTable != 0) || ((*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow)) { - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_INVALID) } } } @@ -55853,7 +55853,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: return (SQLITE_CONSTRAINT | (int32(11) << 8)) } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) } else { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 0 } @@ -55861,7 +55861,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: rc = saveCursorKey(tls, pCur) if rc == SQLITE_OK { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_ValidNKey | BTCF_ValidOvfl) | BTCF_AtLast)))) @@ -55931,7 +55931,7 @@ func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65272: Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey) (*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) } // In this version of BtreeMoveto, pKey is a packed index record @@ -55993,7 +55993,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_FAULT { return (*BtCursor)(unsafe.Pointer(pCur)).FskipNext } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) if Xsqlite3FaultSim(tls, 410) != 0 { rc = SQLITE_IOERR } else { @@ -56007,7 +56007,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp /* skipNext */)) } if ((*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) } } return rc @@ -56036,7 +56036,7 @@ func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65378:25 return uintptr(unsafe.Pointer(&fakeCursor)) } -var fakeCursor U8 = CURSOR_VALID /* sqlite3.c:65379:13 */ +var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:65379:13 */ // This routine restores a cursor back to its original position after it // has been moved by some outside activity (such as a btree rebalance or @@ -56472,7 +56472,7 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, return } ovfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize) - 4)))) - ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, PTRMAP_OVERFLOW1, (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) + ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) } } @@ -57185,7 +57185,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: (*MemPage)(unsafe.Pointer(pPage)).FnFree = -1 // Indicate that this value is yet uncomputed (*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1) - if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_CellSizeCk) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_CellSizeCk)) != 0 { return btreeCellSizeCheck(tls, pPage) } return SQLITE_OK @@ -57520,7 +57520,7 @@ __2: return SQLITE_NOMEM __3: ; - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) (*Btree)(unsafe.Pointer(p)).Fdb = db (*Btree)(unsafe.Pointer(p)).Flock.FpBtree = p (*Btree)(unsafe.Pointer(p)).Flock.FiTable = Pgno(1) @@ -57680,7 +57680,7 @@ __24: // determined by the 2-byte integer located at an offset of 16 bytes from // the beginning of the database file. (*BtShared)(unsafe.Pointer(pBt)).FpageSize = (U32((int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 16))) << 8) | (int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 17))) << 16))) - if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > SQLITE_MAX_PAGE_SIZE)) || + if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE))) || ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)) & (*BtShared)(unsafe.Pointer(pBt)).FpageSize) != U32(0))) { goto __25 } @@ -58295,7 +58295,7 @@ __2: nPage = *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)) __3: ; - if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __4 } nPage = U32(0) @@ -58382,7 +58382,7 @@ __14: // EVIDENCE-OF: R-25008-21688 The size of a page is a power of two // between 512 and 65536 inclusive. if !(((((pageSize - U32(1)) & pageSize) != U32(0)) || - (pageSize > SQLITE_MAX_PAGE_SIZE)) || + (pageSize > U32(SQLITE_MAX_PAGE_SIZE))) || (pageSize <= U32(256))) { goto __15 } @@ -58609,7 +58609,7 @@ func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVers __1: ; - if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & SQLITE_ResetDatabase) != 0) && + if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != 0) && (int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0)) { goto __2 } @@ -58675,7 +58675,7 @@ __11: // Any read-only or read-write transaction implies a read-lock on // page 1. So if some other shared-cache client already has a write-lock // on page 1, the transaction cannot be opened. - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) if !(SQLITE_OK != rc) { goto __12 } @@ -58766,7 +58766,7 @@ __16: goto __28 } - (*Btree)(unsafe.Pointer(p)).Flock.FeLock = READ_LOCK + (*Btree)(unsafe.Pointer(p)).Flock.FeLock = U8(READ_LOCK) (*Btree)(unsafe.Pointer(p)).Flock.FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock (*BtShared)(unsafe.Pointer(pBt)).FpLock = (p + 48 /* &.lock */) __28: @@ -58775,9 +58775,9 @@ __27: ; (*Btree)(unsafe.Pointer(p)).FinTrans = func() uint8 { if wrflag != 0 { - return TRANS_WRITE + return uint8(TRANS_WRITE) } - return TRANS_READ + return uint8(TRANS_READ) }() if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) > int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction)) { goto __29 @@ -58878,13 +58878,13 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12 if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, pCell) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } } if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8)))) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } return *(*int32)(unsafe.Pointer(bp /* rc */)) @@ -59004,7 +59004,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag } else { var nextOvfl Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pDbPage)).FaData) if nextOvfl != Pgno(0) { - ptrmapPut(tls, pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage, bp /* &rc */) + ptrmapPut(tls, pBt, nextOvfl, uint8(PTRMAP_OVERFLOW2), iFreePage, bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp /* rc */)) } @@ -59083,7 +59083,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // var pFreePg uintptr at bp+8, 8 - rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, BTALLOC_EXACT) + rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, uint8(BTALLOC_EXACT)) if rc != SQLITE_OK { return rc } @@ -59095,8 +59095,8 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // Index of free page to move pLastPg to // var pLastPg uintptr at bp+24, 8 - var eMode U8 = BTALLOC_ANY // Mode parameter for allocateBtreePage() - var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() + var eMode U8 = U8(BTALLOC_ANY) // Mode parameter for allocateBtreePage() + var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() rc = btreeGetPage(tls, pBt, iLastPg, bp+24 /* &pLastPg */, 0) if rc != SQLITE_OK { @@ -59110,7 +59110,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // looping until a free-page located within the first nFin pages // of the file is found. if bCommit == 0 { - eMode = BTALLOC_LE + eMode = U8(BTALLOC_LE) iNear = nFin } for ok := true; ok; ok = ((bCommit != 0) && (*(*Pgno)(unsafe.Pointer(bp + 40 /* iFreePg */)) > nFin)) { @@ -59313,7 +59313,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ // handle, downgrade to a read-only transaction. The other statements // may still be reading from the database. downgradeAllSharedCacheTableLocks(tls, p) - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_READ + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_READ) } else { // If the handle had any kind of transaction open, decrement the // transaction count of the shared btree. If the transaction count @@ -59323,13 +59323,13 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ clearAllSharedCacheTableLocks(tls, p) (*BtShared)(unsafe.Pointer(pBt)).FnTransaction-- if 0 == (*BtShared)(unsafe.Pointer(pBt)).FnTransaction { - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_NONE + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_NONE) } } // Set the current transaction state to TRANS_NONE and unlock the // pager if this call closed the only read or write transaction. - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) unlockBtreeIfUnused(tls, pBt) } @@ -59378,7 +59378,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 return rc } (*Btree)(unsafe.Pointer(p)).FiDataVersion-- // Compensate for pPager->iDataVersion++; - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -59440,7 +59440,7 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w } } else { Xsqlite3BtreeClearCursor(tls, p) - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_FAULT + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_FAULT) (*BtCursor)(unsafe.Pointer(p)).FskipNext = errCode } btreeReleaseAllCursorPages(tls, p) @@ -59515,7 +59515,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */))) } - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -59667,7 +59667,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u (*BtCursor)(unsafe.Pointer(pCur)).FpBt = pBt (*BtCursor)(unsafe.Pointer(pCur)).FcurFlags = func() uint8 { if wrFlag != 0 { - return BTCF_WriteFlag + return uint8(BTCF_WriteFlag) } return uint8(0) }() @@ -59675,7 +59675,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u if wrFlag != 0 { return uint8(0) } - return PAGER_GET_READONLY + return uint8(PAGER_GET_READONLY) }() // If there are two or more cursors on the same btree, then all such // cursors *must* have the BTCF_Multiple flag set. @@ -59687,7 +59687,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u } (*BtCursor)(unsafe.Pointer(pCur)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpCursor (*BtShared)(unsafe.Pointer(pBt)).FpCursor = pCur - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_OK } @@ -60289,7 +60289,7 @@ __1: if !((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot == Pgno(0)) { goto __6 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_EMPTY goto __7 __6: @@ -60312,7 +60312,7 @@ __8: if !(rc != SQLITE_OK) { goto __10 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return rc __10: ; @@ -60351,7 +60351,7 @@ skip_init: if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) { goto __12 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) goto __13 __12: if !(!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0)) { @@ -60364,11 +60364,11 @@ __12: __16: ; subpage = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8)))) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) rc = moveToChild(tls, pCur, subpage) goto __15 __14: - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) rc = SQLITE_EMPTY __15: ; @@ -60943,7 +60943,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ return SQLITE_DONE } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext > 0 { return SQLITE_OK } @@ -60982,7 +60982,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ } for ok := true; ok; ok = (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -61060,7 +61060,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * return SQLITE_DONE } if CURSOR_SKIPNEXT == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext < 0 { return SQLITE_OK } @@ -61079,7 +61079,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * } else { for int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -61721,7 +61721,7 @@ __5: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __7 } - ptrmapPut(tls, pBt, iPage, PTRMAP_FREEPAGE, uint32(0), bp+8 /* &rc */) + ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+8 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) { goto __8 } @@ -62072,9 +62072,9 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) { var eType U8 = func() uint8 { if pgnoPtrmap != 0 { - return PTRMAP_OVERFLOW2 + return uint8(PTRMAP_OVERFLOW2) } - return PTRMAP_OVERFLOW1 + return uint8(PTRMAP_OVERFLOW1) }() ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoOvfl */)), eType, pgnoPtrmap, bp+12 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -62877,7 +62877,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // be marked as dirty. Returning an error code will cause a // rollback, undoing any changes made to the parent page. if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) if int32(*(*U16)(unsafe.Pointer(bp + 24 /* szCell */))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FminLocal) { ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), bp+136 /* &rc */) } @@ -63725,7 +63725,7 @@ __82: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __83 } - ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) + ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { goto __84 } @@ -63930,7 +63930,7 @@ __108: if !(!(leafCorrection != 0)) { goto __111 } - ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) + ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) __111: ; if !(int32(cachedCellSize(tls, bp+96 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) { @@ -64149,7 +64149,7 @@ __134: goto __136 } key = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FaData + 8)) - ptrmapPut(tls, pBt, key, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) + ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) goto __135 __135: i++ @@ -64245,7 +64245,7 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = allocateBtreePage(tls, pBt, bp /* &pChild */, bp+8 /* &pgnoChild */, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, uint8(0)) copyNodeContent(tls, pRoot, *(*uintptr)(unsafe.Pointer(bp /* pChild */)), bp+12 /* &rc */) if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) } } if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -64858,7 +64858,7 @@ __23: // Also, set the cursor state to invalid. This stops saveCursorPosition() // from trying to save the current position of the cursor. (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK)) { goto __33 } @@ -64879,7 +64879,7 @@ __36: ; __34: ; - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) (*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey __33: ; @@ -65073,7 +65073,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { if bSkipnext != 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) if iCellIdx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = -1 (*BtCursor)(unsafe.Pointer(pCur)).Fix = (U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)) @@ -65084,7 +65084,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = moveToRoot(tls, pCur) if bPreserve != 0 { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_EMPTY { *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK @@ -65146,7 +65146,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags // 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). - *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), BTALLOC_EXACT) + *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(BTALLOC_EXACT)) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } @@ -65204,7 +65204,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } // Update the pointer-map and meta-data with the new root-page number. - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), PTRMAP_ROOTPAGE, uint32(0), bp+40 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(PTRMAP_ROOTPAGE), uint32(0), bp+40 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 { releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))) return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) @@ -65461,7 +65461,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) } - *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), PTRMAP_ROOTPAGE, uint32(0), iTable, 0) + *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), uint8(PTRMAP_ROOTPAGE), uint32(0), iTable, 0) releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */))) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) @@ -65749,7 +65749,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 if isFreeList != 0 { var n U32 = Xsqlite3Get4byte(tls, (pOvflData + 4)) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iPage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0)) } if n > (((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize / U32(4)) - U32(2)) { checkAppendMsg(tls, pCheck, @@ -65759,7 +65759,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 for i = 0; i < int32(n); i++ { var iFreePage Pgno = Xsqlite3Get4byte(tls, (pOvflData + uintptr((8 + (i * 4))))) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iFreePage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iFreePage, uint8(PTRMAP_FREEPAGE), uint32(0)) } checkRef(tls, pCheck, iFreePage) } @@ -65771,7 +65771,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 // the following page matches iPage. if ((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0) && (N > U32(0)) { i = int32(Xsqlite3Get4byte(tls, pOvflData)) - checkPtrmap(tls, pCheck, uint32(i), PTRMAP_OVERFLOW2, iPage) + checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage) } } iPage = Xsqlite3Get4byte(tls, pOvflData) @@ -65987,7 +65987,7 @@ __5: goto __8 } (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3812 /* "On page %u at ri..." */ - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __8: ; depth = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -66064,7 +66064,7 @@ __14: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __17 } - checkPtrmap(tls, pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage) + checkPtrmap(tls, pCheck, pgnoOvfl, uint8(PTRMAP_OVERFLOW1), iPage) __17: ; checkList(tls, pCheck, 0, pgnoOvfl, nPage) @@ -66079,7 +66079,7 @@ __16: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __20 } - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __20: ; d2 = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -66297,7 +66297,7 @@ __1: (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = uintptr(0) (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = uintptr(0) Xsqlite3StrAccumInit(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */), uintptr(0), bp+136 /* &zErr[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) - (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = SQLITE_PRINTF_INTERNAL + (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage == Pgno(0)) { goto __3 } @@ -66390,7 +66390,7 @@ __10: __8: ; - *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CellSizeCk)) + *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CellSizeCk))) i = Pgno(0) __17: if !((int32(i) < nRoot) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) { @@ -66405,7 +66405,7 @@ __20: if !((((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1))) && !(bPartial != 0)) { goto __21 } - checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), PTRMAP_ROOTPAGE, uint32(0)) + checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(PTRMAP_ROOTPAGE), uint32(0)) __21: ; checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+240 /* ¬Used */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) @@ -66570,7 +66570,7 @@ func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74 var rc int32 Xsqlite3BtreeEnter(tls, p) - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) Xsqlite3BtreeLeave(tls, p) return rc @@ -67643,7 +67643,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem) (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & uint64(0x3fffffff))) - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Str | MEM_Term)) if bForce != 0 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Int | MEM_Real) | MEM_IntReal)))) @@ -67668,7 +67668,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { libc.X__builtin___memset_chk(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})), libc.X__builtin_object_size(tls, bp /* &ctx */, 0)) libc.X__builtin___memset_chk(tls, bp+56 /* &t */, 0, uint64(unsafe.Sizeof(Mem{})), libc.X__builtin_object_size(tls, bp+56 /* &t */, 0)) - (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fdb = (*Mem)(unsafe.Pointer(pMem)).Fdb (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpOut = bp + 56 /* &t */ (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpMem = pMem @@ -67720,7 +67720,7 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325 (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(p)).Fz) } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) } // Release memory held by the Mem p, both external memory cleared @@ -67950,7 +67950,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 case SQLITE_AFF_BLOB: { // Really a cast to BLOB if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) == 0 { - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 { (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob)) @@ -67983,7 +67983,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16(((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) >> 3)) - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Blob) | MEM_Zero)))) return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding)) @@ -68017,7 +68017,7 @@ func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76652:21 if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeMemClearExternAndSetNull(tls, pMem) } else { - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) } } @@ -68035,7 +68035,7 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit n = 0 } *(*int32)(unsafe.Pointer(pMem /* &.u */)) = n - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } @@ -68045,7 +68045,7 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76682:29: */ Xsqlite3VdbeMemSetNull(tls, pMem) *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } // Delete any previous value and set the value stored in *pMem to val, @@ -68055,7 +68055,7 @@ func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3. vdbeReleaseAndSetInt64(tls, pMem, val) } else { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } } @@ -68091,7 +68091,7 @@ func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sql Xsqlite3VdbeMemSetNull(tls, pMem) if !(Xsqlite3IsNaN(tls, val) != 0) { *(*float64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Real) } } @@ -68181,7 +68181,7 @@ func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3 Xsqlite3VdbeMemRelease(tls, pTo) libc.X__builtin___memcpy_chk(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{})), libc.X__builtin_object_size(tls, pTo, 0)) - (*Mem)(unsafe.Pointer(pFrom)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pFrom)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(pFrom)).FszMalloc = 0 } @@ -68216,9 +68216,9 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc } flags = func() uint16 { if int32(enc) == 0 { - return MEM_Blob + return uint16(MEM_Blob) } - return MEM_Str + return uint16(MEM_Str) }() if nByte < 0 { @@ -68309,7 +68309,7 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc // to read from the disk) then the pMem is left in an inconsistent state. func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77006:20: */ var rc int32 - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) if Xsqlite3BtreeMaxRecordSize(tls, pCur) < (Sqlite3_int64(offset + amt)) { return Xsqlite3CorruptError(tls, 77015) } @@ -68317,7 +68317,7 @@ func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz) if rc == SQLITE_OK { *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = int8(0) // Overrun area used when reading malformed records - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob) (*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt) } else { Xsqlite3VdbeMemRelease(tls, pMem) @@ -68415,7 +68415,7 @@ func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3 func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77122:30: */ var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{}))) if p != 0 { - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(p)).Fdb = db } return p @@ -68458,7 +68458,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153 (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = (pRec + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))))) for i = 0; i < nCol; i++ { - (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fdb = db } } else { @@ -68526,7 +68526,7 @@ __1: pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), nVal, enc, uint8(0)) if !((((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & (U32(SQLITE_FUNC_CONSTANT | SQLITE_FUNC_SLOCHNG))) == U32(0)) || - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) { + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) { goto __2 } return SQLITE_OK @@ -68586,7 +68586,7 @@ __9: Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+2702 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal))) goto __11 __10: - Xsqlite3ValueApplyAffinity(tls, pVal, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) if !((rc == SQLITE_OK) && (Xsqlite3VdbeMemTooBig(tls, pVal) != 0)) { @@ -68687,8 +68687,8 @@ __3: if !(*(*uintptr)(unsafe.Pointer(ppVal)) != 0) { goto __5 } - Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, SQLITE_UTF8) - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, SQLITE_UTF8) + Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, uint8(SQLITE_UTF8)) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, uint8(SQLITE_UTF8)) __5: ; return rc @@ -68718,7 +68718,7 @@ __6: goto no_mem __9: ; - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) { goto __10 } Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), (I64(*(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))) * I64(negInt))) @@ -68731,16 +68731,16 @@ __10: goto no_mem __12: ; - Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) __11: ; if !(((op == TK_INTEGER) || (op == TK_FLOAT)) && (int32(affinity) == SQLITE_AFF_BLOB)) { goto __13 } - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), SQLITE_AFF_NUMERIC, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8)) goto __14 __13: - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, uint8(SQLITE_UTF8)) __14: ; @@ -68835,7 +68835,7 @@ __30: if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) { goto __33 } - (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = MEM_Int + (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0))) __33: ; @@ -68920,7 +68920,7 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 { Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) } - } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var v uintptr var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar) @@ -69164,7 +69164,7 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77 (*Vdbe)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe (*Vdbe)(unsafe.Pointer(p)).FpPrev = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FpVdbe = p - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_INIT + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_INIT) (*Vdbe)(unsafe.Pointer(p)).FpParse = pParse (*Parse)(unsafe.Pointer(pParse)).FpVdbe = p @@ -69311,7 +69311,7 @@ func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3 *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) return i } @@ -69816,7 +69816,7 @@ __1: *(*int32)(unsafe.Pointer(pOut + 8 /* &.p2 */)) += ((*Vdbe)(unsafe.Pointer(p)).FnOp) } (*VdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp3) - (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOut + 16 /* &.p4 */)) = uintptr(0) (*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0) _ = iLineno @@ -69889,7 +69889,7 @@ func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sq // If the input FuncDef structure is ephemeral, then free it. If // the FuncDef is not ephermal, then do nothing. func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:78840:13: */ - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_EPHEM) != U32(0) { + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_EPHEM)) != U32(0) { Xsqlite3DbFreeNN(tls, db, pDef) } } @@ -70002,9 +70002,9 @@ func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* s pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24) freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Noop + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Noop) return 1 } @@ -70436,7 +70436,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: (*Mem)(unsafe.Pointer(p)).FszMalloc = 0 } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Undefined) } } } @@ -70596,7 +70596,7 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * // Loop counter var rc int32 = SQLITE_OK // Return code var pMem uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaMem + 1*56) // First Mem of result set - var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TriggerEQP) != uint64(0)))) + var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TriggerEQP)) != uint64(0)))) // var aOp uintptr at bp+8, 8 // Array of opcodes var pOp uintptr // Current opcode @@ -70640,19 +70640,19 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(1)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4) } else { Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(0)*56), int64(*(*int32)(unsafe.Pointer(bp /* i */)))) Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(1)*56), Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)), - -1, SQLITE_UTF8, uintptr(0)) + -1, uint8(SQLITE_UTF8), uintptr(0)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(3)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(4)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) // pMem+5 for p4 is done last Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(6)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp5)) Xsqlite3VdbeMemSetNull(tls, (pMem + uintptr(7)*56)) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8) } (*Vdbe)(unsafe.Pointer(p)).FpResultSet = pMem @@ -70712,11 +70712,11 @@ func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */ // There should be at least one opcode. // Set the magic to VDBE_MAGIC_RUN sooner rather than later. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RUN + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_RUN) (*Vdbe)(unsafe.Pointer(p)).Fpc = -1 (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) (*Vdbe)(unsafe.Pointer(p)).FnChange = 0 (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = U32(1) (*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = U8(255) @@ -70838,9 +70838,9 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite } else { (*Vdbe)(unsafe.Pointer(p)).FnCursor = nCursor (*Vdbe)(unsafe.Pointer(p)).FnVar = YnVar(nVar) - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null)) (*Vdbe)(unsafe.Pointer(p)).FnMem = nMem - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, MEM_Undefined) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined)) libc.X__builtin___memset_chk(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0)))), libc.X__builtin_object_size(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0)) } Xsqlite3VdbeRewind(tls, p) @@ -70979,7 +70979,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, uint16(MEM_Null)) } // Set the name of the idx'th column to be returned by the SQL statement. @@ -71000,7 +71000,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa } pColName = ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr((idx+(var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))))*56) - rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, SQLITE_UTF8, xDel) + rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, uint8(SQLITE_UTF8), xDel) return rc } @@ -71316,7 +71316,7 @@ func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sq if ((deferred != 0) && (((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons + (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons) > int64(0))) || (!(deferred != 0) && ((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0))) { (*Vdbe)(unsafe.Pointer(p)).Frc = (SQLITE_CONSTRAINT | (int32(3) << 8)) - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) Xsqlite3VdbeError(tls, p, ts+4511 /* "FOREIGN KEY cons..." */, 0) return SQLITE_ERROR } @@ -71353,7 +71353,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * // state. We need to rollback the statement transaction, if there is // one, or the complete transaction if there is no statement transaction. - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN { + if (*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_RUN) { return SQLITE_OK } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -71439,7 +71439,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } else { (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) Xsqlite3CommitInternalChanges(tls, db) } } else { @@ -71506,7 +71506,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_HALT + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_HALT) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM @@ -71548,7 +71548,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80 if (*Sqlite3)(unsafe.Pointer(db)).FpErr == uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).FpErr = Xsqlite3ValueNew(tls, db) } - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) Xsqlite3EndBenignMalloc(tls) (*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc-- } else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { @@ -71613,7 +71613,7 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: (*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0) // Save profiling information from this VDBE run. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RESET + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_RESET) return ((*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } @@ -71621,7 +71621,7 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: // the result code. Write any error message text into *pzErrMsg. func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:20: */ var rc int32 = SQLITE_OK - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_HALT) { + if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == U32(VDBE_MAGIC_HALT)) { rc = Xsqlite3VdbeReset(tls, p) } @@ -71678,7 +71678,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3. vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp) Xsqlite3DbFree(tls, db, pSub) } - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_INIT { + if (*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_INIT) { releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpVList) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpFree) @@ -71704,7 +71704,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ if (*Vdbe)(unsafe.Pointer(p)).FpNext != 0 { (*Vdbe)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpNext)).FpPrev = (*Vdbe)(unsafe.Pointer(p)).FpPrev } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_DEAD + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_DEAD) (*Vdbe)(unsafe.Pointer(p)).Fdb = uintptr(0) Xsqlite3DbFreeNN(tls, db, p) } @@ -71728,7 +71728,7 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:812 return Xsqlite3CorruptError(tls, 81251) } (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) return SQLITE_OK } @@ -71746,7 +71746,7 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: var rc int32 rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */)), bp /* &isDifferentRow */) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) if *(*int32)(unsafe.Pointer(bp /* isDifferentRow */)) != 0 { (*VdbeCursor)(unsafe.Pointer(p)).FnullRow = U8(1) } @@ -71972,7 +71972,7 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { // EVIDENCE-OF: R-29851-52272 Value is a big-endian 64-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*I64)(unsafe.Pointer(bp /* &x */)) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } else { // EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit @@ -71981,9 +71981,9 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { libc.X__builtin___memcpy_chk(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint64(unsafe.Sizeof(U64(0))), libc.X__builtin_object_size(tls, (pMem /* &.u */ /* &.r */), 0)) (*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 { if (((*(*U64)(unsafe.Pointer(bp /* x */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* x */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0)) { - return MEM_Null + return uint16(MEM_Null) } - return MEM_Real + return uint16(MEM_Real) }() } return U32(8) @@ -72005,7 +72005,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin case U32(0): { // Null // EVIDENCE-OF: R-24078-09375 Value is a NULL. - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) break } @@ -72014,7 +72014,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-44885-25196 Value is an 8-bit twos-complement // integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = I64(I8(*(*uint8)(unsafe.Pointer((buf))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(1) @@ -72024,7 +72024,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-49794-35026 Value is a big-endian 16-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(2) @@ -72034,7 +72034,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-37839-54301 Value is a big-endian 24-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(((65536 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 2))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(3) @@ -72044,7 +72044,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((((16777216 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 16)) | (int32(*(*uint8)(unsafe.Pointer((buf) + 2))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 3))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(4) @@ -72054,7 +72054,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-50385-09674 Value is a big-endian 48-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = ((I64((((U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2))))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(6) @@ -72075,7 +72075,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-12976-22893 Value is the integer 0. // EVIDENCE-OF: R-18143-12121 Value is the integer 1. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(serial_type - U32(8))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(0) } @@ -72202,15 +72202,15 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin // var c2 Mem at bp+56, 56 - Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) - Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) + Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) + Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) Xsqlite3VdbeMemShallowCopy(tls, bp /* &c1 */, pMem1, MEM_Ephem) Xsqlite3VdbeMemShallowCopy(tls, bp+56 /* &c2 */, pMem2, MEM_Ephem) v1 = Xsqlite3ValueText(tls, bp /* &c1 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) v2 = Xsqlite3ValueText(tls, bp+56 /* &c2 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) if (v1 == uintptr(0)) || (v2 == uintptr(0)) { if prcErr != 0 { - *(*U8)(unsafe.Pointer(prcErr)) = SQLITE_NOMEM + *(*U8)(unsafe.Pointer(prcErr)) = U8(SQLITE_NOMEM) } rc = 0 } else { @@ -72598,7 +72598,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else if *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)) != 0 { (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb - (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = MEM_Str + (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = U16(MEM_Str) (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fz = (aKey1 + uintptr(d1)) rc = vdbeCompareMemString(tls, bp+8 /* &mem1 */, pRhs, *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)), (pPKey2 + 19 /* &.errCode */)) @@ -73108,7 +73108,7 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin var pRet uintptr = Xsqlite3ValueNew(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb) if pRet != 0 { Xsqlite3VdbeMemCopy(tls, pRet, pMem) - Xsqlite3ValueApplyAffinity(tls, pRet, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pRet, aff, uint8(SQLITE_UTF8)) } return pRet } @@ -73210,7 +73210,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName libc.X__builtin___memset_chk(tls, bp /* &preupdate */, 0, uint64(unsafe.Sizeof(PreUpdate{})), libc.X__builtin_object_size(tls, bp /* &preupdate */, 0)) - if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) == 0 { + if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) == 0 { iKey1 = libc.AssignInt64(&iKey2, int64(0)) (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab) } else { @@ -73318,7 +73318,7 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c: (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 248 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)))) } if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_PROFILE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_PROFILE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) } (*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0) } @@ -73393,7 +73393,7 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: Xsqlite3_mutex_enter(tls, mutex) for i = 0; i < int32((*Vdbe)(unsafe.Pointer(p)).FnVar); i++ { Xsqlite3VdbeMemRelease(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)) - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = U16(MEM_Null) } if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 { @@ -73431,11 +73431,11 @@ func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:831 } func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83172:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF8) + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF8)) } func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83175:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF16LE) + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF16LE)) } func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83178:19: */ @@ -73474,19 +73474,19 @@ func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr } func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83204:32: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) } func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83208:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83211:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16BE) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16BE)) } func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83214:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } // EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five @@ -73497,70 +73497,70 @@ func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83222 } var aType = [64]U8{ - SQLITE_BLOB, // 0x00 (not possible) - SQLITE_NULL, // 0x01 NULL - SQLITE_TEXT, // 0x02 TEXT - SQLITE_NULL, // 0x03 (not possible) - SQLITE_INTEGER, // 0x04 INTEGER - SQLITE_NULL, // 0x05 (not possible) - SQLITE_INTEGER, // 0x06 INTEGER + TEXT - SQLITE_NULL, // 0x07 (not possible) - SQLITE_FLOAT, // 0x08 FLOAT - SQLITE_NULL, // 0x09 (not possible) - SQLITE_FLOAT, // 0x0a FLOAT + TEXT - SQLITE_NULL, // 0x0b (not possible) - SQLITE_INTEGER, // 0x0c (not possible) - SQLITE_NULL, // 0x0d (not possible) - SQLITE_INTEGER, // 0x0e (not possible) - SQLITE_NULL, // 0x0f (not possible) - SQLITE_BLOB, // 0x10 BLOB - SQLITE_NULL, // 0x11 (not possible) - SQLITE_TEXT, // 0x12 (not possible) - SQLITE_NULL, // 0x13 (not possible) - SQLITE_INTEGER, // 0x14 INTEGER + BLOB - SQLITE_NULL, // 0x15 (not possible) - SQLITE_INTEGER, // 0x16 (not possible) - SQLITE_NULL, // 0x17 (not possible) - SQLITE_FLOAT, // 0x18 FLOAT + BLOB - SQLITE_NULL, // 0x19 (not possible) - SQLITE_FLOAT, // 0x1a (not possible) - SQLITE_NULL, // 0x1b (not possible) - SQLITE_INTEGER, // 0x1c (not possible) - SQLITE_NULL, // 0x1d (not possible) - SQLITE_INTEGER, // 0x1e (not possible) - SQLITE_NULL, // 0x1f (not possible) - SQLITE_FLOAT, // 0x20 INTREAL - SQLITE_NULL, // 0x21 (not possible) - SQLITE_TEXT, // 0x22 INTREAL + TEXT - SQLITE_NULL, // 0x23 (not possible) - SQLITE_FLOAT, // 0x24 (not possible) - SQLITE_NULL, // 0x25 (not possible) - SQLITE_FLOAT, // 0x26 (not possible) - SQLITE_NULL, // 0x27 (not possible) - SQLITE_FLOAT, // 0x28 (not possible) - SQLITE_NULL, // 0x29 (not possible) - SQLITE_FLOAT, // 0x2a (not possible) - SQLITE_NULL, // 0x2b (not possible) - SQLITE_FLOAT, // 0x2c (not possible) - SQLITE_NULL, // 0x2d (not possible) - SQLITE_FLOAT, // 0x2e (not possible) - SQLITE_NULL, // 0x2f (not possible) - SQLITE_BLOB, // 0x30 (not possible) - SQLITE_NULL, // 0x31 (not possible) - SQLITE_TEXT, // 0x32 (not possible) - SQLITE_NULL, // 0x33 (not possible) - SQLITE_FLOAT, // 0x34 (not possible) - SQLITE_NULL, // 0x35 (not possible) - SQLITE_FLOAT, // 0x36 (not possible) - SQLITE_NULL, // 0x37 (not possible) - SQLITE_FLOAT, // 0x38 (not possible) - SQLITE_NULL, // 0x39 (not possible) - SQLITE_FLOAT, // 0x3a (not possible) - SQLITE_NULL, // 0x3b (not possible) - SQLITE_FLOAT, // 0x3c (not possible) - SQLITE_NULL, // 0x3d (not possible) - SQLITE_FLOAT, // 0x3e (not possible) - SQLITE_NULL, // 0x3f (not possible) + U8(SQLITE_BLOB), // 0x00 (not possible) + U8(SQLITE_NULL), // 0x01 NULL + U8(SQLITE_TEXT), // 0x02 TEXT + U8(SQLITE_NULL), // 0x03 (not possible) + U8(SQLITE_INTEGER), // 0x04 INTEGER + U8(SQLITE_NULL), // 0x05 (not possible) + U8(SQLITE_INTEGER), // 0x06 INTEGER + TEXT + U8(SQLITE_NULL), // 0x07 (not possible) + U8(SQLITE_FLOAT), // 0x08 FLOAT + U8(SQLITE_NULL), // 0x09 (not possible) + U8(SQLITE_FLOAT), // 0x0a FLOAT + TEXT + U8(SQLITE_NULL), // 0x0b (not possible) + U8(SQLITE_INTEGER), // 0x0c (not possible) + U8(SQLITE_NULL), // 0x0d (not possible) + U8(SQLITE_INTEGER), // 0x0e (not possible) + U8(SQLITE_NULL), // 0x0f (not possible) + U8(SQLITE_BLOB), // 0x10 BLOB + U8(SQLITE_NULL), // 0x11 (not possible) + U8(SQLITE_TEXT), // 0x12 (not possible) + U8(SQLITE_NULL), // 0x13 (not possible) + U8(SQLITE_INTEGER), // 0x14 INTEGER + BLOB + U8(SQLITE_NULL), // 0x15 (not possible) + U8(SQLITE_INTEGER), // 0x16 (not possible) + U8(SQLITE_NULL), // 0x17 (not possible) + U8(SQLITE_FLOAT), // 0x18 FLOAT + BLOB + U8(SQLITE_NULL), // 0x19 (not possible) + U8(SQLITE_FLOAT), // 0x1a (not possible) + U8(SQLITE_NULL), // 0x1b (not possible) + U8(SQLITE_INTEGER), // 0x1c (not possible) + U8(SQLITE_NULL), // 0x1d (not possible) + U8(SQLITE_INTEGER), // 0x1e (not possible) + U8(SQLITE_NULL), // 0x1f (not possible) + U8(SQLITE_FLOAT), // 0x20 INTREAL + U8(SQLITE_NULL), // 0x21 (not possible) + U8(SQLITE_TEXT), // 0x22 INTREAL + TEXT + U8(SQLITE_NULL), // 0x23 (not possible) + U8(SQLITE_FLOAT), // 0x24 (not possible) + U8(SQLITE_NULL), // 0x25 (not possible) + U8(SQLITE_FLOAT), // 0x26 (not possible) + U8(SQLITE_NULL), // 0x27 (not possible) + U8(SQLITE_FLOAT), // 0x28 (not possible) + U8(SQLITE_NULL), // 0x29 (not possible) + U8(SQLITE_FLOAT), // 0x2a (not possible) + U8(SQLITE_NULL), // 0x2b (not possible) + U8(SQLITE_FLOAT), // 0x2c (not possible) + U8(SQLITE_NULL), // 0x2d (not possible) + U8(SQLITE_FLOAT), // 0x2e (not possible) + U8(SQLITE_NULL), // 0x2f (not possible) + U8(SQLITE_BLOB), // 0x30 (not possible) + U8(SQLITE_NULL), // 0x31 (not possible) + U8(SQLITE_TEXT), // 0x32 (not possible) + U8(SQLITE_NULL), // 0x33 (not possible) + U8(SQLITE_FLOAT), // 0x34 (not possible) + U8(SQLITE_NULL), // 0x35 (not possible) + U8(SQLITE_FLOAT), // 0x36 (not possible) + U8(SQLITE_NULL), // 0x37 (not possible) + U8(SQLITE_FLOAT), // 0x38 (not possible) + U8(SQLITE_NULL), // 0x39 (not possible) + U8(SQLITE_FLOAT), // 0x3a (not possible) + U8(SQLITE_NULL), // 0x3b (not possible) + U8(SQLITE_FLOAT), // 0x3c (not possible) + U8(SQLITE_NULL), // 0x3d (not possible) + U8(SQLITE_FLOAT), // 0x3e (not possible) + U8(SQLITE_NULL), // 0x3f (not possible) } /* sqlite3.c:83223:19 */ // Return true if a parameter to xUpdate represents an unchanged column @@ -73658,13 +73658,13 @@ func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqli func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83413:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) } func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83419:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF16LE, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(-1)) } func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:83425:17: */ @@ -73686,7 +73686,7 @@ func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType u var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut Xsqlite3VdbeMemRelease(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) } @@ -73699,13 +73699,13 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83455:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF8, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) } func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:83464:17: */ if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } if n > uint64(0x7fffffff) { invokeValueDestructor(tls, z, xDel, pCtx) @@ -73716,17 +73716,17 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83481:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83490:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16BE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16BE), xDel) } func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83499:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:83509:17: */ @@ -73758,7 +73758,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* }() if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Null) != 0 { Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, Xsqlite3ErrStr(tls, errCode), -1, - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) } } @@ -73767,7 +73767,7 @@ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83 (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_TOOBIG Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+4709 /* "string or blob t..." */, -1, - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) } // An SQLITE_NOMEM error. @@ -73820,7 +73820,7 @@ func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83602:12: */ var db uintptr var rc int32 - if !((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) { + if !((*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_RUN)) { goto __1 } // We used to require that sqlite3_reset() be called before retrying @@ -74101,7 +74101,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } else { Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Agg + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Agg) *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 { libc.X__builtin___memset_chk(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte), libc.X__builtin_object_size(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0)) @@ -74264,7 +74264,7 @@ func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84002:18: */ } var nullMem = Mem{ - /* .flags = */ Fflags: MEM_Null, + /* .flags = */ Fflags: U16(MEM_Null), } /* sqlite3.c:84012:20 */ // Check to see if column iCol of the given statement is valid. If @@ -74513,7 +74513,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 return Xsqlite3MisuseError(tls, 84320) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { + if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_MISUSE) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) Xsqlite3_log(tls, SQLITE_MISUSE, @@ -74528,7 +74528,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 i-- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56) Xsqlite3VdbeMemRelease(tls, pVar) - (*Mem)(unsafe.Pointer(pVar)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pVar)).Fflags = U16(MEM_Null) (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FerrCode = SQLITE_OK // If the bit corresponding to this variable in Vdbe.expmask is set, then @@ -74642,7 +74642,7 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, } func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84472:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF8) + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF8)) } func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:84481:16: */ @@ -74651,7 +74651,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, return invokeValueDestructor(tls, zData, xDel, uintptr(0)) } else { if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } return bindText(tls, pStmt, i, zData, int32(nData), xDel, enc) } @@ -74659,7 +74659,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, } func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84498:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF16LE) + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:84508:16: */ @@ -74839,7 +74839,7 @@ func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: // Return true if the prepared statement is in need of being reset. func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84675:16: */ var v uintptr = pStmt - return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == VDBE_MAGIC_RUN)) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) + return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == U32(VDBE_MAGIC_RUN))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) } // Return a pointer to the next prepared statement after pStmt associated @@ -75338,7 +75338,7 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { (*Mem)(unsafe.Pointer(bp + 192 /* &utf8 */)).Fdb = db Xsqlite3VdbeMemSetStr(tls, bp+192 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, (*Mem)(unsafe.Pointer(pVar)).Fn, enc, uintptr(0)) if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+192 /* &utf8 */, SQLITE_UTF8) { - (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = SQLITE_NOMEM + (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = U8(SQLITE_NOMEM) (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FnAlloc = U32(0) } pVar = bp + 192 /* &utf8 */ @@ -75684,15 +75684,15 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28 if rc <= 0 { if (rc == 0) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } else { - return MEM_Real + return U16(MEM_Real) } } else if (rc == 1) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } - return MEM_Real + return U16(MEM_Real) } // Return the numeric type for pMem, either MEM_Int or MEM_Real or both or @@ -75716,7 +75716,7 @@ func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */ // overwritten with an integer value. func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:85961:28: */ Xsqlite3VdbeMemSetNull(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } @@ -75728,7 +75728,7 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3. if (int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { //OPTIMIZATION-IF-FALSE return out2PrereleaseWithClear(tls, pOut) } else { - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } return uintptr(0) @@ -78772,7 +78772,7 @@ __10: // jump ; pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 24))) // Most jump operations do a goto to this spot in order to update @@ -78789,7 +78789,7 @@ __11: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*24) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __8 // Opcode: InitCoroutine P1 P2 P3 * * @@ -78808,7 +78808,7 @@ __12: // jump pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = (I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1)) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) { goto __184 } @@ -78830,7 +78830,7 @@ __13: pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*24) pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*24) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __8 // Opcode: Yield P1 P2 * * * @@ -78848,7 +78848,7 @@ __13: __14: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) pcDest = int32(*(*I64)(unsafe.Pointer(pIn1 /* &.u */))) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 24))) @@ -79001,7 +79001,7 @@ __18: // out2 // Write that value into register P2. __19: // same as TK_FLOAT, out2 pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Real) *(*float64)(unsafe.Pointer(pOut /* &.u */)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) goto __8 @@ -79021,7 +79021,7 @@ __20: // same as TK_STRING, out2 if !(int32(encoding) != SQLITE_UTF8) { goto __194 } - rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, SQLITE_UTF8, uintptr(0)) + rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, uint8(SQLITE_UTF8), uintptr(0)) if !(rc != 0) { goto __195 @@ -79055,7 +79055,7 @@ __194: goto too_big __198: ; - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_String + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_String) // Opcode: String P1 P2 P3 P4 P5 // Synopsis: r[P2]='P4' (len=P1) @@ -79097,7 +79097,7 @@ __22: if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 { return (uint16(MEM_Null | MEM_Cleared)) } - return MEM_Null + return uint16(MEM_Null) }()) (*Mem)(unsafe.Pointer(pOut)).Fn = 0 __199: @@ -79361,7 +79361,7 @@ __216: if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_ROW) != 0) { goto __217 } - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_ROW, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) __217: ; @@ -79852,7 +79852,7 @@ __43: // jump, in1 if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { goto __272 } - applyAffinity(tls, pIn1, SQLITE_AFF_NUMERIC, encoding) + applyAffinity(tls, pIn1, int8(SQLITE_AFF_NUMERIC), encoding) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { goto __273 } @@ -80499,7 +80499,7 @@ __60: // same as TK_BITNOT, in1, out2 if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { goto __328 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = ^Xsqlite3VdbeIntValue(tls, pIn1) __328: ; @@ -80950,7 +80950,7 @@ __373: if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < (len + 2)) { goto __375 } - (*Mem)(unsafe.Pointer(pDest)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pDest)).Fflags = U16(MEM_Null) if !(Xsqlite3VdbeMemGrow(tls, pDest, (len+2), 0) != 0) { goto __377 } @@ -81416,7 +81416,7 @@ __432: __430: ; (*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Blob) if !(nZero != 0) { goto __433 } @@ -81643,7 +81643,7 @@ __455: if !(p12 == SAVEPOINT_ROLLBACK) { goto __461 } - isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0))) + isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0))) ii = 0 __463: if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { @@ -81695,7 +81695,7 @@ __469: } Xsqlite3ExpirePreparedStatements(tls, db, 0) Xsqlite3ResetAllSchemasOfConnection(tls, db) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) __471: ; __456: @@ -81899,7 +81899,7 @@ __482: __74: *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) = 0 - if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_QueryOnly) != uint64(0))) { + if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_QueryOnly)) != uint64(0))) { goto __492 } rc = SQLITE_READONLY @@ -82048,7 +82048,7 @@ __76: } // When the schema cookie changes, record the new cookie internally (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = ((*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5)) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) goto __503 __502: if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_FILE_FORMAT) { @@ -82241,7 +82241,7 @@ __514: ; // Table with INTEGER PRIMARY KEY and nothing else - pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, CURTYPE_BTREE) + pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, uint8(CURTYPE_BTREE)) if !(pCur == uintptr(0)) { goto __516 } @@ -82285,7 +82285,7 @@ __80: // The new cursor // Only ephemeral cursors can be duplicated - pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, CURTYPE_BTREE) + pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, uint8(CURTYPE_BTREE)) if !(pCx == uintptr(0)) { goto __518 } @@ -82345,11 +82345,11 @@ __82: // so that the table is empty again, rather than creating a new table. (*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0) - (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(CACHE_STALE) rc = Xsqlite3BtreeClearTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0)) goto __520 __519: - pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_BTREE) + pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_BTREE)) if !(pCx1 == uintptr(0)) { goto __521 } @@ -82390,8 +82390,8 @@ __526: (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0) goto __525 __524: - (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = SCHEMA_ROOT - rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, SCHEMA_ROOT, BTREE_WRCSR, + (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(SCHEMA_ROOT) + rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, uint32(SCHEMA_ROOT), BTREE_WRCSR, uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */))) (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1) __525: @@ -82422,7 +82422,7 @@ __527: __83: ; - pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_SORTER) + pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_SORTER)) if !(pCx2 == uintptr(0)) { goto __528 } @@ -82476,7 +82476,7 @@ __530: __85: ; - pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, CURTYPE_PSEUDO) + pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, uint8(CURTYPE_PSEUDO)) if !(pCx3 == uintptr(0)) { goto __531 } @@ -82604,7 +82604,7 @@ __90: // Only interested in == results (*VdbeCursor)(unsafe.Pointer(pC3)).FnullRow = U8(0) (*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = U32(CACHE_STALE) if !((*VdbeCursor)(unsafe.Pointer(pC3)).FisTable != 0) { goto __532 } @@ -82703,7 +82703,7 @@ __532: // OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be // immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively, // with the same key. - if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), BTREE_SEEK_EQ) != 0) { + if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uint32(BTREE_SEEK_EQ)) != 0) { goto __547 } eqOnly = 1 @@ -83039,7 +83039,7 @@ __577: alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0)) (*VdbeCursor)(unsafe.Pointer(pC6)).FnullRow = (U8(1 - alreadyExists)) (*VdbeCursor)(unsafe.Pointer(pC6)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = U32(CACHE_STALE) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Found) { goto __578 } @@ -83121,7 +83121,7 @@ __97: // changing the datatype of pIn3, however, as it is used by other // parts of the prepared statement. *(*Mem)(unsafe.Pointer(bp + 360 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3)) - applyAffinity(tls, bp+360 /* &x */, SQLITE_AFF_NUMERIC, encoding) + applyAffinity(tls, bp+360 /* &x */, int8(SQLITE_AFF_NUMERIC), encoding) if !((int32((*Mem)(unsafe.Pointer(bp+360 /* &x */)).Fflags) & MEM_Int) == 0) { goto __583 } @@ -83146,7 +83146,7 @@ notExistsWithKey: (*VdbeCursor)(unsafe.Pointer(pC7)).FmovetoTarget = I64(iKey1) // Used by OP_Delete (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(CACHE_STALE) (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0) (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) @@ -83350,7 +83350,7 @@ __607: __602: ; (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(CACHE_STALE) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */)) goto __8 @@ -83475,7 +83475,7 @@ __617: rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+432, /* &x1 */ (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_APPEND | OPFLAG_SAVEPOSITION)), seekResult) (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(CACHE_STALE) // Invoke the update-hook if required. if !(rc != 0) { @@ -83590,7 +83590,7 @@ __624: // Only flags that can be set are SAVEPOISTION and AUXDELETE rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5)) - (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(CACHE_STALE) (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult = 0 if !(rc != 0) { goto __625 @@ -83604,7 +83604,7 @@ __625: goto __626 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ - if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __627 } (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName, @@ -83689,7 +83689,7 @@ __105: goto abort_due_to_error __630: ; - (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = U32(CACHE_STALE) goto __8 // Opcode: RowData P1 P2 P3 * * @@ -83782,7 +83782,7 @@ __107: if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { goto __635 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __8 goto __636 __635: @@ -83821,7 +83821,7 @@ __642: if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { goto __643 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __8 __643: ; @@ -83845,7 +83845,7 @@ __108: pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) (*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow = U8(1) - (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = U32(CACHE_STALE) if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_BTREE) { goto __644 } @@ -83899,7 +83899,7 @@ __645: rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+496 /* &res7 */) (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */))) (*VdbeCursor)(unsafe.Pointer(pC16)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { goto __647 } @@ -84009,7 +84009,7 @@ __654: rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+504 /* &res9 */) (*VdbeCursor)(unsafe.Pointer(pC18)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = U32(CACHE_STALE) __655: ; if !(rc != 0) { @@ -84102,7 +84102,7 @@ __117: // jump rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3) next_tail: - (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(CACHE_STALE) if !(rc == SQLITE_OK) { goto __658 @@ -84187,7 +84187,7 @@ __661: return 0 }()) - (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { goto __662 } @@ -84263,7 +84263,7 @@ __665: if !(*(*int32)(unsafe.Pointer(bp + 584 /* res10 */)) == 0) { goto __666 } - rc = Xsqlite3BtreeDelete(tls, pCrsr7, BTREE_AUXDELETE) + rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(BTREE_AUXDELETE)) if !(rc != 0) { goto __668 } @@ -84282,7 +84282,7 @@ __669: __667: ; - (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = U32(CACHE_STALE) (*VdbeCursor)(unsafe.Pointer(pC22)).FseekResult = 0 goto __8 @@ -84512,12 +84512,12 @@ __128: ; pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > ((*Sqlite3)(unsafe.Pointer(db)).FnVDestroy + 1)) { goto __684 } rc = SQLITE_LOCKED - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) goto abort_due_to_error goto __685 __684: @@ -84525,7 +84525,7 @@ __684: *(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) = 0 // Not needed. Only to silence a warning. rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+628 /* &iMoved */) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))) if !(rc != 0) { goto __686 @@ -84687,8 +84687,8 @@ __133: } Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpSchema) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))) - rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), INITFLAG_AlterTable) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), uint32(INITFLAG_AlterTable)) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) goto __697 __696: @@ -84848,7 +84848,7 @@ __705: goto __708 __707: *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) - 1)) - Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) __708: ; __706: @@ -85092,7 +85092,7 @@ __728: if !(pMem2 != pEnd) { goto __730 } - (*Mem)(unsafe.Pointer(pMem2)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pMem2)).Fflags = U16(MEM_Undefined) (*Mem)(unsafe.Pointer(pMem2)).Fdb = db goto __729 __729: @@ -85155,7 +85155,7 @@ __143: // (deferred foreign key constraints). Otherwise, if P1 is zero, the // statement counter is incremented (immediate foreign key constraints). __144: - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { goto __731 } *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) @@ -85417,7 +85417,7 @@ __752: ; (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = ((pCtx + 48 /* &.argv */) + uintptr(n4)*8) - Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, MEM_Null) + Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32((int64(pOp) - int64(aOp)) / 24)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p @@ -85429,7 +85429,7 @@ __752: // OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_AggStep1 + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_AggStep1) __153: ; @@ -85497,7 +85497,7 @@ __762: __761: ; Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut) - (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(MEM_Null) (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0 if !(rc != 0) { goto __763 @@ -85738,7 +85738,7 @@ __784: (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((MEM_Str | MEM_Static) | MEM_Term)) (*Mem)(unsafe.Pointer(pOut)).Fz = Xsqlite3JournalModename(tls, eNew) (*Mem)(unsafe.Pointer(pOut)).Fn = Xsqlite3Strlen30(tls, (*Mem)(unsafe.Pointer(pOut)).Fz) - (*Mem)(unsafe.Pointer(pOut)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pOut)).Fenc = U8(SQLITE_UTF8) Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) if !(rc != 0) { goto __785 @@ -85865,7 +85865,7 @@ __162: // used to generate an error message if the lock cannot be obtained. __163: isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3) - if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReadUncommit))) { + if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReadUncommit)))) { goto __791 } p13 = (*Op)(unsafe.Pointer(pOp)).Fp1 @@ -85991,7 +85991,7 @@ __800: (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)))).FpVtab = pVtab1 // Initialize vdbe cursor object - pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, CURTYPE_VTAB) + pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, uint8(CURTYPE_VTAB)) if !(pCur1 != 0) { goto __801 } @@ -86192,8 +86192,8 @@ __816: // in register P1 is passed as the zName argument to the xRename method. __171: - isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_LegacyAlter) + isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_LegacyAlter)) pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab pName = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) @@ -86208,7 +86208,7 @@ __817: if !(isLegacy == 0) { goto __818 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyAlter)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyAlter))) __818: ; Xsqlite3VtabImportErrmsg(tls, p, pVtab5) @@ -86311,7 +86311,7 @@ __826: __829: (*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 { if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Replace { - return OE_Abort + return uint8(OE_Abort) } return uint8((*Op)(unsafe.Pointer(pOp)).Fp5) }() @@ -86544,11 +86544,11 @@ __844: goto __846 } z3 = Xsqlite3MPrintf(tls, db, ts+5387 /* "-- %s" */, libc.VaList(bp+136, zTrace)) - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) Xsqlite3DbFree(tls, db, z3) goto __847 __846: - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) __847: ; __845: @@ -86716,7 +86716,7 @@ var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:87461:32 */ var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:87681:32 */ var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:87684:32 */ -var aFlag1 = [2]U16{MEM_Blob, (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88134:24 */ +var aFlag1 = [2]U16{U16(MEM_Blob), (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88134:24 */ var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:89263:20 */ //************* End of vdbe.c *********************************************** @@ -86796,7 +86796,7 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) // Set the value of register r[1] in the SQL statement to integer iRow. // This is done directly as a performance optimization - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56 /* &.u */)) = iRow // If the statement has been run before (and is paused at the OP_ResultRow) @@ -86918,7 +86918,7 @@ __4: Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5540 /* "cannot open virt..." */, libc.VaList(bp, zTable)) __5: ; - if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __6 } pTab = uintptr(0) @@ -86987,7 +86987,7 @@ __14: goto __15 } zFault = uintptr(0) - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { goto __16 } pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey @@ -87104,7 +87104,7 @@ __33: if !(wrFlag != 0) { goto __35 } - (*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fopcode = OP_OpenWrite + (*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fopcode = U8(OP_OpenWrite) __35: ; (*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum) @@ -87179,13 +87179,13 @@ __38: var iLn int32 = 0 /* sqlite3.c:93635:24 */ var openBlob = [6]VdbeOpList{ - {Fopcode: OP_TableLock}, // 0: Acquire a read or write lock - {Fopcode: OP_OpenRead}, // 1: Open a cursor + {Fopcode: U8(OP_TableLock)}, // 0: Acquire a read or write lock + {Fopcode: U8(OP_OpenRead)}, // 1: Open a cursor // blobSeekToRow() will initialize r[1] to the desired rowid - {Fopcode: OP_NotExists, Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] - {Fopcode: OP_Column, Fp3: int8(1)}, // 3 - {Fopcode: OP_ResultRow, Fp1: int8(1)}, // 4 - {Fopcode: OP_Halt}, // 5 + {Fopcode: U8(OP_NotExists), Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] + {Fopcode: U8(OP_Column), Fp3: int8(1)}, // 3 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1)}, // 4 + {Fopcode: U8(OP_Halt)}, // 5 } /* sqlite3.c:93636:31 */ // Close a blob handle that was previously created using @@ -88347,7 +88347,7 @@ func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:949 var rc int32 = SQLITE_OK if (*SortSubtask)(unsafe.Pointer(pTask)).FpThread != 0 { - *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(SQLITE_ERROR) + *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(int64(SQLITE_ERROR)) Xsqlite3ThreadJoin(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpThread, bp /* &pRet */) @@ -88525,7 +88525,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd, ((((SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE), bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK { - *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = SQLITE_MAX_MMAP_SIZE + *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = int64(SQLITE_MAX_MMAP_SIZE) Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), SQLITE_FCNTL_MMAP_SIZE, bp+8 /* &max */) if nExtend > int64(0) { vdbeSorterExtendFile(tls, db, *(*uintptr)(unsafe.Pointer(ppFd)), nExtend) @@ -89477,9 +89477,9 @@ func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset ui // nPMA<=65536 -> TreeDepth() == 2 func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:12: */ var nDepth int32 = 0 - var nDiv I64 = SORTER_MAX_MERGE_COUNT + var nDiv I64 = int64(SORTER_MAX_MERGE_COUNT) for nDiv < I64(nPMA) { - nDiv = (nDiv * SORTER_MAX_MERGE_COUNT) + nDiv = (nDiv * int64(SORTER_MAX_MERGE_COUNT)) nDepth++ } return nDepth @@ -90356,7 +90356,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpRight continue - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { return WRC_Abort @@ -90367,7 +90367,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. return WRC_Abort } } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) != 0 { return WRC_Abort } @@ -90656,15 +90656,15 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx // The pExpr->u.zToken might point into memory that will be freed by the // sqlite3DbFree(db, pDup) on the last line of this block, so be sure to // make a copy of the token before doing the sqlite3DbFree(). - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, db, pExpr) libc.X__builtin___memcpy_chk(tls, pExpr, pDup, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, pExpr, 0)) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_MemToken) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_MemToken)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { if *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) != uintptr(0) { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpOwner = pExpr } else { @@ -90673,7 +90673,7 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx } Xsqlite3DbFree(tls, db, pDup) } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Alias)) } // Return TRUE if the name zCol occurs anywhere in the USING clause. @@ -90729,13 +90729,13 @@ func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) in } // Always support for legacy schemas if ((*NameContext)(unsafe.Pointer(pTopNC)).FncFlags & NC_IsDDL) != 0 { // Currently parsing a DDL statement - if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0)) { + if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0)) { return 1 } - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDDL) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDDL)) != uint64(0))) } else { // Currently parsing a DML statement - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0))) } return int32(0) } @@ -90749,7 +90749,7 @@ func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97 n = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) - if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { @@ -90903,7 +90903,7 @@ __13: } pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab - if !(((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_NestedFrom) != U32(0))) { + if !(((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_NestedFrom)) != U32(0))) { goto __16 } hit = 0 @@ -91041,7 +91041,7 @@ __15: if !((int32((*SrcList_item)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) { goto __35 } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) __35: ; pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpSchema @@ -91126,7 +91126,7 @@ __45: goto __46 __46: ; - if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { + if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { goto __49 } // IMP: R-51414-32910 @@ -91151,7 +91151,7 @@ __49: __53: (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) eNewExprOp = TK_REGISTER - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Alias)) __54: ; goto __52 @@ -91160,7 +91160,7 @@ __51: if !(iCol < 0) { goto __55 } - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) goto __56 __55: if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) { @@ -91205,12 +91205,12 @@ __36: (pMatch != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_IdxExpr | NC_GenCol)) == 0)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && - (((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { + (((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { goto __59 } cnt = 1 (*Expr)(unsafe.Pointer(pExpr)).FiColumn = int16(-1) - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) __59: ; @@ -91249,14 +91249,14 @@ __61: } pOrig = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*32)).FpExpr - if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Agg)) != U32(0))) { + if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Agg))) != U32(0))) { goto __65 } Xsqlite3ErrorMsg(tls, pParse, ts+5724 /* "misuse of aliase..." */, libc.VaList(bp, zAs)) return WRC_Abort __65: ; - if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Win)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Win))) != U32(0)) && ((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0) || (pNC != pTopNC))) { goto __66 } @@ -91325,7 +91325,7 @@ __11: goto __70 } - if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_DblQuoted)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_DblQuoted))) != U32(0)) && (areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0)) { goto __71 } @@ -91344,7 +91344,7 @@ __11: // issue a warning. Xsqlite3_log(tls, SQLITE_WARNING, ts+5810 /* "double-quoted st..." */, libc.VaList(bp+16, zCol)) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) return WRC_Prune __71: @@ -91416,13 +91416,13 @@ __78: Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpRight) (*Expr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0) (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(eNewExprOp) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Leaf) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Leaf)) lookupname_end: if !(cnt == 1) { goto __79 } - if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Alias)) != U32(0))) { + if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Alias))) != U32(0))) { goto __81 } Xsqlite3AuthRead(tls, pParse, pExpr, pSchema, (*NameContext)(unsafe.Pointer(pNC)).FpSrcList) @@ -91467,7 +91467,7 @@ func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 (*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1) } else { (*Expr)(unsafe.Pointer(p)).FiColumn = YnVar(iCol) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { (*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 { @@ -91518,7 +91518,7 @@ func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExp } Xsqlite3ErrorMsg(tls, pParse, ts+5994 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn)) if pExpr != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } @@ -91533,7 +91533,7 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_FLOAT { return -1 } - Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), SQLITE_UTF8) + Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), uint8(SQLITE_UTF8)) if *(*float64)(unsafe.Pointer(bp /* r */)) > 1.0 { return -1 @@ -91573,11 +91573,11 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var pItem uintptr pItem = pSrcList + 8 /* &.a */ - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor (*Expr)(unsafe.Pointer(pExpr)).FiColumn-- - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) break } @@ -91648,7 +91648,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc // The database encoding var savedAllowFlags int32 = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin)) var pWin uintptr = func() uintptr { - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { return *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) } return uintptr(0) @@ -91666,8 +91666,8 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } } else { is_agg = (libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_UNLIKELY) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Unlikely) + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_UNLIKELY)) != 0 { + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Unlikely)) if n == 2 { (*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+1*32)).FpExpr) if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 { @@ -91702,7 +91702,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) return WRC_Prune } @@ -91712,9 +91712,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // 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. - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_ConstFunc) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_ConstFunc)) } - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CONSTANT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CONSTANT)) == U32(0) { // Clearly non-deterministic functions like random(), but also // date/time functions that use 'now', and other functions like // sqlite_version() that might change over time cannot be used @@ -91729,12 +91729,12 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // Must fit in 8 bits (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef)) if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_FromDDL) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } } - if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_InternalFunc) == U32(0)) { + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_InternalFunc)) == U32(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 @@ -91754,10 +91754,10 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s ts+6165 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } else if (((is_agg != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0)) || - (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0)) && !(pWin != 0))) || + (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0)) && !(pWin != 0))) || (((is_agg != 0) && (pWin != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0)) { var zType uintptr - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0) || (pWin != 0) { + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0) || (pWin != 0) { zType = ts + 6209 /* "window" */ } else { zType = ts + 6216 /* "aggregate" */ @@ -91772,7 +91772,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s Xsqlite3ErrorMsg(tls, pParse, ts+6278, /* "wrong number of ..." */ libc.VaList(bp+64, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ - } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { Xsqlite3ErrorMsg(tls, pParse, ts+6323, /* "FILTER may not b..." */ libc.VaList(bp+80, nId, zId)) @@ -91789,7 +91789,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s return 0 }()))) } - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { is_agg = 1 } Xsqlite3WalkExprList(tls, pWalker, pList) @@ -91812,9 +91812,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_HasWin) } else { var pNC2 uintptr = pNC - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_FUNCTION + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_FUNCTION) (*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(0) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } for (pNC2 != 0) && !(Xsqlite3FunctionUsesThisSrc(tls, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) != 0) { @@ -91824,7 +91824,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s if (pNC2 != 0) && (pDef != 0) { - *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((NC_HasAgg | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_MINMAX))) + *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((U32(NC_HasAgg) | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)))) } } @@ -91842,7 +91842,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s case TK_IN: { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 { @@ -91852,7 +91852,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) if nRef != (*NameContext)(unsafe.Pointer(pNC)).FnRef { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_VarSelect) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_VarSelect)) *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_VarSelect) } } @@ -91884,7 +91884,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE { (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUTH + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUTH) return WRC_Continue } } @@ -92135,7 +92135,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 if pNew == uintptr(0) { return 1 } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) if (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr == pE { (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew @@ -92234,7 +92234,7 @@ __3: // Walker callback for windowRemoveExprFromSelect(). func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99159:12: */ _ = pWalker - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) Xsqlite3WindowUnlinkFromSelect(tls, pWin) } @@ -92367,7 +92367,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql var pLeftmost uintptr // Left-most of SELECT of a compound var db uintptr // Database connection - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Resolved) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Resolved)) != 0 { return WRC_Prune } pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) @@ -92381,7 +92381,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // sqlite3SelectPrep() do all of the processing for this SELECT. // sqlite3SelectPrep() will invoke both sqlite3SelectExpand() and // this routine in the correct order. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Expanded) == U32(0) { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Expanded)) == U32(0) { Xsqlite3SelectPrep(tls, pParse, p, pOuterNC) if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort @@ -92394,7 +92394,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql pLeftmost = p for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Resolved) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(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. @@ -92411,7 +92411,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // as if it were part of the sub-query, not the parent. This block // moves the pOrderBy down to the sub-query. It will be moved back // after the names have been resolved. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(pSub)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy @@ -92421,7 +92421,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // Recursively resolve names in all subqueries for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ { var pItem uintptr = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) - if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_Resolved) == U32(0)) { + if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_Resolved)) == U32(0)) { var pNC uintptr // Used to iterate name contexts var nRef int32 = 0 // Refcount for pOuterNC and outer contexts var zSavedContext uintptr = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext @@ -92517,7 +92517,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // within the ORDER BY clause has been transformed to an integer value. // These integers will be replaced by copies of the corresponding result // set expressions by the call to resolveOrderGroupBy() below. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(p)).FpOrderBy = (*Select)(unsafe.Pointer(pSub)).FpOrderBy (*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) @@ -92556,7 +92556,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql goto __3 } { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (EP_Agg)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (U32(EP_Agg))) != U32(0) { Xsqlite3ErrorMsg(tls, pParse, ts+6632 /* "aggregate functi..." */, 0) return WRC_Abort @@ -92817,7 +92817,7 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { if iCol >= 0 { return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).Faffinity } - return SQLITE_AFF_INTEGER + return int8(SQLITE_AFF_INTEGER) } // Return the 'affinity' of the expression pExpr if any. @@ -92836,7 +92836,7 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { // SELECT * FROM t1 WHERE (select a from t1); func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99759:21: */ var op int32 - for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0) { + for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft @@ -92897,7 +92897,7 @@ func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, // Skip over any TK_COLLATE operators. func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99830:21: */ - for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0)) { + for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0)) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft } @@ -92909,7 +92909,7 @@ func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3. // expression. func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99843:21: */ for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_Unlikely))) != U32(0)) { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Unlikely)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Unlikely))) != U32(0) { pExpr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr } else { @@ -92964,8 +92964,8 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) break } - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_Collate) != 0 { - if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & EP_Collate) != U32(0)) { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Collate)) != 0 { + if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & U32(EP_Collate)) != U32(0)) { p = (*Expr)(unsafe.Pointer(p)).FpLeft } else { var pNext uintptr = (*Expr)(unsafe.Pointer(p)).FpRight @@ -92973,10 +92973,10 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { if ((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != uintptr(0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) && - (!(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0))) { + (!(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0))) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (EP_Collate)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (U32(EP_Collate))) != U32(0) { pNext = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr break } @@ -93027,9 +93027,9 @@ func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* // Both sides of the comparison are columns. If one has numeric // affinity, use that. Otherwise use no affinity. if ((int32(aff1)) >= SQLITE_AFF_NUMERIC) || ((int32(aff2)) >= SQLITE_AFF_NUMERIC) { - return SQLITE_AFF_NUMERIC + return int8(SQLITE_AFF_NUMERIC) } else { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } else { // One side is a column, the other is not. Use the columns affinity. @@ -93052,10 +93052,10 @@ func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987: aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 { aff = Xsqlite3CompareAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight, aff) - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList + 8 /* &.a */))).FpExpr, aff) } else if int32(aff) == 0 { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } return aff } @@ -93096,9 +93096,9 @@ func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull i func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100047:24: */ var pColl uintptr - if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) - } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & EP_Collate) != U32(0)) { + } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & U32(EP_Collate)) != U32(0)) { pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight) } else { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) @@ -93117,7 +93117,7 @@ func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, // is reversed in the sqlite3BinaryCompareCollSeq() call so that the // correct collating sequence is found. func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100075:24: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Commuted)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Commuted))) != U32(0) { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft) } else { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, (*Expr)(unsafe.Pointer(p)).FpRight) @@ -93323,7 +93323,7 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, var regRight int32 = 0 var opx U8 = op var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse) - var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0))) + var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return @@ -93335,10 +93335,10 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, p5 = U8(int32(p5) | (SQLITE_STOREP2)) if int32(opx) == TK_LE { - opx = TK_LT + opx = U8(TK_LT) } if int32(opx) == TK_GE { - opx = TK_GT + opx = U8(TK_GT) } regLeft = exprCodeSubselect(tls, pParse, pLeft) @@ -93450,7 +93450,7 @@ func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */ *(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0 heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &nHeight */) heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpRight, bp /* &nHeight */) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) } else if *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0 { heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) @@ -93629,7 +93629,7 @@ func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pRight } else if pRight == uintptr(0) { return pLeft - } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse)) && + } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { Xsqlite3ExprDelete(tls, db, pLeft) Xsqlite3ExprDelete(tls, db, pRight) @@ -93658,11 +93658,11 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u Xsqlite3ErrorMsg(tls, pParse, ts+6741 /* "too many argumen..." */, libc.VaList(bp, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = pList - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_HasFunc) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_HasFunc)) Xsqlite3ExprSetHeightAndFlags(tls, pParse, pNew) if eDistinct == SF_Distinct { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_Distinct) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_Distinct)) } return pNew } @@ -93680,9 +93680,9 @@ func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD bp := tls.Alloc(8) defer tls.Free(8) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromDDL)) != U32(0) { - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_DIRECT) != U32(0)) || - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_TrustedSchema) == uint64(0)) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromDDL))) != U32(0) { + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_DIRECT)) != U32(0)) || + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_TrustedSchema)) == uint64(0)) { // Functions prohibited in triggers and views if: // (1) tagged with SQLITE_DIRECTONLY // (2) not tagged with SQLITE_INNOCUOUS (which means it @@ -93738,7 +93738,7 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n *(*I64)(unsafe.Pointer(bp + 8 /* i */)) = (I64(int32(*(*int8)(unsafe.Pointer(z + 1))) - '0')) // The common case of ?N for a single digit N bOk = 1 } else { - bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), SQLITE_UTF8))) + bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), uint8(SQLITE_UTF8)))) } if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)))) { @@ -93787,20 +93787,20 @@ func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:10 if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) } else { Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } } } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_MemToken)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_MemToken))) != U32(0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Static)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Static))) != U32(0)) { Xsqlite3DbFreeNN(tls, db, p) } } @@ -93826,10 +93826,10 @@ func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* s // passed as the first argument. This is always one of EXPR_FULLSIZE, // EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_TokenOnly)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly))) != U32(0) { return int32((uintptr(0) + 16 /* &.pLeft */)) } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Reduced)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Reduced))) != U32(0) { return int32((uintptr(0) + 44 /* &.iTable */)) } return int32(unsafe.Sizeof(Expr{})) @@ -93872,15 +93872,15 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit // Only one flag value allowed if ((0 == flags) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN)) || - (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0)) { + (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0)) { nSize = int32(unsafe.Sizeof(Expr{})) } else { if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) || (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { - nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | EP_Reduced)) + nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | uint64(EP_Reduced))) } else { - nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | EP_TokenOnly)) + nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | uint64(EP_TokenOnly))) } } return nSize @@ -93891,7 +93891,7 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit // string is defined.) func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100947:12: */ var nByte int32 = (dupedExprStructSize(tls, p, flags) & 0xfff) - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nByte = int32(Size_t(nByte) + ((libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & uint64(0x3fffffff)) + uint64(1))) } return (((nByte) + 7) & libc.CplInt32(7)) @@ -93937,7 +93937,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint // Figure out where to write the new Expr structure. if pzBuffer != 0 { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = *(*uintptr)(unsafe.Pointer(pzBuffer)) - staticFlag = EP_Static + staticFlag = U32(EP_Static) } else { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = Xsqlite3DbMallocRawNN(tls, db, uint64(dupedExprSize(tls, p, dupFlags))) staticFlag = U32(0) @@ -93952,7 +93952,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint var nStructSize uint32 = uint32(dupedExprStructSize(tls, p, dupFlags)) var nNewSize int32 = (int32(nStructSize & uint32(0xfff))) var nToken int32 - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nToken = (Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) + 1) } else { nToken = 0 @@ -93985,7 +93985,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint if U32(0) == (((*Expr)(unsafe.Pointer(p)).Fflags | (*Expr)(unsafe.Pointer(pNew)).Fflags) & (U32(EP_TokenOnly | EP_Leaf))) { // Fill in the pNew->x.pSelect or pNew->x.pList member. - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) } else { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) @@ -94009,7 +94009,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint return uintptr(0) }() } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 64 /* &.y */)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } @@ -94057,7 +94057,7 @@ func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096 // an a newly duplicated SELECT statement and gather all of the Window // objects found there, assembling them onto the linked list at Select->pWin. func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101124:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) @@ -94530,7 +94530,7 @@ func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStar if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) { (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) - libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, ENAME_SPAN, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(ENAME_SPAN), 0, 0x3) } } } @@ -94600,10 +94600,10 @@ func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int // anything else 0 func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625:20: */ if Xsqlite3StrICmp(tls, zIn, ts+6913 /* "true" */) == 0 { - return EP_IsTrue + return U32(EP_IsTrue) } if Xsqlite3StrICmp(tls, zIn, ts+6918 /* "false" */) == 0 { - return EP_IsFalse + return U32(EP_IsFalse) } return U32(0) } @@ -94614,9 +94614,9 @@ func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625 func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101637:20: */ var v U32 - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Quoted)) != U32(0)) && + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Quoted))) != U32(0)) && ((libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUEFALSE + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (v) return 1 } @@ -94647,13 +94647,13 @@ func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqli if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR) { var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var pLeft uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) - if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pRight } else { pExpr = pLeft } - } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pLeft } else { @@ -94693,7 +94693,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // If pWalker->eCode is 2 then any term of the expression that comes from // the ON or USING clauses of a left join disqualifies the expression // from being considered constant. - if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -94703,10 +94703,10 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // and either pWalker->eCode==4 or 5 or the function has the // SQLITE_FUNC_CONST flag. case TK_FUNCTION: - if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } return WRC_Continue } else { @@ -94727,7 +94727,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / fallthrough case TK_AGG_COLUMN: - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { return WRC_Continue } if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */))) { @@ -94747,7 +94747,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // 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 - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 4 { // A bound parameter in a CREATE statement that originates from // sqlite3_prepare() causes an error @@ -94832,7 +94832,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) } // Check if pExpr is a sub-select. If so, consider it variable. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -94914,7 +94914,7 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* // 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 - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_IntValue)) != 0 { *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8 /* &.u */)) return 1 } @@ -94974,7 +94974,7 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995 case TK_BLOB: return 0 case TK_COLUMN: - return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (EP_CanBeNull)) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && + return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_CanBeNull))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol != uintptr(0))) && // Defense against OOM problems (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol+uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*32)).FnotNull) == 0)))) default: @@ -95068,10 +95068,10 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10208 var pEList uintptr var pTab uintptr var i int32 - if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return uintptr(0) } // Not a subquery - if ((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_VarSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_VarSelect))) != U32(0) { return uintptr(0) } // Correlated subq p = *(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)) @@ -95125,7 +95125,7 @@ func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int3 Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regHasNull) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur) Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, 0, regHasNull) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) Xsqlite3VdbeJumpHere(tls, v, addr1) } @@ -95231,14 +95231,14 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var mustBeUnique int32 // True if RHS must be unique var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded - mustBeUnique = (libc.Bool32((inFlags & IN_INDEX_LOOP) != U32(0))) + mustBeUnique = (libc.Bool32((inFlags & U32(IN_INDEX_LOOP)) != U32(0))) // If the RHS of this IN(...) operator is a SELECT, and if it matters // whether or not the SELECT result contains NULL values, check whether // or not NULL is actually possible (it may not be, for example, due // to NOT NULL constraints in the schema). If no NULL values are possible, // set prRhsHasNull to 0 before continuing. - if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) != 0) { + if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) != 0) { var i int32 var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { @@ -95396,8 +95396,8 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // then it is not worth creating an ephemeral table to evaluate // the IN operator so return IN_INDEX_NOOP. if (((eType == 0) && - ((inFlags & IN_INDEX_NOOP_OK) != 0)) && - !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0))) && + ((inFlags & U32(IN_INDEX_NOOP_OK)) != 0)) && + !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0))) && (!(sqlite3InRhsIsConstant(tls, pX) != 0) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FnExpr <= 2)) { eType = IN_INDEX_NOOP } @@ -95408,7 +95408,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var savedNQueryLoop U32 = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop var rMayHaveNull int32 = 0 eType = IN_INDEX_EPH - if (inFlags & IN_INDEX_LOOP) != 0 { + if (inFlags & U32(IN_INDEX_LOOP)) != 0 { (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0) } else if prRhsHasNull != 0 { *(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)) @@ -95443,7 +95443,7 @@ func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* s var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft) var pSelect uintptr - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) } else { pSelect = uintptr(0) @@ -95491,7 +95491,7 @@ func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpec // // "row value misused" func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102509:21: */ - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr, 1) } else { Xsqlite3ErrorMsg(tls, pParse, ts+5792 /* "row value misuse..." */, 0) @@ -95540,13 +95540,13 @@ func Xsqlite3CodeRhsOfIN(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 !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) && ((*Parse)(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 ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7064 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) } Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), @@ -95557,7 +95557,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) @@ -95575,7 +95575,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal) pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // Case 1: expr IN (SELECT ...) // // Generate code to write the results of the select into the temporary @@ -95630,9 +95630,9 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 var r2 int32 *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft) if int32(*(*int8)(unsafe.Pointer(bp + 64 /* affinity */))) <= SQLITE_AFF_NONE { - *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = int8(SQLITE_AFF_BLOB) } else if int32(*(*int8)(unsafe.Pointer(bp + 64 /* affinity */))) == SQLITE_AFF_REAL { - *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = SQLITE_AFF_NUMERIC + *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = int8(SQLITE_AFF_NUMERIC) } if pKeyInfo != 0 { @@ -95727,10 +95727,10 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // // 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 !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) { // If this routine has already been coded, then invoke it as a // subroutine. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7118 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */))) @@ -95738,7 +95738,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) @@ -95768,13 +95768,13 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 0, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nReg) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Mem + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Mem) (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSDParm (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FnSdst = nReg Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (((*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm + nReg) - 1)) } else { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Exists + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Exists) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm) } @@ -95784,7 +95784,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6739 /* "0" */) if pLimit != 0 { - (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = SQLITE_AFF_NUMERIC + (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = Xsqlite3PExpr(tls, pParse, TK_NE, Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) } @@ -95819,7 +95819,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // a sub-query, that the LHS is a vector of size 1. func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:102846:20: */ var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft) - if ((*Expr)(unsafe.Pointer(pIn)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pIn)).Fflags & U32(EP_xIsSelect)) != 0 { if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr, nVector) return 1 @@ -96242,7 +96242,7 @@ func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) if z != uintptr(0) { // var value float64 at bp, 8 - Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) // The new AtoF never returns NaN if negateFlag != 0 { *(*float64)(unsafe.Pointer(bp /* value */)) = -*(*float64)(unsafe.Pointer(bp /* value */)) @@ -96260,7 +96260,7 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM defer tls.Free(24) var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_IntValue)) != 0 { var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */)) if negFlag != 0 { @@ -96365,7 +96365,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_BUSY))) } return - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { x = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab), int16(iCol))) op = OP_Column @@ -96408,7 +96408,7 @@ func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103335:13: */ var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) (*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop - (*Expr)(unsafe.Pointer(p)).Fop = TK_REGISTER + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_REGISTER) (*Expr)(unsafe.Pointer(p)).FiTable = iReg *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Skip))) } @@ -96486,7 +96486,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI // var caseExpr Expr at bp, 72 libc.X__builtin___memset_chk(tls, bp /* &caseExpr */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp /* &caseExpr */, 0)) - (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = TK_CASE + (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = U8(TK_CASE) *(*uintptr)(unsafe.Pointer(bp /* &caseExpr */ + 32 /* &.x */)) = pFarg return Xsqlite3ExprCodeTarget(tls, pParse, bp /* &caseExpr */, target) @@ -96863,7 +96863,7 @@ __57: __5: iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { goto __62 } iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target) @@ -97055,7 +97055,7 @@ __79: r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44 /* ®Free2 */) codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, inReg, (SQLITE_STOREP2 | p5), - (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) __80: ; @@ -97099,7 +97099,7 @@ __81: return target goto __84 __83: - (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fop = TK_INTEGER + (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fop = U8(TK_INTEGER) (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fflags = (U32(EP_IntValue | EP_TokenOnly)) *(*int32)(unsafe.Pointer(bp + 48 /* &tempX */ + 8 /* &.u */)) = 0 @@ -97166,7 +97166,7 @@ __42: // The function name enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc // The text encoding used by this database pColl = uintptr(0) // A collating sequence - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __87 } return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FregResult @@ -97198,7 +97198,7 @@ __88: goto __3 __89: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INLINE) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INLINE)) != 0) { goto __90 } @@ -97227,7 +97227,7 @@ __93: constMask = constMask | (uint32((uint32(1))) << (i)) __96: ; - if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != U32(0)) && !(pColl != 0)) { + if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != U32(0)) && !(pColl != 0)) { goto __97 } pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*32)).FpExpr) @@ -97291,7 +97291,7 @@ __99: // function. The expression "A glob B" is equivalent to // "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 >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_InfixFunc)) != U32(0))) { + if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_InfixFunc))) != U32(0))) { goto __104 } pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*32)).FpExpr) @@ -97305,7 +97305,7 @@ __106: ; __105: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { goto __107 } if !(!(pColl != 0)) { @@ -97317,7 +97317,7 @@ __108: Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2) __107: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_OFFSET) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_OFFSET)) != 0) { goto __109 } pArg = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr @@ -97535,7 +97535,7 @@ __124: exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+40 /* ®Free1 */)) libc.X__builtin___memset_chk(tls, bp+120 /* &opCompare */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp+120 /* &opCompare */, 0)) - (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).Fop = TK_EQ + (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).Fop = U8(TK_EQ) (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).FpLeft = pDel pTest = bp + 120 /* &opCompare */ // Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001: @@ -97678,7 +97678,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r __3: } pExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) - if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_HasFunc)) != U32(0)) { + if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_HasFunc))) != U32(0)) { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var addr int32 @@ -97752,10 +97752,10 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target) if inReg != target { var op U8 - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subquery)) != U32(0) { - op = OP_Copy + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subquery))) != U32(0) { + op = U8(OP_Copy) } else { - op = OP_SCopy + op = U8(OP_SCopy) } Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target) } @@ -97810,9 +97810,9 @@ func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ var n int32 var copyOp U8 if (int32(flags) & SQLITE_ECEL_DUP) != 0 { - copyOp = OP_Copy + copyOp = uint8(OP_Copy) } else { - copyOp = OP_SCopy + copyOp = uint8(OP_SCopy) } var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -97905,13 +97905,13 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x pDel = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { - (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = TK_AND + (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = U8(TK_AND) (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpLeft = bp /* &compLeft */ (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpRight = bp + 72 /* &compRight */ - (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = TK_GE + (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = U8(TK_GE) (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr - (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = TK_LE + (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = U8(TK_LE) (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */) + 1*32)).FpExpr exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+216 /* ®Free1 */)) @@ -97923,7 +97923,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x // it into the Parse.pConstExpr list. We should use a new bit for this, // for clarity, but we are out of bits in the Expr.flags field so we // have to reuse the EP_FromJoin bit. Bummer. - *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (U32(EP_FromJoin)) Xsqlite3ExprCodeTarget(tls, pParse, bp+144 /* &exprAnd */, dest) } Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 216 /* regFree1 */))) @@ -98108,7 +98108,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -98142,13 +98142,13 @@ __19: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __28 } Xsqlite3VdbeGoto(tls, v, dest) goto __29 __28: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } // No-op @@ -98360,7 +98360,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -98394,13 +98394,13 @@ __29: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } Xsqlite3VdbeGoto(tls, v, dest) goto __31 __30: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __32 } // no-op @@ -98453,11 +98453,11 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint var pL uintptr *(*uintptr)(unsafe.Pointer(bp /* pR */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, SQLITE_UTF8, SQLITE_AFF_BLOB, bp /* &pR */) + Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp /* &pR */) if *(*uintptr)(unsafe.Pointer(bp /* pR */)) != 0 { iVar = int32((*Expr)(unsafe.Pointer(pVar)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iVar) - pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, SQLITE_AFF_BLOB) + pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, uint8(SQLITE_AFF_BLOB)) if pL != 0 { if Xsqlite3_value_type(tls, pL) == SQLITE_TEXT { Xsqlite3_value_text(tls, pL) // Make sure the encoding is UTF-8 @@ -98510,8 +98510,8 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 0 } combinedFlags = ((*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags) - if (combinedFlags & EP_IntValue) != 0 { - if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & EP_IntValue) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { + if (combinedFlags & U32(EP_IntValue)) != 0 { + if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & U32(EP_IntValue)) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { return 0 } return 2 @@ -98531,10 +98531,10 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 2 } - if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (EP_WinFunc)) != U32(0))) { + if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(EP_WinFunc))) != U32(0))) { return 2 } - if ((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0) { if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 64 /* &.y */)), *(*uintptr)(unsafe.Pointer(pB + 64 /* &.y */)), 1) != 0 { return 2 } @@ -98553,11 +98553,11 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, ((*Expr)(unsafe.Pointer(pB)).Fflags & (U32(EP_Distinct | EP_Commuted))) { return 2 } - if (combinedFlags & EP_TokenOnly) == U32(0) { - if (combinedFlags & EP_xIsSelect) != 0 { + if (combinedFlags & U32(EP_TokenOnly)) == U32(0) { + if (combinedFlags & U32(EP_xIsSelect)) != 0 { return 2 } - if ((combinedFlags & EP_FixedCol) == U32(0)) && + if ((combinedFlags & U32(EP_FixedCol)) == U32(0)) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0) { return 2 } @@ -98569,7 +98569,7 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE)) && - ((combinedFlags & EP_Reduced) == U32(0)) { + ((combinedFlags & U32(EP_Reduced)) == U32(0)) { if int32((*Expr)(unsafe.Pointer(pA)).FiColumn) != int32((*Expr)(unsafe.Pointer(pB)).FiColumn) { return 2 } @@ -98644,7 +98644,7 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i switch int32((*Expr)(unsafe.Pointer(p)).Fop) { case TK_IN: { - if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0)) { + if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return 0 } @@ -98785,7 +98785,7 @@ func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin // (never setting pWalker->eCode) is a harmless missed optimization. func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105186:12: */ - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return WRC_Prune } switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { @@ -99037,7 +99037,7 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnThis = 0 (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnOther = 0 Xsqlite3WalkExprList(tls, bp /* &w */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } return (libc.Bool32(((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnOther == 0))) @@ -99233,7 +99233,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // pAggInfo->aCol[] entry. (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiAgg = I16(k) goto __3 } // endif pExpr->iTable==pItem->iCursor @@ -99294,7 +99294,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* } return 0 }(), enc, uint8(0)) - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Distinct) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Distinct)) != 0 { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) } else { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1 @@ -99467,7 +99467,7 @@ func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sq defer tls.Free(8) if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7325 /* "sqlite_" */, 7)) || - ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && + ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0)) { Xsqlite3ErrorMsg(tls, pParse, ts+7333 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 @@ -99549,7 +99549,7 @@ __2: ; iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema) zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) // Get a NULL terminated version of the new table name. zName = Xsqlite3NameFromToken(tls, db, pName) @@ -99771,7 +99771,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if (pDflt != 0) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL) { pDflt = uintptr(0) } - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+8700 /* "Cannot add a REF..." */) } @@ -99785,7 +99785,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if pDflt != 0 { *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) = uintptr(0) var rc int32 - rc = Xsqlite3ValueFromExpr(tls, db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, bp+40 /* &pVal */) + rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+40 /* &pVal */) if rc != SQLITE_OK { @@ -99809,7 +99809,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr for (zEnd > zCol) && ((int32(*(*int8)(unsafe.Pointer(zEnd))) == ';') || ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))]) & 0x01) != 0)) { *(*int8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = int8(0) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) Xsqlite3NestedParse(tls, pParse, ts+8885, /* "UPDATE \"%w\".sqli..." */ @@ -100203,7 +100203,7 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return WRC_Abort } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if (*Select)(unsafe.Pointer(p)).FpEList != 0 { @@ -100245,7 +100245,7 @@ func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameUnmapSelectCb})) - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_UNMAP + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_UNMAP) Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr) (*Parse)(unsafe.Pointer(pParse)).FeParseMode = eMode } @@ -100307,7 +100307,7 @@ func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) // because without a dummy callback, sqlite3WalkExpr() and similar do not // descend into sub-select statements. func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106692:12: */ - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } renameWalkWith(tls, pWalker, p) @@ -100437,7 +100437,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint // occurs and the parse does not result in a new table, index or // trigger object, the database must be corrupt. libc.X__builtin___memset_chk(tls, p, 0, uint64(unsafe.Sizeof(Parse{})), libc.X__builtin_object_size(tls, p, 0)) - (*Parse)(unsafe.Pointer(p)).FeParseMode = PARSE_MODE_RENAME + (*Parse)(unsafe.Pointer(p)).FeParseMode = U8(PARSE_MODE_RENAME) (*Parse)(unsafe.Pointer(p)).Fdb = db (*Parse)(unsafe.Pointer(p)).FnQueryLoop = U32(1) rc = Xsqlite3RunParser(tls, p, zSql, bp /* &zErr */) @@ -101022,7 +101022,7 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 var i int32 var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if pSrc == uintptr(0) { @@ -101098,7 +101098,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr rc = renameParseSql(tls, bp+80 /* &sParse */, zDb, db, zInput, bTemp) if rc == SQLITE_OK { - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FpNewTable != 0 { var pTab uintptr = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).FpNewTable @@ -101120,7 +101120,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } } else { // Modify any FK definitions to point to the new table. - if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { var pFKey uintptr for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom { if Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { @@ -101212,7 +101212,7 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))) - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) @@ -101463,7 +101463,7 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh Xsqlite3NestedParse(tls, pParse, ts+9589 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols)) *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot) - *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = OPFLAG_P2ISREG + *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(OPFLAG_P2ISREG) } } else { // The table already exists. If zWhere is not NULL, delete all entries @@ -101728,7 +101728,7 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statInitFuncdef = FuncDef{ FnArg: int8(4), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 9740 /* "stat_init" */} /* sqlite3.c:108036:22 */ @@ -102046,7 +102046,7 @@ func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statPushFuncdef = FuncDef{ FnArg: (int8(2 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 9750 /* "stat_push" */} /* sqlite3.c:108326:22 */ @@ -102180,7 +102180,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli var statGetFuncdef = FuncDef{ FnArg: (int8(1 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 9777 /* "stat_get" */} /* sqlite3.c:108478:22 */ @@ -102282,7 +102282,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { needTableCnt = U8(0) } - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) zIdxName = (*Table)(unsafe.Pointer(pTab)).FzName nColTest = (nCol - 1) @@ -102409,7 +102409,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regTemp) *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, (regPrev + i), pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nColTest, regChng) @@ -102437,7 +102437,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // if !eof(csr) goto next_row; if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, regRowid) } else { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable) @@ -102484,7 +102484,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) // Add the entries to the stat4 table. if ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) { @@ -102497,10 +102497,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp var addrNext int32 var addrIsNull int32 var seekOp U8 - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - seekOp = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + seekOp = uint8(OP_NotExists) } else { - seekOp = OP_NotFound + seekOp = uint8(OP_NotFound) } (*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 { @@ -102545,7 +102545,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+9796 /* "BBB" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) Xsqlite3VdbeJumpHere(tls, v, jZeroRows) } @@ -102790,7 +102790,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.hasStat1 */, uint32(1), 7, 0x80) if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) { (*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst)) - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } } else { // var fakeIdx Index at bp, 152 @@ -102798,7 +102798,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow decodeIntArray(tls, z, 1, uintptr(0), (pTable + 74 /* &.nRowLogEst */), bp /* &fakeIdx */) (*Table)(unsafe.Pointer(pTable)).FszTabRow = (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } return 0 @@ -102885,7 +102885,7 @@ func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb) if pIdx == uintptr(0) { var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb) - if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab) } } @@ -102943,7 +102943,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui continue } - if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) } else { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) @@ -103178,7 +103178,7 @@ func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* s if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_ID { rc = Xsqlite3ResolveExprNames(tls, pName, pExpr) } else { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) } } return rc @@ -103358,7 +103358,7 @@ __17: __16: ; - *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= SQLITE_OPEN_MAIN_DB + *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= uint32(SQLITE_OPEN_MAIN_DB) rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), *(*uintptr)(unsafe.Pointer(bp + 40 /* zPath */)), db, (pNew + 8 /* &.pBt */), 0, int32(*(*uint32)(unsafe.Pointer(bp + 24 /* flags */)))) (*Sqlite3)(unsafe.Pointer(db)).FnDb++ (*Db)(unsafe.Pointer(pNew)).FzDbSName = Xsqlite3DbStrDup(tls, db, zName) @@ -103398,7 +103398,7 @@ __22: Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt, -1)) Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, - (uint32(PAGER_SYNCHRONOUS_FULL | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(uint64(PAGER_SYNCHRONOUS_FULL) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pNew)).FpBt) __20: ; @@ -103685,7 +103685,7 @@ func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3 var detach_func = FuncDef{ FnArg: int8(1), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 10258 /* "sqlite_detach" */} /* sqlite3.c:109893:24 */ @@ -103698,7 +103698,7 @@ func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var attach_func = FuncDef{ FnArg: int8(3), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 10272 /* "sqlite_attach" */} /* sqlite3.c:109913:24 */ @@ -103825,11 +103825,11 @@ func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqli for pExpr != 0 { if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE { if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else { Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+10332 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType)) return 1 @@ -103838,7 +103838,7 @@ func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqli if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { break } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { if Xsqlite3FixSelect(tls, pFix, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { return 1 } @@ -104078,7 +104078,7 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint } if SQLITE_IGNORE == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } @@ -104456,7 +104456,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // Read the database schema. If an error occurs, leave an error message // and code in pParse and return NULL. - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaKnownOk) == U32(0)) && + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaKnownOk)) == U32(0)) && (SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) { return uintptr(0) } @@ -104475,7 +104475,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr return (*Module)(unsafe.Pointer(pMod)).FpEpoTab } } - if (flags & LOCATE_NOERR) != 0 { + if (flags & U32(LOCATE_NOERR)) != 0 { return uintptr(0) } (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) @@ -104485,7 +104485,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr if p == uintptr(0) { var zMsg uintptr - if (flags & LOCATE_VIEW) != 0 { + if (flags & U32(LOCATE_VIEW)) != 0 { zMsg = ts + 10493 /* "no such view" */ } else { zMsg = ts + 10506 /* "no such table" */ @@ -104595,7 +104595,7 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName } Xsqlite3FreeIndex(tls, db, pIndex) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Look through the list of open database files in db->aDb[] and if @@ -104775,7 +104775,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) p = Xsqlite3HashInsert(tls, ((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */), zTabName, uintptr(0)) Xsqlite3DeleteTable(tls, db, p) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Given a token, return a string that consists of the text of that @@ -104804,7 +104804,7 @@ func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { / // writing. The table is opened using cursor 0. func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:111163:21: */ var v uintptr = Xsqlite3GetVdbe(tls, p) - Xsqlite3TableLock(tls, p, iDb, SCHEMA_ROOT, uint8(1), ts+5200 /* "sqlite_master" */) + Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+5200 /* "sqlite_master" */) Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, 0, SCHEMA_ROOT, iDb, 5) if (*Parse)(unsafe.Pointer(p)).FnTab == 0 { (*Parse)(unsafe.Pointer(p)).FnTab = 1 @@ -104904,7 +104904,7 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u // True if PRAGMA writable_schema is ON func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:111256:20: */ - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == SQLITE_WriteSchema)) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == uint64(SQLITE_WriteSchema))) } // This routine is used to check if the UTF-8 string zName is a legal @@ -104979,7 +104979,7 @@ func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* // // If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro. func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111348:20: */ - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) != 0 { var i int32 for i = 0; i <= int32(iCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0 { @@ -105029,7 +105029,7 @@ func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { / var i int32 var n I16 - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) == U32(0)) || (int32(iCol) < 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) == U32(0)) || (int32(iCol) < 0) { return iCol } i = 0 @@ -105274,7 +105274,7 @@ __21: Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT) Xsqlite3VdbeUsesBtree(tls, v, iDb) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_If, reg3) - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyFileFmt) != uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyFileFmt)) != uint64(0) { fileFormat = 1 } else { fileFormat = SQLITE_MAX_FILE_FORMAT @@ -105305,7 +105305,7 @@ __23: Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 0, reg1) Xsqlite3VdbeAddOp4(tls, v, OP_Blob, 6, reg3, 0, uintptr(unsafe.Pointer(&nullRow)), -1) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 0, reg3, reg1) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeAddOp0(tls, v, OP_Close) __20: ; @@ -105320,10 +105320,10 @@ begin_table_error: } var aCode = [4]U8{ - SQLITE_CREATE_TABLE, - SQLITE_CREATE_TEMP_TABLE, - SQLITE_CREATE_VIEW, - SQLITE_CREATE_TEMP_VIEW, + U8(SQLITE_CREATE_TABLE), + U8(SQLITE_CREATE_TEMP_TABLE), + U8(SQLITE_CREATE_VIEW), + U8(SQLITE_CREATE_TEMP_VIEW), } /* sqlite3.c:111477:21 */ var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:111565:23 */ @@ -105387,7 +105387,7 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp if (*Token)(unsafe.Pointer(pType)).Fn == uint32(0) { // If there is no type specified, columns have the default affinity // 'BLOB' with a default size of 4 bytes. - (*Column)(unsafe.Pointer(pCol)).Faffinity = SQLITE_AFF_BLOB + (*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB) (*Column)(unsafe.Pointer(pCol)).FszEst = U8(1) } else { zType = ((z + uintptr(Xsqlite3Strlen30(tls, z))) + uintptr(1)) @@ -105415,7 +105415,7 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit } pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32) (*Column)(unsafe.Pointer(pCol)).FnotNull = U8(onError) - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) // Set the uniqNotNull flag on any UNIQUE or PK indexes already created // on this column. @@ -105458,36 +105458,36 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sq defer tls.Free(4) var h U32 = U32(0) - var aff int8 = SQLITE_AFF_NUMERIC + var aff int8 = int8(SQLITE_AFF_NUMERIC) var zChar uintptr = uintptr(0) for *(*int8)(unsafe.Pointer(zIn)) != 0 { h = ((h << 8) + U32(Xsqlite3UpperToLower[((int32(*(*int8)(unsafe.Pointer(zIn))))&0xff)])) zIn++ if h == (U32((((int32('c') << 24) + (int32('h') << 16)) + (int32('a') << 8)) + 'r')) { // CHAR - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) zChar = zIn } else if h == (U32((((int32('c') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b')) { // CLOB - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if h == (U32((((int32('t') << 24) + (int32('e') << 16)) + (int32('x') << 8)) + 't')) { // TEXT - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if (h == (U32((((int32('b') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b'))) && // BLOB ((int32(aff) == SQLITE_AFF_NUMERIC) || (int32(aff) == SQLITE_AFF_REAL)) { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) if int32(*(*int8)(unsafe.Pointer(zIn))) == '(' { zChar = zIn } } else if (h == (U32((((int32('r') << 24) + (int32('e') << 16)) + (int32('a') << 8)) + 'l'))) && // REAL (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('f') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'a'))) && // FLOA (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('d') << 24) + (int32('o') << 16)) + (int32('u') << 8)) + 'b'))) && // DOUB (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h & U32(0x00FFFFFF)) == (U32(((int32('i') << 16) + (int32('n') << 8)) + 't')) { // INT - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) break } } @@ -105551,10 +105551,10 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt) libc.X__builtin___memset_chk(tls, bp+8 /* &x */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp+8 /* &x */, 0)) - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = TK_SPAN + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = U8(TK_SPAN) *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).FpLeft = pExpr - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = U32(EP_Skip) (*Column)(unsafe.Pointer(pCol)).FpDflt = Xsqlite3ExprDup(tls, db, bp+8 /* &x */, EXPRDUP_REDUCE) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */))) } @@ -105581,9 +105581,9 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar // unchanged. func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:111898:13: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_STRING { - (*Expr)(unsafe.Pointer(p)).Fop = TK_ID + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_ID) } else if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING) { - (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = TK_ID + (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = U8(TK_ID) } } @@ -105634,7 +105634,7 @@ func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit __1: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasPrimaryKey) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasPrimaryKey)) != 0) { goto __2 } Xsqlite3ErrorMsg(tls, pParse, @@ -105642,7 +105642,7 @@ __1: goto primary_key_exit __2: ; - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasPrimaryKey) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasPrimaryKey)) if !(pList == uintptr(0)) { goto __3 } @@ -105730,7 +105730,7 @@ __13: goto __18 __17: Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), - uintptr(0), sortOrder, 0, SQLITE_IDXTYPE_PRIMARYKEY) + uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) __18: ; @@ -105803,7 +105803,7 @@ func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui var eType U8 var pTab uintptr var pCol uintptr - eType = COLFLAG_VIRTUAL + eType = U8(COLFLAG_VIRTUAL) pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable if !(pTab == uintptr(0)) { goto __1 @@ -105838,7 +105838,7 @@ __5: if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+11042 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) { goto __7 } - eType = COLFLAG_STORED + eType = U8(COLFLAG_STORED) goto __8 __7: goto generated_error @@ -106257,10 +106257,10 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / if !((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { - (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = OE_Abort + (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = U8(OE_Abort) } } - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) } // Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY @@ -106289,7 +106289,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*Table)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_PRIMARYKEY) + uint8(SQLITE_IDXTYPE_PRIMARYKEY)) if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { return } @@ -106326,7 +106326,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / // a database schema). if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0)) { - Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), OP_Goto) + Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto)) } // The root page of the PRIMARY KEY is the table root page @@ -106486,7 +106486,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } if (pSelect == uintptr(0)) && (Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Shadow) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Shadow)) } // If the db->init.busy is 1 it means we are reading the SQL off the @@ -106504,18 +106504,18 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } (*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Readonly) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Readonly)) } } // Special processing for WITHOUT ROWID Tables if (int32(tabOpts) & TF_WithoutRowid) != 0 { - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3ErrorMsg(tls, pParse, ts+11130 /* "AUTOINCREMENT no..." */, 0) return } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasPrimaryKey) == U32(0) { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasPrimaryKey)) == U32(0) { Xsqlite3ErrorMsg(tls, pParse, ts+11180 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) return } @@ -106536,13 +106536,13 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasGenerated) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasGenerated)) != 0 { var ii int32 var nNG int32 = 0 for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ { var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FcolFlags) - if (colFlags & COLFLAG_GENERATED) != U32(0) { + if (colFlags & U32(COLFLAG_GENERATED)) != U32(0) { var pX uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FpDflt if Xsqlite3ResolveSelfReference(tls, pParse, p, NC_GenCol, pX, uintptr(0)) != 0 { @@ -106629,14 +106629,14 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr Xsqlite3MayAbort(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_P2ISREG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) (*Parse)(unsafe.Pointer(pParse)).FnTab = 2 addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, SQLITE_AFF_BLOB) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, int8(SQLITE_AFF_BLOB)) if pSelTab == uintptr(0) { return } @@ -106700,7 +106700,7 @@ func Xsqlite3EndTable(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 ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != U32(0) { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != U32(0) { var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { @@ -106727,7 +106727,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr return } (*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) if !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) { var zName uintptr = (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz @@ -106790,7 +106790,7 @@ __3: // This will force all the Expr.token.z values to be dynamically // allocated rather than point to the input string - which means that // they will persist after the current sqlite3_exec() call returns. - *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (SF_View) + *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (U32(SF_View)) if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { goto __4 } @@ -106909,7 +106909,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i pSel = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSelect, 0) if pSel != 0 { var eParseMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_NORMAL) n = (*Parse)(unsafe.Pointer(pParse)).FnTab Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpSrc) (*Table)(unsafe.Pointer(pTable)).FnCol = int16(-1) @@ -106917,7 +106917,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, SQLITE_AFF_NONE) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, int8(SQLITE_AFF_NONE)) (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth (*Parse)(unsafe.Pointer(pParse)).FnTab = n if pSelTab == uintptr(0) { @@ -106935,7 +106935,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0)) && (int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr) { Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTable, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } else { // CREATE VIEW name AS... without an argument list. Construct @@ -107155,7 +107155,7 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // the table being dropped. This is done before the table is dropped // at the btree level, in case the sqlite_sequence table needs to // move as a result of the drop (can happen in auto-vacuum mode). - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3NestedParse(tls, pParse, ts+11618, /* "DELETE FROM %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName)) @@ -107189,7 +107189,7 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // Return TRUE if shadow tables should be read-only in the current // context. func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:113409:20: */ - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0)) && + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0))) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) { return 1 @@ -107208,7 +107208,7 @@ func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sq } return 1 } - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { return 1 } return 0 @@ -107740,7 +107740,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iIdx) } Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iIdx, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, regRecord) Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iSorter, addr2) Xsqlite3VdbeJumpHere(tls, v, addr1) @@ -107974,7 +107974,7 @@ __11: goto exit_create_index __12: ; - if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __13 } pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -108591,10 +108591,10 @@ __100: goto exit_create_index __102: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) goto __99 __98: - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || (pTblName != uintptr(0))) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || (pTblName != uintptr(0))) { goto __103 } iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -109057,8 +109057,8 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra libc.VaList(bp, SQLITE_MAX_SRCLIST)) return uintptr(0) } - if nAlloc > SQLITE_MAX_SRCLIST { - nAlloc = SQLITE_MAX_SRCLIST + if nAlloc > int64(SQLITE_MAX_SRCLIST) { + nAlloc = int64(SQLITE_MAX_SRCLIST) } pNew = Xsqlite3DbRealloc(tls, db, pSrc, (uint64(unsafe.Sizeof(SrcList{})) + ((uint64(nAlloc - int64(1))) * uint64(unsafe.Sizeof(SrcList_item{}))))) @@ -109618,7 +109618,7 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx } return (SQLITE_CONSTRAINT | (int32(8) << 8)) }(), - onError, zErr, int8(-7), P5_ConstraintUnique) + onError, zErr, int8(-7), uint8(P5_ConstraintUnique)) } // Code an OP_Halt due to non-unique rowid. @@ -109637,7 +109637,7 @@ func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab rc = (SQLITE_CONSTRAINT | (int32(10) << 8)) } Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-7), - P5_ConstraintUnique) + uint8(P5_ConstraintUnique)) } // Check to see if pIndex uses the collating sequence pColl. Return @@ -109920,8 +109920,8 @@ func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sq if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 != 0 { var zExternal uintptr var pTmp uintptr = Xsqlite3ValueNew(tls, db) - Xsqlite3ValueSetStr(tls, pTmp, -1, zName, SQLITE_UTF8, uintptr(0)) - zExternal = Xsqlite3ValueText(tls, pTmp, SQLITE_UTF16LE) + Xsqlite3ValueSetStr(tls, pTmp, -1, zName, uint8(SQLITE_UTF8), uintptr(0)) + zExternal = Xsqlite3ValueText(tls, pTmp, uint8(SQLITE_UTF16LE)) if zExternal != 0 { (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal) } @@ -109949,7 +109949,7 @@ func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c return SQLITE_ERROR } -var aEnc = [3]U8{SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8} /* sqlite3.c:115598:19 */ +var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sqlite3.c:115598:19 */ // This routine is called on a collation sequence before it is used to // check that it is defined. An undefined collation sequence exists when @@ -109994,11 +109994,11 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui if pColl != 0 { var pDel uintptr = uintptr(0) (*CollSeq)(unsafe.Pointer(pColl)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl)).Fenc = SQLITE_UTF8 + (*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(SQLITE_UTF8) (*CollSeq)(unsafe.Pointer(pColl + 1*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = SQLITE_UTF16LE + (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = U8(SQLITE_UTF16LE) (*CollSeq)(unsafe.Pointer(pColl + 2*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = SQLITE_UTF16BE + (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = U8(SQLITE_UTF16BE) libc.X__builtin___memcpy_chk(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zName, uint64(nName), libc.X__builtin_object_size(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, 0)) pDel = Xsqlite3HashInsert(tls, (db + 600 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl) @@ -110177,7 +110177,7 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit } // Bonus points if the text encoding matches - if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) { + if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) { match = match + (2) // Exact encoding match } else if ((U32(enc) & (*FuncDef)(unsafe.Pointer(p)).FfuncFlags) & U32(2)) != U32(0) { match = match + (1) // Both are UTF16, but with different byte orders @@ -110268,7 +110268,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, // have fields overwritten with new information appropriate for the // new function. But the FuncDefs for built-in functions are read-only. // So we must not search for built-ins when creating a new function. - if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_PreferBuiltin) != U32(0))) { + if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_PreferBuiltin)) != U32(0))) { bestScore = 0 h = (((int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(zName)))])) + (nName)) % SQLITE_FUNC_HASH_SZ) p = Xsqlite3FunctionSearch(tls, h, zName) @@ -110366,7 +110366,7 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli Xsqlite3HashInit(tls, (p + 32 /* &.idxHash */)) Xsqlite3HashInit(tls, (p + 56 /* &.trigHash */)) Xsqlite3HashInit(tls, (p + 80 /* &.fkeyHash */)) - (*Schema)(unsafe.Pointer(p)).Fenc = SQLITE_UTF8 + (*Schema)(unsafe.Pointer(p)).Fenc = U8(SQLITE_UTF8) } return p } @@ -110438,7 +110438,7 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit return 0 } db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Readonly) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Readonly)) != U32(0) { return (libc.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0))) } @@ -110485,7 +110485,7 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher } pSel = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy, - SF_IncludeHidden, pLimit) + uint32(SF_IncludeHidden), pLimit) Xsqlite3SelectDestInit(tls, bp /* &dest */, SRT_EphemTab, iCur) Xsqlite3Select(tls, pParse, pSel, bp /* &dest */) Xsqlite3SelectDelete(tls, db, pSel) @@ -110712,7 +110712,7 @@ __14: } Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __17 } Xsqlite3VdbeAddOp4(tls, v, OP_Clear, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 { @@ -110754,7 +110754,7 @@ __21: } return WHERE_ONEPASS_MULTIROW }())) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __22 } // For a rowid table, initialize the RowSet to an empty set @@ -110918,7 +110918,7 @@ __41: __43: ; - Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, OPFLAG_FORDELETE, + Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(OPFLAG_FORDELETE), iTabCur, aToOpen, bp+80 /* &iDataCur */, bp+84 /* &iIdxCur */) if !(eOnePass == ONEPASS_MULTI) { @@ -110990,13 +110990,13 @@ __55: __54: ; Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, 1, iKey, pVTab, -12) - Xsqlite3VdbeChangeP5(tls, v, OE_Abort) + Xsqlite3VdbeChangeP5(tls, v, uint16(OE_Abort)) goto __53 __52: count = (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 84 /* iIdxCur */)), - iKey, nKey, uint8(count), OE_Default, uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) + iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) __53: ; @@ -111109,10 +111109,10 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri // (this can happen if a trigger program has already deleted it), do // not attempt to delete it or fire any DELETE triggers. iLabel = Xsqlite3VdbeMakeLabel(tls, pParse) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - opSeek = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + opSeek = uint8(OP_NotExists) } else { - opSeek = OP_NotFound + opSeek = uint8(OP_NotFound) } if int32(eMode) == ONEPASS_OFF { Xsqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) @@ -111191,7 +111191,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri Xsqlite3VdbeAppendP4(tls, v, pTab, -6) } if int32(eMode) != ONEPASS_OFF { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_AUXDELETE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE)) } if (iIdxNoSeek >= 0) && (iIdxNoSeek != iDataCur) { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iIdxNoSeek) @@ -111248,7 +111248,7 @@ func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, var pPk uintptr // PRIMARY KEY index, or NULL for rowid tables v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -111365,7 +111365,7 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData // But we are getting ready to store this value back into an index, where // it should be converted by to INTEGER again. So omit the OP_RealAffinity // opcode if it is present - Xsqlite3VdbeDeletePriorOpcode(tls, v, OP_RealAffinity) + Xsqlite3VdbeDeletePriorOpcode(tls, v, uint8(OP_RealAffinity)) } if regOut != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regOut) @@ -111705,7 +111705,7 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnUsed = 0 (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FapArg = (argv + uintptr(1)*8) Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = SQLITE_PRINTF_SQLFUNC + (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = U8(SQLITE_PRINTF_SQLFUNC) Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, libc.VaList(bp, bp+40 /* &x */)) n = int32((*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FnChar) Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp+8 /* &str */), n, @@ -111818,7 +111818,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } Xsqlite3_result_text64(tls, context, z, (uint64((int64(z2) - int64(z)) / 1)), libc.UintptrFromInt32(-1), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) } else { if (p1 + p2) > I64(len) { p2 = (I64(len) - p1) @@ -111874,7 +111874,7 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq Xsqlite3_result_error_nomem(tls, context) return } - Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), SQLITE_UTF8) + Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), uint8(SQLITE_UTF8)) Xsqlite3_free(tls, zBuf) } Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 16 /* r */))) @@ -112454,7 +112454,7 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq r1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+4295 /* "%!.15g" */, libc.VaList(bp, r1)) - Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, SQLITE_UTF8) + Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp + 72 /* r2 */)) { Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+13176 /* "%!.20e" */, libc.VaList(bp+8, r1)) } @@ -112586,7 +112586,7 @@ func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F)))))) } } - Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), SQLITE_UTF8) + Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8)) } // The hex() function. Interpret the argument as a blob. Return @@ -112914,7 +112914,7 @@ func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // Disallow the load_extension() SQL function unless the SQLITE_LoadExtFunc // flag is set. See the sqlite3_enable_load_extension() API. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtFunc) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtFunc)) == uint64(0) { Xsqlite3_result_error(tls, context, ts+10418 /* "not authorized" */, -1) return } @@ -113261,8 +113261,8 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 Xsqlite3CreateFunc(tls, db, ts+13196 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13196 /* "like" */, 2, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13196 /* "like" */, 3, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13196 /* "like" */, 2, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13196 /* "like" */, 3, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) } // pExpr points to an expression which implements a function. If @@ -113288,8 +113288,8 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase } nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FnExpr - pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, SQLITE_UTF8, uint8(0)) - if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_LIKE) == U32(0)) { + pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, uint8(SQLITE_UTF8), uint8(0)) + if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_LIKE)) == U32(0)) { return 0 } @@ -113319,7 +113319,7 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase *(*int8)(unsafe.Pointer(aWc + 3)) = *(*int8)(unsafe.Pointer(zEscape)) } - *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CASE) == U32(0))) + *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CASE)) == U32(0))) return 1 } @@ -113338,18 +113338,18 @@ func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: * var aBuiltinFunc = [65]FuncDef{ //**** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS **** - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_implies_nonnull_row), FxSFunc: 0, FzName: ts + 13201 /* "implies_nonnull_..." */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_compare), FxSFunc: 0, FzName: ts + 13221 /* "expr_compare" */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_implies_expr), FxSFunc: 0, FzName: ts + 13234 /* "expr_implies_exp..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_implies_nonnull_row)), FxSFunc: 0, FzName: ts + 13201 /* "implies_nonnull_..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_compare)), FxSFunc: 0, FzName: ts + 13221 /* "expr_compare" */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_implies_expr)), FxSFunc: 0, FzName: ts + 13234 /* "expr_implies_exp..." */}, //**** Regular functions **** {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13252 /* "soundex" */}, {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 13260 /* "load_extension" */}, {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 13260 /* "load_extension" */}, {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13275 /* "sqlite_compileop..." */}, {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13301 /* "sqlite_compileop..." */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 13326 /* "unlikely" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 13335 /* "likelihood" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 13346 /* "likely" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 13326 /* "unlikely" */}, + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 13335 /* "likelihood" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 13346 /* "likely" */}, {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 13353 /* "sqlite_offset" */}, {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 13367 /* "ltrim" */}, {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 13367 /* "ltrim" */}, @@ -113404,7 +113404,7 @@ var aBuiltinFunc = [65]FuncDef{ {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13641 /* "coalesce" */}, {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13641 /* "coalesce" */}, {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 13641 /* "coalesce" */}, - {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_iif), FxSFunc: 0, FzName: ts + 13650 /* "iif" */}} /* sqlite3.c:118975:18 */ + {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_iif)), FxSFunc: 0, FzName: ts + 13650 /* "iif" */}} /* sqlite3.c:118975:18 */ //************* End of func.c *********************************************** //************* Begin file fkey.c ******************************************* @@ -113769,7 +113769,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // increment the constraint-counter. if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr == 1) { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regData, iOk, regTemp) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenRead) @@ -113814,7 +113814,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx iParent = regData } Xsqlite3VdbeAddOp3(tls, v, OP_Ne, iChild, iJump, iParent) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_JUMPIFNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_JUMPIFNULL)) } Xsqlite3VdbeGoto(tls, v, iOk) } @@ -113828,7 +113828,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx } } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Special case: If this is an INSERT statement that will insert exactly @@ -113837,7 +113837,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // generated for will not open a statement transaction. Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } else { if (nIncr > 0) && (int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0) { Xsqlite3MayAbort(tls, pParse) @@ -113874,7 +113874,7 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3 pExpr = Xsqlite3ExprAddCollateString(tls, pParse, pExpr, zColl) } else { (*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) } } return pExpr @@ -113989,7 +113989,7 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p var pNe uintptr // Expression (pLeft != pRight) var pLeft uintptr // Value from parent table row var pRight uintptr // Column ref to child table - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pLeft = exprTableRegister(tls, pParse, pTab, regData, int16(-1)) pRight = exprTableColumn(tls, db, pTab, (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1)) pNe = Xsqlite3PExpr(tls, pParse, TK_NE, pLeft, pRight) @@ -114084,7 +114084,7 @@ func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119 // DELETE, but foreign key actions are not. func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:119820:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { var iSkip int32 = 0 var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -114098,7 +114098,7 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // when this statement is run. var p uintptr for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { - if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { break } } @@ -114121,12 +114121,12 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // If the SQLITE_DeferFKs flag is set, then this is not required, as // the statement transaction will not be rolled back even if FK // constraints are violated. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) == uint64(0) { Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2)) Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } if iSkip != 0 { @@ -114241,7 +114241,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, // Exactly one of regOld and regNew should be non-zero. // If foreign-keys are disabled, this function is a no-op. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) == uint64(0) { return } @@ -114366,7 +114366,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, continue } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Inserting a single row into a parent table cannot cause (or fix) @@ -114432,7 +114432,7 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql defer tls.Free(8) var mask U32 = U32(0) - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var p uintptr var i int32 for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { @@ -114486,7 +114486,7 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql // Or, assuming some other foreign key processing is required, 1. func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:120222:20: */ var eRet int32 = 0 - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { 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 @@ -114558,7 +114558,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, var iAction int32 = (libc.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE action = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr(iAction)))) - if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { return uintptr(0) } pTrigger = *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) @@ -114671,7 +114671,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, (*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fn = uint32(nFrom) pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+4511 /* "FOREIGN KEY cons..." */) if pRaise != 0 { - (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = OE_Abort + (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) } pSelect = Xsqlite3SelectNew(tls, pParse, Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRaise), @@ -114721,17 +114721,17 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, switch action { case OE_Restrict: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_SELECT) break fallthrough case OE_Cascade: if !(pChanges != 0) { - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_DELETE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_DELETE) break } fallthrough default: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_UPDATE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_UPDATE) } (*TriggerStep)(unsafe.Pointer(pStep)).FpTrig = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema @@ -114739,9 +114739,9 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).Fop = func() uint8 { if pChanges != 0 { - return TK_UPDATE + return uint8(TK_UPDATE) } - return TK_DELETE + return uint8(TK_DELETE) }() } @@ -114755,7 +114755,7 @@ func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uin // refer to table pTab. If there is an action associated with the FK // for this operation (either update or delete), invoke the associated // trigger sub-program. - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var pFKey uintptr // Iterator variable for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo { if (aChange == uintptr(0)) || (fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0) { @@ -114843,7 +114843,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa } return uint8(0) }(), (*Table)(unsafe.Pointer(pTab)).FzName) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol)) } else { @@ -114895,16 +114895,16 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { if int32(x) >= 0 { aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*32)).Faffinity } else if int32(x) == (-1) { - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) } else { aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(n)*32)).FpExpr) } if int32(aff) < SQLITE_AFF_BLOB { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } if int32(aff) > SQLITE_AFF_NUMERIC { - aff = SQLITE_AFF_NUMERIC + aff = int8(SQLITE_AFF_NUMERIC) } *(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = aff } @@ -115033,7 +115033,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in // Before computing generated columns, first go through and make sure // that appropriate affinity has been applied to the regular columns Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasStored) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStored)) != U32(0)) && (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == OP_Affinity) { // Change the OP_Affinity argument to '@' (NONE) for all stored // columns. '@' is the no-op affinity and those columns have not @@ -115047,7 +115047,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in continue } if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*32)).FcolFlags) & COLFLAG_STORED) != 0 { - *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = SQLITE_AFF_NONE + *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = int8(SQLITE_AFF_NONE) } jj++ } @@ -115128,8 +115128,8 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120894:12: */ var memId int32 = 0 // Register holding maximum rowid - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)) && + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) { var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -115143,7 +115143,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 // rowid table with exactly two columns. // Ticket d8dc2b3a58cd5dc2918a1d4acb 2018-05-23 if (((pSeqTab == uintptr(0)) || - !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Table)(unsafe.Pointer(pSeqTab)).FnModuleArg != 0)) || (int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2) { (*Parse)(unsafe.Pointer(pParse)).FnErr++ @@ -115202,7 +115202,7 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 (*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp1 = (memId - 1) (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp3 = memId - (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = SQLITE_JUMPIFNULL + (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = U16(SQLITE_JUMPIFNULL) (*VdbeOp)(unsafe.Pointer(aOp + 4*24)).Fp2 = (memId + 1) (*VdbeOp)(unsafe.Pointer(aOp + 5*24)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 6*24)).Fp1 = memId @@ -115217,18 +115217,18 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 var iLn1 int32 = 0 /* sqlite3.c:120957:22 */ var autoInc = [12]VdbeOpList{ - /* 0 */ {Fopcode: OP_Null}, - /* 1 */ {Fopcode: OP_Rewind, Fp2: int8(10)}, - /* 2 */ {Fopcode: OP_Column}, - /* 3 */ {Fopcode: OP_Ne, Fp2: int8(9)}, - /* 4 */ {Fopcode: OP_Rowid}, - /* 5 */ {Fopcode: OP_Column, Fp2: int8(1)}, - /* 6 */ {Fopcode: OP_AddImm}, - /* 7 */ {Fopcode: OP_Copy}, - /* 8 */ {Fopcode: OP_Goto, Fp2: int8(11)}, - /* 9 */ {Fopcode: OP_Next, Fp2: int8(2)}, - /* 10 */ {Fopcode: OP_Integer}, - /* 11 */ {Fopcode: OP_Close}, + /* 0 */ {Fopcode: U8(OP_Null)}, + /* 1 */ {Fopcode: U8(OP_Rewind), Fp2: int8(10)}, + /* 2 */ {Fopcode: U8(OP_Column)}, + /* 3 */ {Fopcode: U8(OP_Ne), Fp2: int8(9)}, + /* 4 */ {Fopcode: U8(OP_Rowid)}, + /* 5 */ {Fopcode: U8(OP_Column), Fp2: int8(1)}, + /* 6 */ {Fopcode: U8(OP_AddImm)}, + /* 7 */ {Fopcode: U8(OP_Copy)}, + /* 8 */ {Fopcode: U8(OP_Goto), Fp2: int8(11)}, + /* 9 */ {Fopcode: U8(OP_Next), Fp2: int8(2)}, + /* 10 */ {Fopcode: U8(OP_Integer)}, + /* 11 */ {Fopcode: U8(OP_Close)}, } /* sqlite3.c:120958:29 */ // Update the maximum rowid for an autoincrement calculation. @@ -115274,18 +115274,18 @@ func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: * (*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp3 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp2 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp3 = (memId + 1) - (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = OPFLAG_APPEND + (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = U16(OPFLAG_APPEND) Xsqlite3ReleaseTempReg(tls, pParse, iRec) } } var iLn2 int32 = 0 /* sqlite3.c:121024:22 */ var autoIncEnd = [5]VdbeOpList{ - /* 0 */ {Fopcode: OP_NotNull, Fp2: int8(2)}, - /* 1 */ {Fopcode: OP_NewRowid}, - /* 2 */ {Fopcode: OP_MakeRecord, Fp2: int8(2)}, - /* 3 */ {Fopcode: OP_Insert}, - /* 4 */ {Fopcode: OP_Close}, + /* 0 */ {Fopcode: U8(OP_NotNull), Fp2: int8(2)}, + /* 1 */ {Fopcode: U8(OP_NewRowid)}, + /* 2 */ {Fopcode: U8(OP_MakeRecord), Fp2: int8(2)}, + /* 3 */ {Fopcode: U8(OP_Insert)}, + /* 4 */ {Fopcode: U8(OP_Close)}, } /* sqlite3.c:121025:29 */ func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121054:21: */ @@ -115492,7 +115492,7 @@ __1: // 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 // and discard the other (unused) parts of the pSelect object - if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Values) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { + if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Values)) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { goto __2 } pList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -115520,7 +115520,7 @@ __3: goto insert_cleanup __4: ; - withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) + withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) // Figure out if we have any triggers and if the table being // inserted into is a view @@ -115797,7 +115797,7 @@ __29: goto __36 } ipkColumn = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) - if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0))) { + if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0))) { goto __37 } @@ -116012,11 +116012,11 @@ __63: goto __64 __66: ; - if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & COLFLAG_NOINSERT) != U32(0)) { + if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & U32(COLFLAG_NOINSERT)) != U32(0)) { goto __67 } nHidden++ - if !((colFlags & COLFLAG_VIRTUAL) != U32(0)) { + if !((colFlags & U32(COLFLAG_VIRTUAL)) != U32(0)) { goto __68 } // Virtual columns do not participate in OP_MakeRecord. So back up @@ -116026,7 +116026,7 @@ __66: goto __64 goto __69 __68: - if !((colFlags & COLFLAG_STORED) != U32(0)) { + if !((colFlags & U32(COLFLAG_STORED)) != U32(0)) { goto __70 } // Stored columns are computed later. But if there are BEFORE @@ -116176,7 +116176,7 @@ __89: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // refers to the ROWID. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __92 } @@ -116284,7 +116284,7 @@ __97: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // is derived from the INTEGER PRIMARY KEY. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __109 } Xsqlite3ComputeGeneratedColumns(tls, pParse, (regRowid + 1), pTab) @@ -116301,7 +116301,7 @@ __109: Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 2), regIns, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) @@ -116587,7 +116587,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // normal rowid tables. nPkField is the number of key fields in the // pPk index or 1 for a rowid table. In other words, nPkField is the // number of fields in the true primary key of the table. - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) nPkField = 1 } else { @@ -116598,7 +116598,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // Record that this module has started // Test all NOT NULL constraints. - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasNotNull) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasNotNull)) != 0 { var b2ndPass int32 = 0 // True if currently running 2nd pass var nSeenReplace int32 = 0 // Number of ON CONFLICT REPLACE operations var nGenerated int32 = 0 // Number of generated columns with NOT NULL @@ -116665,7 +116665,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, (SQLITE_CONSTRAINT | (int32(5) << 8)), onError, iReg) Xsqlite3VdbeAppendP4(tls, v, zMsg, -7) - Xsqlite3VdbeChangeP5(tls, v, P5_ConstraintNotNull) + Xsqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull)) break @@ -116691,7 +116691,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt break } // Never need more than 2 passes b2ndPass = 1 - if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) { + if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) { // If any NOT NULL ON CONFLICT REPLACE constraints fired on the // first pass, recomputed values for all generated columns, as // those values might depend on columns affected by the REPLACE. @@ -116701,7 +116701,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } // end if( has-not-null-constraints ) // Test all CHECK constraints - if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0)) { var pCheck uintptr = (*Table)(unsafe.Pointer(pTab)).FpCheck (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) if int32(overrideError) != OE_Default { @@ -116741,8 +116741,8 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt onError = OE_Abort } // IMP: R-26383-51744 Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(1) << 8)), - onError, zName, P4_TRANSIENT, - P5_ConstraintCheck) + onError, zName, int8(P4_TRANSIENT), + uint8(P5_ConstraintCheck)) } Xsqlite3VdbeResolveLabel(tls, v, allOk) } @@ -116782,7 +116782,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // An ON CONFLICT DO NOTHING clause, without a constraint-target. // Make all unique constraint resolution be OE_Ignore - overrideError = OE_Ignore + overrideError = U8(OE_Ignore) pUpsert = uintptr(0) } else if (libc.AssignUintptr(&pUpIdx, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx)) != uintptr(0) { // If the constraint-target uniqueness check must be run first. @@ -116817,7 +116817,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt pTrigger = uintptr(0) regTrigCnt = 0 } else { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_RecTriggers) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_RecTriggers)) != 0 { pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0)) regTrigCnt = (libc.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0))) } else { @@ -116873,7 +116873,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // it might have changed. Skip the conflict logic below if the rowid // is unchanged. Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRowidOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } @@ -116927,7 +116927,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if regTrigCnt != 0 { Xsqlite3MultiWrite(tls, pParse) Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regNewData, int16(1), uint8(0), OE_Replace, uint8(1), -1) + regNewData, int16(1), uint8(0), uint8(OE_Replace), uint8(1), -1) Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1) // incr trigger cnt nReplaceTrig++ } else { @@ -117092,13 +117092,13 @@ __1: regR = Xsqlite3GetTempRange(tls, pParse, nPkField) } if (isUpdate != 0) || (onError == OE_Replace) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iThisCur, regR) // Conflict only if the rowid of the existing index entry // is different from old-rowid if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regR, addrUniqueOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } else { @@ -117141,7 +117141,7 @@ __1: x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x))) Xsqlite3VdbeAddOp4(tls, v, op, ((regOldData + 1) + x), addrJump, (regCmp + i), p4, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } @@ -117189,12 +117189,12 @@ __1: Xsqlite3VdbeAddOp1(tls, v, OP_CursorLock, iDataCur) } Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regR, int16(nPkField), uint8(0), OE_Replace, + regR, int16(nPkField), uint8(0), uint8(OE_Replace), func() uint8 { if pIdx == pPk { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_OFF + return uint8(ONEPASS_OFF) }(), iThisCur) if (pTrigger != 0) && (isUpdate != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_CursorUnlock, iDataCur) @@ -117291,7 +117291,7 @@ __3: if !(pPk != 0) { if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRecheck, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRecheck, regNewData) @@ -117304,7 +117304,7 @@ __3: } // Generate the table record - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regNewData + 1), int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec) @@ -117351,11 +117351,11 @@ __1: } pik_flags = func() uint8 { if useSeekResult != 0 { - return OPFLAG_USESEEKRESULT + return uint8(OPFLAG_USESEEKRESULT) } return uint8(0) }() - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pik_flags = U8(int32(pik_flags) | (OPFLAG_NCHANGE)) pik_flags = U8(int32(pik_flags) | (update_flags & OPFLAG_SAVEPOSITION)) @@ -117364,7 +117364,7 @@ __1: Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r) Xsqlite3VdbeAddOp4(tls, v, OP_Insert, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), r, pTab, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_ISNOOP) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_ISNOOP)) Xsqlite3ReleaseTempReg(tls, pParse, r) } } @@ -117387,13 +117387,13 @@ __2: goto __3 __3: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { return } if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 { pik_flags = U8(0) } else { - pik_flags = OPFLAG_NCHANGE + pik_flags = U8(OPFLAG_NCHANGE) pik_flags = U8(int32(pik_flags) | (func() int32 { if update_flags != 0 { return update_flags @@ -117456,7 +117456,7 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iDataCur } - if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { + if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op) } else { Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(libc.Bool32(op == OP_OpenWrite))), (*Table)(unsafe.Pointer(pTab)).FzName) @@ -117473,7 +117473,7 @@ __1: { var iIdxCur int32 = libc.PostIncInt32(&iBase, 1) - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur } @@ -117636,7 +117636,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint if (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 { return 0 // SELECT may not be a compound query } - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Distinct)) != 0 { return 0 // SELECT may not be DISTINCT } pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -117661,7 +117661,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // Possible due to bad sqlite_schema.rootpage return 0 // tab1 and tab2 may not be the same table } - if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & TF_WithoutRowid) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { return 0 // source and destination must both be WITHOUT ROWID or not } if (*Table)(unsafe.Pointer(pSrc)).FnModuleArg != 0 { @@ -117754,7 +117754,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // command, and the VACUUM command disables foreign key constraints. So // the extra complication to make this rule less restrictive is probably // not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { return 0 } if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0) { @@ -117774,7 +117774,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint regRowid = Xsqlite3GetTempReg(tls, pParse) Xsqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, OP_OpenWrite) - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) (destHasUniqueIdx != 0)) || // (2) ((onError != OE_Abort) && (onError != OE_Rollback))) { // In some circumstances, we are able to run the xfer optimization @@ -117797,7 +117797,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint emptyDestTest = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) Xsqlite3VdbeJumpHere(tls, v, addr1) } - if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var insFlags U8 Xsqlite3OpenTable(tls, pParse, iSrc, iDbSrc, pSrc, OP_OpenRead) emptySrcTest = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) @@ -117809,13 +117809,13 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint Xsqlite3RowidConstraint(tls, pParse, onError, pDest) Xsqlite3VdbeJumpHere(tls, v, addr2) autoIncStep(tls, pParse, regAutoinc, regRowid) - } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_VacuumInto) != 0) { + } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_VacuumInto)) != 0) { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iDest, regRowid) } else { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid) } - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) insFlags = (U8(OPFLAG_APPEND | OPFLAG_USESEEKRESULT)) } else { @@ -117845,10 +117845,10 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, iDest, int32((*Index)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_BULKCSR) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR)) addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { // This INSERT command is part of a VACUUM operation, which guarantees // that the destination table is empty. If all indexed columns use // collation sequence BINARY, then it can also be assumed that the @@ -117870,10 +117870,10 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint } } if i == int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn) { - idxInsFlags = OPFLAG_USESEEKRESULT + idxInsFlags = U8(OPFLAG_USESEEKRESULT) Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) } - } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { idxInsFlags = U8(int32(idxInsFlags) | (OPFLAG_NCHANGE)) } Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) @@ -117995,7 +117995,7 @@ __7: // Invoke the callback function if required if !((xCallback != 0) && ((SQLITE_ROW == rc) || (((SQLITE_DONE == rc) && !(callbackIsInit != 0)) && - (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NullCallback) != 0)))) { + (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NullCallback)) != 0)))) { goto __9 } if !(!(callbackIsInit != 0)) { @@ -118495,7 +118495,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt // must call either sqlite3_enable_load_extension(db) or // sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, 0) // to turn on extension loading. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtension) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtension)) == uint64(0) { if pzErrMsg != 0 { *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+10418 /* "not authorized" */, 0) } @@ -118894,237 +118894,237 @@ type PragmaName1 = struct { type PragmaName = PragmaName1 /* sqlite3.c:125259:3 */ var aPragmaName = [66]PragmaName{ { /* zName: */ FzName: ts + 14361, /* "analysis_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_ANALYSIS_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_ANALYSIS_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 14376, /* "application_id" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_APPLICATION_ID}, + /* iArg: */ FiArg: uint64(BTREE_APPLICATION_ID)}, { /* zName: */ FzName: ts + 14391, /* "auto_vacuum" */ - /* ePragTyp: */ FePragTyp: PragTyp_AUTO_VACUUM, + /* ePragTyp: */ FePragTyp: U8(PragTyp_AUTO_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 14403, /* "automatic_index" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_AutoIndex}, + /* iArg: */ FiArg: uint64(SQLITE_AutoIndex)}, { /* zName: */ FzName: ts + 14419, /* "busy_timeout" */ - /* ePragTyp: */ FePragTyp: PragTyp_BUSY_TIMEOUT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_BUSY_TIMEOUT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(50), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 14342, /* "cache_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 14432, /* "cache_spill" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SPILL, + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SPILL), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 14444, /* "case_sensitive_l..." */ - /* ePragTyp: */ FePragTyp: PragTyp_CASE_SENSITIVE_LIKE, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_CASE_SENSITIVE_LIKE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, { /* zName: */ FzName: ts + 14464, /* "cell_size_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CellSizeCk}, + /* iArg: */ FiArg: uint64(SQLITE_CellSizeCk)}, { /* zName: */ FzName: ts + 14480, /* "checkpoint_fullf..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CkptFullFSync}, + /* iArg: */ FiArg: uint64(SQLITE_CkptFullFSync)}, { /* zName: */ FzName: ts + 14501, /* "collation_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_COLLATION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_COLLATION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(2)}, { /* zName: */ FzName: ts + 14516, /* "compile_options" */ - /* ePragTyp: */ FePragTyp: PragTyp_COMPILE_OPTIONS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_COMPILE_OPTIONS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 14532, /* "count_changes" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (U64((uint64(0x00001))) << 32)}, { /* zName: */ FzName: ts + 14546, /* "data_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_DATA_VERSION}, + /* iArg: */ FiArg: uint64(BTREE_DATA_VERSION)}, { /* zName: */ FzName: ts + 14559, /* "database_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_DATABASE_LIST, + /* ePragTyp: */ FePragTyp: U8(PragTyp_DATABASE_LIST), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_Result0)), /* ColNames: */ FiPragCName: U8(41), FnPragCName: U8(3)}, { /* zName: */ FzName: ts + 14573, /* "default_cache_si..." */ - /* ePragTyp: */ FePragTyp: PragTyp_DEFAULT_CACHE_SIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_DEFAULT_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1)), /* ColNames: */ FiPragCName: U8(49), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 14592, /* "defer_foreign_ke..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_DeferFKs}, + /* iArg: */ FiArg: uint64(SQLITE_DeferFKs)}, { /* zName: */ FzName: ts + 14611, /* "empty_result_cal..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_NullCallback}, + /* iArg: */ FiArg: uint64(SQLITE_NullCallback)}, { /* zName: */ FzName: ts + 14634, /* "encoding" */ - /* ePragTyp: */ FePragTyp: PragTyp_ENCODING, + /* ePragTyp: */ FePragTyp: U8(PragTyp_ENCODING), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 14643, /* "foreign_key_chec..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_CHECK, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_CHECK), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(37), FnPragCName: U8(4)}, { /* zName: */ FzName: ts + 14661, /* "foreign_key_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_LIST, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), FnPragCName: U8(8)}, { /* zName: */ FzName: ts + 14678, /* "foreign_keys" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ForeignKeys}, + /* iArg: */ FiArg: uint64(SQLITE_ForeignKeys)}, { /* zName: */ FzName: ts + 14691, /* "freelist_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0))}, { /* zName: */ FzName: ts + 14706, /* "full_column_name..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullColNames}, + /* iArg: */ FiArg: uint64(SQLITE_FullColNames)}, { /* zName: */ FzName: ts + 14724, /* "fullfsync" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullFSync}, + /* iArg: */ FiArg: uint64(SQLITE_FullFSync)}, { /* zName: */ FzName: ts + 14734, /* "function_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FUNCTION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FUNCTION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(6)}, { /* zName: */ FzName: ts + 14748, /* "hard_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_HARD_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HARD_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 14764, /* "ignore_check_con..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_IgnoreChecks}, + /* iArg: */ FiArg: uint64(SQLITE_IgnoreChecks)}, { /* zName: */ FzName: ts + 14789, /* "incremental_vacu..." */ - /* ePragTyp: */ FePragTyp: PragTyp_INCREMENTAL_VACUUM, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INCREMENTAL_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_NoColumns))}, { /* zName: */ FzName: ts + 14808, /* "index_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(3)}, { /* zName: */ FzName: ts + 14819, /* "index_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_LIST, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(5)}, { /* zName: */ FzName: ts + 14830, /* "index_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(6), /* iArg: */ FiArg: uint64(1)}, { /* zName: */ FzName: ts + 14842, /* "integrity_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, { /* zName: */ FzName: ts + 14858, /* "journal_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_MODE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_MODE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 14871, /* "journal_size_lim..." */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_SIZE_LIMIT, + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_SIZE_LIMIT), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 14890, /* "legacy_alter_tab..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_LegacyAlter}, + /* iArg: */ FiArg: uint64(SQLITE_LegacyAlter)}, { /* zName: */ FzName: ts + 14909, /* "lock_proxy_file" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCK_PROXY_FILE, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns1}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCK_PROXY_FILE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)}, { /* zName: */ FzName: ts + 14925, /* "locking_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCKING_MODE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCKING_MODE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 14938, /* "max_page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 14953, /* "mmap_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_MMAP_SIZE}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_MMAP_SIZE)}, { /* zName: */ FzName: ts + 14963, /* "module_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_MODULE_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_MODULE_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 14975, /* "optimize" */ - /* ePragTyp: */ FePragTyp: PragTyp_OPTIMIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_OPTIMIZE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result1 | PragFlg_NeedSchema))}, { /* zName: */ FzName: ts + 14984, /* "page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 14995, /* "page_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_SIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_SIZE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 15005, /* "pragma_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_PRAGMA_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PRAGMA_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 15017, /* "query_only" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_QueryOnly}, + /* iArg: */ FiArg: uint64(SQLITE_QueryOnly)}, { /* zName: */ FzName: ts + 15028, /* "quick_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, { /* zName: */ FzName: ts + 15040, /* "read_uncommitted" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReadUncommit}, + /* iArg: */ FiArg: uint64(SQLITE_ReadUncommit)}, { /* zName: */ FzName: ts + 15057, /* "recursive_trigge..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_RecTriggers}, + /* iArg: */ FiArg: uint64(SQLITE_RecTriggers)}, { /* zName: */ FzName: ts + 15076, /* "reverse_unordere..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReverseOrder}, + /* iArg: */ FiArg: uint64(SQLITE_ReverseOrder)}, { /* zName: */ FzName: ts + 15102, /* "schema_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_SCHEMA_VERSION}, + /* iArg: */ FiArg: uint64(BTREE_SCHEMA_VERSION)}, { /* zName: */ FzName: ts + 15117, /* "secure_delete" */ - /* ePragTyp: */ FePragTyp: PragTyp_SECURE_DELETE, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SECURE_DELETE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 15131, /* "short_column_nam..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ShortColNames}, + /* iArg: */ FiArg: uint64(SQLITE_ShortColNames)}, { /* zName: */ FzName: ts + 15150, /* "shrink_memory" */ - /* ePragTyp: */ FePragTyp: PragTyp_SHRINK_MEMORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SHRINK_MEMORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, { /* zName: */ FzName: ts + 15164, /* "soft_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_SOFT_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SOFT_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 15180, /* "synchronous" */ - /* ePragTyp: */ FePragTyp: PragTyp_SYNCHRONOUS, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SYNCHRONOUS), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 15192, /* "table_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(6)}, { /* zName: */ FzName: ts + 15203, /* "table_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(7), /* iArg: */ FiArg: uint64(1)}, { /* zName: */ FzName: ts + 15215, /* "temp_store" */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 15226, /* "temp_store_direc..." */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE_DIRECTORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns1}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE_DIRECTORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)}, { /* zName: */ FzName: ts + 15247, /* "threads" */ - /* ePragTyp: */ FePragTyp: PragTyp_THREADS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_THREADS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 15255, /* "trusted_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_TrustedSchema}, + /* iArg: */ FiArg: uint64(SQLITE_TrustedSchema)}, { /* zName: */ FzName: ts + 15270, /* "user_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_USER_VERSION}, + /* iArg: */ FiArg: uint64(BTREE_USER_VERSION)}, { /* zName: */ FzName: ts + 15283, /* "wal_autocheckpoi..." */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_AUTOCHECKPOINT}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_AUTOCHECKPOINT)}, { /* zName: */ FzName: ts + 15302, /* "wal_checkpoint" */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_CHECKPOINT, - /* ePragFlg: */ FmPragFlg: PragFlg_NeedSchema, + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_CHECKPOINT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema), /* ColNames: */ FiPragCName: U8(44), FnPragCName: U8(3)}, { /* zName: */ FzName: ts + 15317, /* "writable_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, } /* sqlite3.c:125260:25 */ @@ -119322,7 +119322,7 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ for (libc.PostDecInt32(&n, 1)) > 0 { if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 { Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, - (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) } pDb += 32 } @@ -119405,7 +119405,7 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) { continue } - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (showInternFuncs == 0) { continue } @@ -119418,9 +119418,9 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh } Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15552, /* "sissii" */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, - zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&SQLITE_FUNC_ENCMASK)], + zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK))], int32((*FuncDef)(unsafe.Pointer(p)).FnArg), - (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^SQLITE_INNOCUOUS))) + (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^U32(SQLITE_INNOCUOUS)))) } } @@ -120506,7 +120506,7 @@ __88: eMode1 = -1 __90: ; - if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0))) { + if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0))) { goto __91 } // Do not allow journal-mode "OFF" in defensive since the database @@ -120685,7 +120685,7 @@ __26: } returnSingleInt(tls, v, func() int64 { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_CacheSpill) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_CacheSpill)) == uint64(0) { return int64(0) } return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0)) @@ -120702,10 +120702,10 @@ __108: if !(Xsqlite3GetBoolean(tls, zRight, (uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 420 /* size3 */)) != 0)))) != 0) { goto __109 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_CacheSpill) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_CacheSpill)) goto __110 __109: - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CacheSpill)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CacheSpill))) __110: ; setAllPagerFlags(tls, db) @@ -120962,7 +120962,7 @@ __143: goto __145 __144: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^mask) - if !(mask == SQLITE_DeferFKs) { + if !(mask == uint64(SQLITE_DeferFKs)) { goto __146 } (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) @@ -120996,7 +120996,7 @@ __33: goto __147 } Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb) - pTab = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) + pTab = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) if !(pTab != 0) { goto __148 } @@ -121118,8 +121118,8 @@ __34: // If there is no index named zRight, check to see if there is a // WITHOUT ROWID table named zRight, and if there is, show the // structure of the PRIMARY KEY index for that table. - pTab1 = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) - if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + pTab1 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) + if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __167 } pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab1) @@ -121270,7 +121270,7 @@ __186: goto __15 __38: - showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_InternalFunc) != U32(0))) + showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_InternalFunc)) != U32(0))) (*Parse)(unsafe.Pointer(pParse)).FnMem = 6 i5 = 0 __187: @@ -121567,7 +121567,7 @@ __234: ; // Generate code to report an FK violation to the caller. - if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __236 } Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, (regResult + 1)) @@ -121728,7 +121728,7 @@ __249: goto __250 __252: ; - if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __253 } cnt++ @@ -121800,7 +121800,7 @@ __262: goto __263 __265: ; - if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __266 } *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab6)).Ftnum) @@ -121870,7 +121870,7 @@ __273: goto __271 __274: ; - if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk1 = uintptr(0) } else { pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab7) @@ -121903,7 +121903,7 @@ __277: } // Sanity check on record header decoding Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __278: ; // Verify that all NOT NULL columns really are NOT NULL @@ -121928,7 +121928,7 @@ __283: if !(int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Column) { goto __284 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __284: ; jmp2 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, 3) @@ -121945,7 +121945,7 @@ __280: __281: ; // Verify CHECK constraints - if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0))) { + if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0))) { goto __285 } pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab7)).FpCheck, 0) @@ -122085,7 +122085,7 @@ __304: ; Xsqlite3VdbeAddOp2(tls, v, OP_Count, (*(*int32)(unsafe.Pointer(bp + 496 /* iIdxCur */)) + j4), 3) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, (8 + j4), 0, 3) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 2, 3) integrityCheckResultRow(tls, v) @@ -122168,7 +122168,7 @@ __306: // "PRAGMA encoding = XXX" // initialized. If the main database exists, the new sqlite.enc value // will be overwritten when the schema is next loaded. If it does not // already exists, it will be created to use the new encoding value. - if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0)) { goto __309 } pEnc = (uintptr(unsafe.Pointer(&encnames1))) @@ -122182,7 +122182,7 @@ __310: if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 { enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc } else { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc) = enc Xsqlite3SetTextEncoding(tls, db, enc) @@ -122473,7 +122473,7 @@ __335: // If table pTab has not been used in a way that would benefit from // having analysis statistics during the current session, then skip it. // This also has the effect of skipping virtual tables and views - if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & TF_StatsUsed) == U32(0)) { + if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & U32(TF_StatsUsed)) == U32(0)) { goto __338 } goto __336 @@ -122665,53 +122665,53 @@ type EncName = struct { var iLn3 int32 = 0 /* sqlite3.c:126248:22 */ var getCacheSize = [9]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_DEFAULT_CACHE_SIZE}, // 1 - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(2)}, - {Fopcode: OP_Subtract, Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(1)}, // 6 - {Fopcode: OP_Noop}, - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_DEFAULT_CACHE_SIZE)}, // 1 + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(2)}, + {Fopcode: U8(OP_Subtract), Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(1)}, // 6 + {Fopcode: U8(OP_Noop)}, + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, } /* sqlite3.c:126249:29 */ var iLn4 int32 = 0 /* sqlite3.c:126517:26 */ var setMeta6 = [5]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_LARGEST_ROOT_PAGE}, - {Fopcode: OP_If, Fp1: int8(1)}, // 2 - {Fopcode: OP_Halt, Fp2: OE_Abort}, // 3 - {Fopcode: OP_SetCookie, Fp2: BTREE_INCR_VACUUM}, // 4 + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_LARGEST_ROOT_PAGE)}, + {Fopcode: U8(OP_If), Fp1: int8(1)}, // 2 + {Fopcode: U8(OP_Halt), Fp2: int8(OE_Abort)}, // 3 + {Fopcode: U8(OP_SetCookie), Fp2: int8(BTREE_INCR_VACUUM)}, // 4 } /* sqlite3.c:126518:33 */ var iLn5 int32 = 0 /* sqlite3.c:127522:24 */ var endCode = [7]VdbeOpList{ - {Fopcode: OP_AddImm, Fp1: int8(1)}, // 0 - {Fopcode: OP_IfNotZero, Fp1: int8(1), Fp2: int8(4)}, // 1 - {Fopcode: OP_String8, Fp2: int8(3)}, // 2 - {Fopcode: OP_ResultRow, Fp1: int8(3), Fp2: int8(1)}, // 3 - {Fopcode: OP_Halt}, // 4 - {Fopcode: OP_String8, Fp2: int8(3)}, // 5 - {Fopcode: OP_Goto, Fp2: int8(3)}, // 6 + {Fopcode: U8(OP_AddImm), Fp1: int8(1)}, // 0 + {Fopcode: U8(OP_IfNotZero), Fp1: int8(1), Fp2: int8(4)}, // 1 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 2 + {Fopcode: U8(OP_ResultRow), Fp1: int8(3), Fp2: int8(1)}, // 3 + {Fopcode: U8(OP_Halt)}, // 4 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 5 + {Fopcode: U8(OP_Goto), Fp2: int8(3)}, // 6 } /* sqlite3.c:127523:31 */ var encnames1 = [9]EncName{ - {FzName: ts + 15967 /* "UTF8" */, Fenc: SQLITE_UTF8}, - {FzName: ts + 15972 /* "UTF-8" */, Fenc: SQLITE_UTF8}, // Must be element [1] - {FzName: ts + 15978 /* "UTF-16le" */, Fenc: SQLITE_UTF16LE}, // Must be element [2] - {FzName: ts + 15987 /* "UTF-16be" */, Fenc: SQLITE_UTF16BE}, // Must be element [3] - {FzName: ts + 15996 /* "UTF16le" */, Fenc: SQLITE_UTF16LE}, - {FzName: ts + 16004 /* "UTF16be" */, Fenc: SQLITE_UTF16BE}, + {FzName: ts + 15967 /* "UTF8" */, Fenc: U8(SQLITE_UTF8)}, + {FzName: ts + 15972 /* "UTF-8" */, Fenc: U8(SQLITE_UTF8)}, // Must be element [1] + {FzName: ts + 15978 /* "UTF-16le" */, Fenc: U8(SQLITE_UTF16LE)}, // Must be element [2] + {FzName: ts + 15987 /* "UTF-16be" */, Fenc: U8(SQLITE_UTF16BE)}, // Must be element [3] + {FzName: ts + 15996 /* "UTF16le" */, Fenc: U8(SQLITE_UTF16LE)}, + {FzName: ts + 16004 /* "UTF16be" */, Fenc: U8(SQLITE_UTF16BE)}, {FzName: ts + 16012 /* "UTF-16" */}, // SQLITE_UTF16NATIVE {FzName: ts + 16019 /* "UTF16" */}, // SQLITE_UTF16NATIVE {}, } /* sqlite3.c:127575:7 */ var setCookie = [2]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_SetCookie}, // 1 + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_SetCookie)}, // 1 } /* sqlite3.c:127655:31 */ var readCookie = [3]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1)}, // 1 - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1)}, // 1 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, } /* sqlite3.c:127670:31 */ // **************************************************************************** // @@ -123092,10 +123092,10 @@ func corruptSchema(tls *libc.TLS, pData uintptr, zObj uintptr, zExtra uintptr) { (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_NOMEM } else if *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) { // A error message has already been generated. Do not overwrite it - } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & INITFLAG_AlterTable) != 0 { + } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & U32(INITFLAG_AlterTable)) != 0 { *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3DbStrDup(tls, db, zExtra) (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_ERROR - } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_WriteSchema) != 0 { + } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_WriteSchema)) != 0 { (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128375) } else { var z uintptr @@ -123147,7 +123147,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr _ = NotUsed _ = argc - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_EncodingFixed) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_EncodingFixed)) (*InitData)(unsafe.Pointer(pData)).FnInitRow++ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) @@ -123251,7 +123251,7 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl var xAuth Sqlite3_xauth var zSql uintptr openedTransaction = 0 - mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) + mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1) @@ -123348,7 +123348,7 @@ __6: goto __7 __7: ; - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __8 } libc.X__builtin___memset_chk(tls, bp+104 /* &meta[0] */, 0, uint64(unsafe.Sizeof([5]int32{})), libc.X__builtin_object_size(tls, bp+104 /* &meta[0] */, 0)) @@ -123363,7 +123363,7 @@ __8: if !(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 4*4)) != 0) { goto __9 } // text encoding - if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0))) { + if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0))) { goto __10 } // If opening the main database, set ENC(db). @@ -123371,7 +123371,7 @@ __8: if !(int32(encoding) == 0) { goto __12 } - encoding = SQLITE_UTF8 + encoding = U8(SQLITE_UTF8) __12: ; Xsqlite3SetTextEncoding(tls, db, encoding) @@ -123435,7 +123435,7 @@ __17: if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 1*4)) >= 4)) { goto __18 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyFileFmt)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyFileFmt))) __18: ; @@ -123475,7 +123475,7 @@ __20: Xsqlite3ResetAllSchemasOfConnection(tls, db) __21: ; - if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoSchemaError) != 0)) { + if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoSchemaError)) != 0)) { goto __22 } // Black magic: If the SQLITE_NoSchemaError flag is set, then consider @@ -123529,7 +123529,7 @@ __24: func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128755:20: */ var i int32 var rc int32 - var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != 0)) + var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != 0)) ((*Sqlite3)(unsafe.Pointer(db)).Fenc) = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc @@ -123568,7 +123568,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1287 (*Parse)(unsafe.Pointer(pParse)).Frc = rc (*Parse)(unsafe.Pointer(pParse)).FnErr++ } else if (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache != 0 { - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaKnownOk) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaKnownOk)) } } return rc @@ -123713,7 +123713,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF // For a long-term use prepared statement avoid the use of // lookaside memory. - if !((prepFlags & SQLITE_PREPARE_PERSISTENT) != 0) { + if !((prepFlags & U32(SQLITE_PREPARE_PERSISTENT)) != 0) { goto __1 } (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FdisableLookaside++ @@ -123721,7 +123721,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) __1: ; - (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & SQLITE_PREPARE_NO_VTAB) != U32(0)))) + (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & U32(SQLITE_PREPARE_NO_VTAB)) != U32(0)))) // Check to verify that it is possible to get a read lock on all // database schemas. The inability to get a read lock indicates that @@ -123975,7 +123975,7 @@ func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, // parameter. // // Proof in that the 5th parameter to sqlite3LockAndPrepare is 0 - rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, uintptr(0), + rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), uintptr(0), ppStmt, pzTail) return rc @@ -123991,7 +123991,7 @@ 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, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), uintptr(0), ppStmt, pzTail) return rc @@ -124021,7 +124021,7 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre nBytes = sz } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, SQLITE_UTF16LE) + zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, uint8(SQLITE_UTF16LE)) if zSql8 != 0 { rc = sqlite3LockAndPrepare(tls, db, zSql8, -1, prepFlags, uintptr(0), ppStmt, bp /* &zTail8 */) } @@ -124055,7 +124055,7 @@ func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, p func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129268:16: */ var rc int32 - rc = sqlite3Prepare16(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, ppStmt, pzTail) + rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail) // VERIFY: F13021 return rc } @@ -124063,7 +124063,7 @@ func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129280:16: */ var rc int32 rc = sqlite3Prepare16(tls, db, zSql, nBytes, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), ppStmt, pzTail) // VERIFY: F13021 return rc @@ -124229,7 +124229,7 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0))) } (*Select)(unsafe.Pointer(pNew)).FpEList = pEList - (*Select)(unsafe.Pointer(pNew)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(pNew)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(pNew)).FselFlags = selFlags (*Select)(unsafe.Pointer(pNew)).FiLimit = 0 (*Select)(unsafe.Pointer(pNew)).FiOffset = 0 @@ -124350,12 +124350,12 @@ var aKeyword = [7]struct { FnChar U8 Fcode U8 }{ - /* natural */ {FnChar: U8(7), Fcode: JT_NATURAL}, + /* natural */ {FnChar: U8(7), Fcode: U8(JT_NATURAL)}, /* left */ {Fi: U8(6), FnChar: U8(4), Fcode: (U8(JT_LEFT | JT_OUTER))}, - /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: JT_OUTER}, + /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: U8(JT_OUTER)}, /* right */ {Fi: U8(14), FnChar: U8(5), Fcode: (U8(JT_RIGHT | JT_OUTER))}, /* full */ {Fi: U8(19), FnChar: U8(4), Fcode: (U8((JT_LEFT | JT_RIGHT) | JT_OUTER))}, - /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: JT_INNER}, + /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: U8(JT_INNER)}, /* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: (U8(JT_INNER | JT_CROSS))}, } /* sqlite3.c:129513:5 */ @@ -124434,7 +124434,7 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pE1, pE2) if (pEq != 0) && (isOuterJoin != 0) { - *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = I16((*Expr)(unsafe.Pointer(pE2)).FiTable) } @@ -124467,7 +124467,7 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol // the output, which is incorrect. func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129680:21: */ for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(p)).FiRightJoinTable = I16(iTable) if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { @@ -124488,7 +124488,7 @@ func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c: // This happens when a LEFT JOIN is simplified into an ordinary JOIN. func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703:13: */ for p != 0 { - if (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FromJoin)) != U32(0)) && + if (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FromJoin))) != U32(0)) && ((iTable < 0) || (int32((*Expr)(unsafe.Pointer(p)).FiRightJoinTable) == iTable)) { *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_FromJoin))) } @@ -124821,7 +124821,7 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iTab, addrRepeat, iMem, N) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, iMem, N, r1) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iTab, r1, iMem, N) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, r1) } @@ -124901,7 +124901,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var ecelFlags U8 // "ecel" is an abbreviation of "ExprCodeExprList" var pEList uintptr if ((eDest == SRT_Mem) || (eDest == SRT_Output)) || (eDest == SRT_Coroutine) { - ecelFlags = SQLITE_ECEL_DUP + ecelFlags = U8(SQLITE_ECEL_DUP) } else { ecelFlags = U8(0) } @@ -124967,7 +124967,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo // row is all NULLs. Xsqlite3VdbeChangeToNoop(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) pOp = Xsqlite3VdbeGetOp(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 1 (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = regPrev pOp = uintptr(0) // Ensure pOp is not used after sqlite3VdbeAddOp() @@ -124983,7 +124983,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo } Xsqlite3VdbeChangeP4(tls, v, -1, pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regResult, regPrev, (nResultCol - 1)) @@ -125069,7 +125069,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var r2 int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) } Xsqlite3ReleaseTempRange(tls, pParse, r1, (nPrefixReg + 1)) @@ -125202,7 +125202,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r3) if eDest == SRT_DistQueue { Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (iParm + 1), r3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } for i = 0; i < nKey; i++ { Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, @@ -125459,7 +125459,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, (nKey + bSeq), regRow) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, regRow, regRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) break } @@ -125754,8 +125754,8 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1) - fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_FullColNames) != uint64(0))) - srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ShortColNames) != uint64(0)) || (fullName != 0))) + fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_FullColNames)) != uint64(0))) + srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ShortColNames)) != uint64(0)) || (fullName != 0))) Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -126021,8 +126021,8 @@ func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a var savedFlags U64 savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_FullColNames)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_ShortColNames) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_FullColNames))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_ShortColNames)) Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0)) (*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -126113,7 +126113,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 Xsqlite3VdbeGoto(tls, v, iBreak) } else if (*(*int32)(unsafe.Pointer(bp /* n */)) >= 0) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))))) { (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_FixedLimit) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_FixedLimit)) } } else { Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit) @@ -126175,7 +126175,7 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra var pTerm uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr var pColl uintptr - if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pTerm) } else { pColl = multiSelectCollSeq(tls, pParse, p, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1)) @@ -126352,7 +126352,7 @@ __10: goto __11 } *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) __11: ; @@ -126403,7 +126403,7 @@ __15: // Execute the recursive SELECT taking the single row in Current as // the value for the recursive-table. Store the results in the Queue. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != 0) { goto __16 } Xsqlite3ErrorMsg(tls, pParse, ts+16765 /* "recursive aggreg..." */, 0) @@ -126582,12 +126582,12 @@ __1: } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) - (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FeDest = SRT_Table + (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FeDest = U8(SRT_Table) __2: ; // Special handling for a compound-select that originates as a VALUES clause. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) != 0) { goto __3 } rc = multiSelectValues(tls, pParse, p, bp+32 /* &dest */) @@ -126604,7 +126604,7 @@ __3: // Make sure all SELECTs in the statement have the same number of elements // in their result sets. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Recursive) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != 0) { goto __5 } generateWithRecursiveQuery(tls, pParse, p, bp+32 /* &dest */) @@ -126713,7 +126713,7 @@ __20: addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, unionTab, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr1 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) __21: ; @@ -126733,11 +126733,11 @@ __22: if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_EXCEPT) { goto __23 } - op = SRT_Except + op = U8(SRT_Except) goto __24 __23: ; - op = SRT_Union + op = U8(SRT_Union) __24: ; (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) @@ -126794,7 +126794,7 @@ __14: addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab1, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr2 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) // Code the SELECTs to our left into temporary table "tab1". Xsqlite3SelectDestInit(tls, bp+120 /* &intersectdest */, SRT_Union, tab1) @@ -126883,7 +126883,7 @@ __31: // SELECT statements to the left always skip this part. The right-most // SELECT might also skip this part if it has no ORDER BY clause and // no temp tables are required. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UsesEphemeral) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UsesEphemeral)) != 0) { goto __32 } // Number of columns in result set @@ -126973,7 +126973,7 @@ func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(8) defer tls.Free(8) - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Values) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Values)) != 0 { Xsqlite3ErrorMsg(tls, pParse, ts+16957 /* "all VALUES must ..." */, 0) } else { Xsqlite3ErrorMsg(tls, pParse, @@ -127035,7 +127035,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst, r1) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) Xsqlite3ReleaseTempReg(tls, pParse, r1) break @@ -127286,7 +127286,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if pNew == uintptr(0) { return SQLITE_NOMEM } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = i (*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew)) if pOrderBy != 0 { @@ -127498,7 +127498,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) Xsqlite3VdbeAddOp4(tls, v, OP_Permutation, 0, 0, 0, aPermute, -15) Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(bp+8 /* &destA */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+48 /* &destB */)).FiSdst, nOrderBy, pKeyMerge, -9) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_PERMUTE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_PERMUTE)) Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrAltB, addrAeqB, addrAgtB) // Jump to the this point in order to terminate the query. @@ -127557,15 +127557,15 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite if pExpr == uintptr(0) { return uintptr(0) } - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) { (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = I16((*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable) } if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else { var pNew uintptr var pCopy uintptr = (*ExprList_item)(unsafe.Pointer(((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 /* &.a */) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FpExpr @@ -127577,20 +127577,20 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb if ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) && (int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN) { libc.X__builtin___memset_chk(tls, bp /* &ifNullRow */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp /* &ifNullRow */, 0)) - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = TK_IF_NULL_ROW + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = U8(TK_IF_NULL_ROW) (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FpLeft = pCopy (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = U32(EP_Skip) pCopy = bp /* &ifNullRow */ } pNew = Xsqlite3ExprDup(tls, db, pCopy, 0) if (pNew != 0) && ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) } - if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { (*Expr)(unsafe.Pointer(pNew)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_FromJoin)) } Xsqlite3ExprDelete(tls, db, pExpr) pExpr = pNew @@ -127618,12 +127618,12 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite } (*Expr)(unsafe.Pointer(pExpr)).FpLeft = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) (*Expr)(unsafe.Pointer(pExpr)).FpRight = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpRight) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)), 1) } else { substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) (*Window)(unsafe.Pointer(pWin)).FpFilter = substExpr(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpFilter) substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpPartition) @@ -127924,13 +127924,13 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0) { return 0 } // Restriction (14) - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Compound) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Compound)) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { return 0 // Restriction (15) } if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc == 0 { return 0 } // Restriction (7) - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Distinct)) != 0 { return 0 } // Restriction (4) if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1) || (isAgg != 0)) { @@ -127945,10 +127945,10 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Select)(unsafe.Pointer(p)).FpWhere != 0) { return 0 } // Restriction (19) - if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 // Restriction (21) } - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (SF_Recursive)) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (U32(SF_Recursive))) != 0 { return 0 // Restrictions (22) } @@ -127975,7 +127975,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((((*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1) || // (3a) (isAgg != 0)) || // (3b) ((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c) - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 } } @@ -127988,7 +127988,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 { return 0 // Restriction (20) } - if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0))) || ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1) { + if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0))) || ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1) { return 0 // (17d1), (17d2), or (17d3) } for pSub1 = pSub; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior { @@ -128072,7 +128072,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg (*Select)(unsafe.Pointer(p)).FpLimit = pLimit (*Select)(unsafe.Pointer(p)).FpOrderBy = pOrderBy (*Select)(unsafe.Pointer(p)).FpSrc = pSrc - (*Select)(unsafe.Pointer(p)).Fop = TK_ALL + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_ALL) if pNew == uintptr(0) { (*Select)(unsafe.Pointer(p)).FpPrior = pPrior } else { @@ -128207,7 +128207,7 @@ __1: // // We look at every expression in the outer query and every place we see // "a" we substitute "x*3" and every place we see "b" we substitute "y+10". - if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & SF_NoopOrderBy) == U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & U32(SF_NoopOrderBy)) == U32(0)) { // At this point, any non-zero iOrderByCol values indicate that the // ORDER BY column expression is identical to the iOrderByCol'th // expression returned by SELECT statement pSub. Since these values @@ -128251,7 +128251,7 @@ __1: // The flattened query is a compound if either the inner or the // outer query is a compound. - *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Compound) + *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound)) // restriction (17b) // SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; @@ -128301,7 +128301,7 @@ type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:133518:13: */ var i int32 - if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (EP_FixedCol)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (U32(EP_FixedCol))) != U32(0) { return } if int32(Xsqlite3ExprAffinity(tls, pValue)) != 0 { @@ -128343,7 +128343,7 @@ func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3 if pExpr == uintptr(0) { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { @@ -128394,7 +128394,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // A match is found. Add the EP_FixedCol property (*WhereConst)(unsafe.Pointer(pConst)).FnChng++ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FixedCol) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FixedCol)) (*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(((i*2)+1))*8)), 0) break @@ -128532,7 +128532,7 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin if pWhere == uintptr(0) { return 0 } - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Recursive) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Recursive)) != 0 { return 0 } // restriction (2) @@ -128551,11 +128551,11 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft } if (isLeftJoin != 0) && - (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0))) == 0) || + (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0))) == 0) || (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor)) { return 0 // restriction (4) } - if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor) { + if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor) { return 0 // restriction (5) } if Xsqlite3ExprIsTableConstant(tls, pWhere, iCursor) != 0 { @@ -128571,7 +128571,7 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin (*SubstContext)(unsafe.Pointer(bp /* &x */)).FisLeftJoin = 0 (*SubstContext)(unsafe.Pointer(bp /* &x */)).FpEList = (*Select)(unsafe.Pointer(pSubq)).FpEList pNew = substExpr(tls, bp /* &x */, pNew) - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Aggregate) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Aggregate)) != 0 { (*Select)(unsafe.Pointer(pSubq)).FpHaving = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpHaving, pNew) } else { (*Select)(unsafe.Pointer(pSubq)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpWhere, pNew) @@ -128603,18 +128603,18 @@ func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 var pOrderBy uintptr var sortFlags U8 = U8(0) - if ((pEList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (EP_WinFunc)) != U32(0)) { + if ((pEList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (U32(EP_WinFunc))) != U32(0)) { return U8(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8 /* &.u */)) if Xsqlite3StrICmp(tls, zFunc, ts+13384 /* "min" */) == 0 { eRet = WHERE_ORDERBY_MIN if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */))).FpExpr) != 0 { - sortFlags = KEYINFO_ORDER_BIGNULL + sortFlags = U8(KEYINFO_ORDER_BIGNULL) } } else if Xsqlite3StrICmp(tls, zFunc, ts+13388 /* "max" */) == 0 { eRet = WHERE_ORDERBY_MAX - sortFlags = KEYINFO_ORDER_DESC + sortFlags = U8(KEYINFO_ORDER_DESC) } else { return U8(eRet) } @@ -128655,7 +128655,7 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 0 { return uintptr(0) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & SQLITE_FUNC_COUNT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_COUNT)) == U32(0) { return uintptr(0) } if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Distinct | EP_WinFunc))) != U32(0) { @@ -128743,7 +128743,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) return WRC_Continue } for i = ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1); i >= 0; i-- { - if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & U32(EP_Collate)) != 0 { break } } @@ -128767,7 +128767,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) *(*Select)(unsafe.Pointer(pNew)) = *(*Select)(unsafe.Pointer(p)) (*Select)(unsafe.Pointer(p)).FpSrc = pNewSrc (*Select)(unsafe.Pointer(p)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3Expr(tls, db, TK_ASTERISK, uintptr(0))) - (*Select)(unsafe.Pointer(p)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpHaving = uintptr(0) @@ -128778,7 +128778,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Compound))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Converted) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Converted)) (*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*Select)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -128921,7 +128921,7 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20) (*Table)(unsafe.Pointer(pTab)).FnTabRef++ - *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (SF_Recursive) + *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (U32(SF_Recursive)) } } } @@ -128962,7 +128962,7 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite Xsqlite3ColumnsFromExprList(tls, pParse, pEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) if bMayRecursive != 0 { - if ((*Select)(unsafe.Pointer(pSel)).FselFlags & SF_Recursive) != 0 { + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 { (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17252 /* "multiple recursi..." */ } else { (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17286 /* "recursive refere..." */ @@ -129021,7 +129021,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) (*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return SQLITE_ERROR @@ -129069,7 +129069,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite var selFlags U16 = U16((*Select)(unsafe.Pointer(p)).FselFlags) var elistFlags U32 = U32(0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Expanded) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return WRC_Abort } @@ -129143,14 +129143,14 @@ __1: return WRC_Abort } - if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableView) == uint64(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableView)) == uint64(0)) { Xsqlite3ErrorMsg(tls, pParse, ts+17375, /* "access to view \"..." */ libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) } if ((((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.fromDDL */)) & 0x40 >> 6))) != 0)) && ((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0))) && - (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TrustedSchema) != uint64(0)))) { + (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TrustedSchema)) != uint64(0)))) { Xsqlite3ErrorMsg(tls, pParse, ts+17406, /* "unsafe use of vi..." */ libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) } @@ -129257,7 +129257,7 @@ __3: if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto __6 } - if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_NestedFrom) == U32(0)) { + if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_NestedFrom)) == U32(0)) { pSub = uintptr(0) if (zTName != 0) && (Xsqlite3StrICmp(tls, zTName, zTabName) != 0) { goto __5 @@ -129284,7 +129284,7 @@ __3: // If a column is marked as 'hidden', omit it from the expanded // result-set list unless the SELECT has the SF_IncludeHidden // bit set. - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_IncludeHidden) == U32(0)) && + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_IncludeHidden)) == U32(0)) && ((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0) { continue } @@ -129324,7 +129324,7 @@ __3: pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pExpr) Xsqlite3TokenInit(tls, bp+72 /* &sColname */, zColname) Xsqlite3ExprListSetName(tls, pParse, pNew, bp+72 /* &sColname */, 0) - if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_NestedFrom) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { + if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_NestedFrom)) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { var pX uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pX)).FzEName) if pSub != 0 { @@ -129335,7 +129335,7 @@ __3: libc.VaList(bp+40, zSchemaName, zTabName, zColname)) } - libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, ENAME_TAB, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, uint32(ENAME_TAB), 0, 0x3) } Xsqlite3DbFree(tls, db, zToFree) } @@ -129367,7 +129367,7 @@ __3: return WRC_Abort } if (elistFlags & (U32(EP_HasFunc | EP_Subquery))) != U32(0) { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_ComplexResult) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_ComplexResult)) } } return WRC_Continue @@ -129428,10 +129428,10 @@ func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* s var pTabList uintptr var pFrom uintptr - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_HasTypeInfo) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_HasTypeInfo)) pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse pTabList = (*Select)(unsafe.Pointer(p)).FpSrc i = 0 @@ -129443,7 +129443,7 @@ __1: { var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0) { // A sub-query in the FROM clause of a SELECT var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect if pSel != 0 { @@ -129451,7 +129451,7 @@ __1: pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior } Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTab, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } @@ -129504,7 +129504,7 @@ func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintp if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } sqlite3SelectExpand(tls, pParse, p) @@ -129628,10 +129628,10 @@ __1: var regAgg int32 var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32 /* &.x */)) - if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 64 /* &.y */)))).FpFilter if (((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) && - (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) && + (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) && (regAcc != 0) { // If regAcc==0, there there exists some min() or max() function // without a FILTER clause that will ensure the magnet registers @@ -129654,7 +129654,7 @@ __1: if pList != 0 { nArg = (*ExprList)(unsafe.Pointer(pList)).FnExpr regAgg = Xsqlite3GetTempRange(tls, pParse, nArg) - Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, SQLITE_ECEL_DUP) + Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, uint8(SQLITE_ECEL_DUP)) } else { nArg = 0 regAgg = 0 @@ -129667,7 +129667,7 @@ __1: // Also an error codeDistinct(tls, pParse, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, addrNext, 1, regAgg) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr = uintptr(0) var pItem uintptr var j int32 @@ -129753,7 +129753,7 @@ func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintpt defer tls.Free(24) if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 { - var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) + var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17570, /* "SCAN TABLE %s%s%..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, func() uintptr { @@ -130026,7 +130026,7 @@ __2: Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy) (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_NoopOrderBy) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_NoopOrderBy)) __3: ; Xsqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -130041,7 +130041,7 @@ __4: // 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 // or alias is duplicated within FROM clause (pSrc->a[1..n]). - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UpdateFrom) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UpdateFrom)) != 0) { goto __5 } p0 = ((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) @@ -130091,7 +130091,7 @@ __10: __11: ; pTabList = (*Select)(unsafe.Pointer(p)).FpSrc - isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != U32(0))) + isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != U32(0))) libc.X__builtin___memset_chk(tls, bp+48 /* &sSort */, 0, uint64(unsafe.Sizeof(SortCtx{})), libc.X__builtin_object_size(tls, bp+48 /* &sSort */, 0)) (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy @@ -130148,7 +130148,7 @@ __17: // is not a join. But if the outer query is not a join, then the subquery // will be implemented as a co-routine and there is no advantage to // flattening in that case. - if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Aggregate) != U32(0)) { + if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Aggregate)) != U32(0)) { goto __18 } goto __13 @@ -130174,7 +130174,7 @@ __18: // SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10); if !(((((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0)) && (i == 0)) && - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_ComplexResult) != U32(0))) && + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_ComplexResult)) != U32(0))) && (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) || ((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { goto __19 @@ -130425,7 +130425,7 @@ __30: pWhere = (*Select)(unsafe.Pointer(p)).FpWhere pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy pHaving = (*Select)(unsafe.Pointer(p)).FpHaving - (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)))) + (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)))) // If the query is DISTINCT with an ORDER BY but is not an aggregate, and // if the select-list is the same as the ORDER BY list, then this query @@ -130441,14 +130441,14 @@ __30: // used for both the ORDER BY and DISTINCT processing. As originally // 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 !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == SF_Distinct) && + if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == U32(SF_Distinct)) && (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) && ((*Select)(unsafe.Pointer(p)).FpWin == uintptr(0))) { goto __43 } *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) pGroupBy = libc.AssignPtrUintptr(p+56 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0)) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Aggregate) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Aggregate)) // 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 @@ -130488,7 +130488,7 @@ __46: // Set the limiter. iEnd = Xsqlite3VdbeMakeLabel(tls, pParse) - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit) == U32(0)) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)) == U32(0)) { goto __47 } (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320) // 4 billion rows @@ -130498,13 +130498,13 @@ __47: if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex >= 0)) { goto __48 } - Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex, OP_SorterOpen) + Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex, uint8(OP_SorterOpen)) *(*U8)(unsafe.Pointer(bp + 48 /* &sSort */ + 36 /* &.sortFlags */)) |= U8((SORTFLAG_UseSorter)) __48: ; // Open an ephemeral index to use for the distinct set. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != 0) { goto __49 } (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) @@ -130512,11 +130512,11 @@ __48: (*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FtabTnct, 0, 0, Xsqlite3KeyInfoFromExprList(tls, pParse, (*Select)(unsafe.Pointer(p)).FpEList, 0, 0), -9) - Xsqlite3VdbeChangeP5(tls, v, BTREE_UNORDERED) - (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_UNORDERED + Xsqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED)) + (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_UNORDERED) goto __50 __49: - (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_NOOP + (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_NOOP) __50: ; @@ -130526,11 +130526,11 @@ __50: // No aggregate functions and no GROUP BY clause wctrlFlags = (U16((func() uint32 { if (*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0 { - return WHERE_WANT_DISTINCT + return uint32(WHERE_WANT_DISTINCT) } return uint32(0) }()) | - ((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit))) + ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)))) pWin = (*Select)(unsafe.Pointer(p)).FpWin // Main window object (or NULL) if !(pWin != 0) { goto __53 @@ -130763,7 +130763,7 @@ __77: minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr, bp+208 /* &pMinMaxOrderBy */) goto __80 __79: - minMaxFlag = WHERE_ORDERBY_NORMAL + minMaxFlag = U8(WHERE_ORDERBY_NORMAL) __80: ; i = 0 @@ -130776,7 +130776,7 @@ __81: *(*int32)(unsafe.Pointer(bp + 152 /* &sNC */ + 40 /* &.ncFlags */)) |= (NC_InAggFunc) Xsqlite3ExprAnalyzeAggList(tls, bp+152 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __84 } Xsqlite3ExprAnalyzeAggregates(tls, bp+152 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) @@ -130861,7 +130861,7 @@ __89: explainTempTable(tls, pParse, func() uintptr { - if ((*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) == U32(0)) { + if ((*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) == U32(0)) { return ts + 17734 /* "DISTINCT" */ } return ts + 17743 /* "GROUP BY" */ @@ -131088,7 +131088,7 @@ __86: // // In practice the KeyInfo structure will not be used. It is only // passed to keep OP_OpenRead happy. - if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __110 } pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1) @@ -131160,13 +131160,13 @@ __119: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { goto __121 } - if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __122 } goto __120 __122: ; - if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { + if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { goto __123 } goto __121 @@ -131904,9 +131904,9 @@ __27: (*Trigger)(unsafe.Pointer(pTrigger)).Fop = U8(op) (*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm = func() uint8 { if tr_tm == TK_BEFORE { - return TRIGGER_BEFORE + return uint8(TRIGGER_BEFORE) } - return TRIGGER_AFTER + return uint8(TRIGGER_AFTER) }() if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { goto __28 @@ -132089,9 +132089,9 @@ func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStar Xsqlite3SelectDelete(tls, db, pSelect) return uintptr(0) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = U8(TK_SELECT) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = triggerSpanDup(tls, db, zStart, zEnd) return pTriggerStep } @@ -132128,7 +132128,7 @@ func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_INSERT, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_INSERT), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect @@ -132160,7 +132160,7 @@ func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_UPDATE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_UPDATE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList @@ -132189,7 +132189,7 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_DELETE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_DELETE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere @@ -132197,7 +132197,7 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr } else { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) } Xsqlite3ExprDelete(tls, db, pWhere) return pTriggerStep @@ -132374,7 +132374,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName } } Xsqlite3DeleteTrigger(tls, db, pTrigger) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } } @@ -132407,7 +132407,7 @@ func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32 var pList uintptr = uintptr(0) var p uintptr - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableTrigger) != uint64(0) { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableTrigger)) != uint64(0) { pList = Xsqlite3TriggerList(tls, pParse, pTab) } @@ -132702,7 +132702,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab // 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 { - var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_RecTriggers)))) + var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_RecTriggers))))) Xsqlite3VdbeAddOp4(tls, v, OP_Program, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1), (*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4) @@ -133177,7 +133177,7 @@ __4: // allocate enough space, just in case. iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) iIdxCur = (iDataCur + 1) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -133383,7 +133383,7 @@ __17: // is non-negative, so the value of aXRef[] for generated columns can be // set to any non-negative number. We use 99999 so that the value is // obvious when looking at aXRef[] in a symbolic debugger. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __34 } @@ -133615,7 +133615,7 @@ __64: __65: ; - if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __66 } Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regRowSet, regOldRowid) @@ -133757,7 +133757,7 @@ __80: __77: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __83 } // Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF @@ -133999,7 +133999,7 @@ __118: k = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld) if !(((oldmask == 0xffffffff) || ((i < 32) && ((oldmask & (uint32((uint32(1))) << (i))) != U32(0)))) || - ((colFlags & COLFLAG_PRIMKEY) != U32(0))) { + ((colFlags & U32(COLFLAG_PRIMKEY)) != U32(0))) { goto __121 } @@ -134113,7 +134113,7 @@ __125: goto __126 __126: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __138 } @@ -134191,7 +134191,7 @@ __144: goto __145 __145: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __150 } @@ -134275,7 +134275,7 @@ __156: goto __157 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) __157: ; if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) { @@ -134465,7 +134465,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Start scanning the virtual table - pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), WHERE_ONEPASS_DESIRED, 0) + pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uint16(WHERE_ONEPASS_DESIRED), 0) if pWInfo == uintptr(0) { return } @@ -134477,10 +134477,10 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, ((regArg + 2) + i)) } else { Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, ((regArg + 2) + i)) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_NOCHNG) // For sqlite3_vtab_nochange() + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_NOCHNG)) // For sqlite3_vtab_nochange() } } - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg) if pRowid != 0 { Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1)) @@ -134535,7 +134535,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, nArg, regArg, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) @@ -134650,7 +134650,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget iCursor = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && + if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) && (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) && (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) { @@ -134665,9 +134665,9 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr // will populate the specific collation and column number values // prior to comparing against the conflict-target expression. libc.X__builtin___memset_chk(tls, bp+56 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{})), libc.X__builtin_object_size(tls, bp+56 /* &sCol[0] */, 0)) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).Fop = TK_COLLATE + (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).Fop = U8(TK_COLLATE) (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = (bp + 56 /* &sCol */ + 1*72) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).FiTable = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor // Check for matches against other indexes @@ -134745,7 +134745,7 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur if (pIdx != 0) && (iCur != iDataCur) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var regRowid int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iCur, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iDataCur, 0, regRowid) @@ -135075,7 +135075,7 @@ __6: goto end_of_vacuum __8: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_VacuumInto) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_VacuumInto)) __7: ; nRes = Xsqlite3BtreeGetRequestedReserve(tls, pMain) @@ -135288,11 +135288,11 @@ __26: } var aCopy = [10]uint8{ - BTREE_SCHEMA_VERSION, uint8(1), // Add one to the old schema cookie - BTREE_DEFAULT_CACHE_SIZE, uint8(0), // Preserve the default page cache size - BTREE_TEXT_ENCODING, uint8(0), // Preserve the text encoding - BTREE_USER_VERSION, uint8(0), // Preserve the user version - BTREE_APPLICATION_ID, uint8(0), // Preserve the application id + uint8(BTREE_SCHEMA_VERSION), uint8(1), // Add one to the old schema cookie + uint8(BTREE_DEFAULT_CACHE_SIZE), uint8(0), // Preserve the default page cache size + uint8(BTREE_TEXT_ENCODING), uint8(0), // Preserve the text encoding + uint8(BTREE_USER_VERSION), uint8(0), // Preserve the user version + uint8(BTREE_APPLICATION_ID), uint8(0), // Preserve the application id } /* sqlite3.c:139504:32 */ // Construct and install a Module object for a virtual table. When this @@ -135759,7 +135759,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } (*VTable)(unsafe.Pointer(pVTable)).Fdb = db (*VTable)(unsafe.Pointer(pVTable)).FpMod = pMod - (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = SQLITE_VTABRISK_Normal + (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Normal) iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + 1*8)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName @@ -135836,7 +135836,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, *(*int8)(unsafe.Pointer(zType + uintptr((i - 1)))) = int8(0) } *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32 + 28 /* &.colFlags */)) |= U16((COLFLAG_HIDDEN)) - oooHidden = TF_OOOHidden + oooHidden = U16(TF_OOOHidden) } else { *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(oooHidden)) } @@ -135981,7 +135981,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab libc.X__builtin___memset_chk(tls, bp+8 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})), libc.X__builtin_object_size(tls, bp+8 /* &sParse */, 0)) - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_DECLARE_VTAB + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_DECLARE_VTAB) (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).Fdb = db (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FnQueryLoop = U32(1) if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+432 /* &zErr */)) && @@ -135998,7 +135998,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 (*Table)(unsafe.Pointer(pNew)).FnCol = int16(0) (*Table)(unsafe.Pointer(pNew)).FaCol = uintptr(0) - if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & TF_WithoutRowid) == U32(0)) && + if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0))) && (int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1) { // WITHOUT ROWID virtual tables must either be read-only (xUpdate==0) @@ -136024,7 +136024,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */))) rc = SQLITE_ERROR } - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_NORMAL) if (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe != 0 { Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe) @@ -136308,7 +136308,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg libc.X__builtin___memcpy_chk(tls, (pNew + 1*72), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1)), libc.X__builtin_object_size(tls, (pNew+1*72), 0)) (*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp /* xSFunc */)) (*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 8 /* pArg */)) - *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (SQLITE_FUNC_EPHEM) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (U32(SQLITE_FUNC_EPHEM)) return pNew } @@ -136404,7 +136404,7 @@ func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { // Mark the table as Ephemeral prior to deleting it, so that the // sqlite3DeleteTable() routine will know that it is not stored in // the schema. - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) Xsqlite3DeleteTable(tls, db, pTab) (*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) } @@ -136421,7 +136421,7 @@ func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1 } var aMap1 = [5]uint8{ - SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE, + uint8(SQLITE_ROLLBACK), uint8(SQLITE_ABORT), uint8(SQLITE_FAIL), uint8(SQLITE_IGNORE), uint8(SQLITE_REPLACE), } /* sqlite3.c:140837:30 */ // Call from within the xCreate() or xConnect() methods to provide @@ -136450,14 +136450,14 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 fallthrough case SQLITE_VTAB_INNOCUOUS: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_Low + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Low) break } fallthrough case SQLITE_VTAB_DIRECTONLY: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_High + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_High) break } @@ -136913,11 +136913,11 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3. } j = i - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+19346 /* ">" */) i = 1 } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+19348 /* "<" */) } Xsqlite3_str_append(tls, pStr, ts+4327 /* ")" */, 1) @@ -136955,12 +136955,12 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if ((flags & WHERE_MULTI_OR) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { + if ((flags & U32(WHERE_MULTI_OR)) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { return 0 } isSearch = (libc.Bool32((((flags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) != U32(0)) || - (((flags & WHERE_VIRTUALTABLE) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || + (((flags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || ((int32(wctrlFlags) & (WHERE_ORDERBY_MIN | WHERE_ORDERBY_MAX)) != 0))) Xsqlite3StrAccumInit(tls, bp+56 /* &str */, db, bp+88 /* &zBuf[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) @@ -136985,15 +136985,15 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { zFmt = ts + 19392 /* "PRIMARY KEY" */ } - } else if (flags & WHERE_PARTIALIDX) != 0 { + } else if (flags & U32(WHERE_PARTIALIDX)) != 0 { zFmt = ts + 19404 /* "AUTOMATIC PARTIA..." */ - } else if (flags & WHERE_AUTO_INDEX) != 0 { + } else if (flags & U32(WHERE_AUTO_INDEX)) != 0 { zFmt = ts + 19437 /* "AUTOMATIC COVERI..." */ - } else if (flags & WHERE_IDX_ONLY) != 0 { + } else if (flags & U32(WHERE_IDX_ONLY)) != 0 { zFmt = ts + 19462 /* "COVERING INDEX %..." */ } else { zFmt = ts + 19480 /* "INDEX %s" */ @@ -137003,13 +137003,13 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr Xsqlite3_str_appendf(tls, bp+56 /* &str */, zFmt, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName)) explainIndexRange(tls, bp+56 /* &str */, pLoop) } - } else if ((flags & WHERE_IPK) != U32(0)) && ((flags & WHERE_CONSTRAINT) != U32(0)) { + } else if ((flags & U32(WHERE_IPK)) != U32(0)) && ((flags & U32(WHERE_CONSTRAINT)) != U32(0)) { var zRangeOp uintptr if (flags & (U32(WHERE_COLUMN_EQ | WHERE_COLUMN_IN))) != 0 { zRangeOp = ts + 19497 /* "=" */ - } else if (flags & WHERE_BOTH_LIMIT) == WHERE_BOTH_LIMIT { + } else if (flags & U32(WHERE_BOTH_LIMIT)) == U32(WHERE_BOTH_LIMIT) { zRangeOp = ts + 19499 /* ">? AND rowid<" */ - } else if (flags & WHERE_BTM_LIMIT) != 0 { + } else if (flags & U32(WHERE_BTM_LIMIT)) != 0 { zRangeOp = ts + 19346 /* ">" */ } else { @@ -137017,7 +137017,7 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } Xsqlite3_str_appendf(tls, bp+56, /* &str */ ts+19513 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp)) - } else if (flags & WHERE_VIRTUALTABLE) != U32(0) { + } else if (flags & U32(WHERE_VIRTUALTABLE)) != U32(0) { Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19551, /* " VIRTUAL TABLE I..." */ libc.VaList(bp+40, *(*int32)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)), *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)))) } @@ -137073,7 +137073,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14 var nLoop int32 = 0 for (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_CODED) == 0) && - (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (((*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady & (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll) == uint64(0)) { if (nLoop != 0) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKE) != 0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_LIKECOND)) @@ -137141,7 +137141,7 @@ func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i) if (int32(Xsqlite3CompareAffinity(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB) || (Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i)))) != 0) { - *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = int8(SQLITE_AFF_BLOB) } } } @@ -137266,7 +137266,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp var nEq int32 = 0 var aiMap uintptr = uintptr(0) - if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0))) && (*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)))).FaSortOrder + uintptr(iEq))) != 0) { @@ -137289,15 +137289,15 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp } *(*int32)(unsafe.Pointer(bp /* iTab */)) = 0 - if (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), uintptr(0), bp /* &iTab */) + if (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp /* &iTab */) } else { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pX = removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint64(unsafe.Sizeof(int32(0))) * uint64(nEq)))) - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), aiMap, bp /* &iTab */) + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp /* &iTab */) (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiTable = *(*int32)(unsafe.Pointer(bp /* iTab */)) } Xsqlite3ExprDelete(tls, db, pX) @@ -137315,7 +137315,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp return OP_Rewind }(), *(*int32)(unsafe.Pointer(bp /* iTab */)), 0) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_ABLE) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_ABLE)) if *(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) == 0 { (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = Xsqlite3VdbeMakeLabel(tls, pParse) } @@ -137347,19 +137347,19 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp *(*int32)(unsafe.Pointer(pIn /* &.iCur */)) = *(*int32)(unsafe.Pointer(bp /* iTab */)) *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() if iEq > 0 { *(*int32)(unsafe.Pointer(pIn + 8 /* &.iBase */)) = (iReg - i) *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = i - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_EARLYOUT) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_EARLYOUT)) } else { *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = 0 } } else { - *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = OP_Noop + *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = U8(OP_Noop) } pIn += 20 } @@ -137486,13 +137486,13 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } } if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 { - if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & U32(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 // sqlite3FindInIndex() routine has already ensured that the // affinity of the comparison has been applied to the value. if zAff != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ISNULL) == 0 { @@ -137503,10 +137503,10 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } if zAff != 0 { if int32(Xsqlite3CompareAffinity(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j))))) == SQLITE_AFF_BLOB { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } if Xsqlite3ExprNeedsNoAffinityChange(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j)))) != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } @@ -137575,7 +137575,7 @@ func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, i func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:142602:13: */ if (p != 0) && (Xsqlite3ExprIsVector(tls, p) != 0) { - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_xIsSelect)) != 0 { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var iSelect int32 @@ -137623,7 +137623,7 @@ func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FpIdxExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) == 0 { preserveExpr(tls, pX, pExpr) (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3ExprAffinity(tls, pExpr) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCur (*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) @@ -137823,8 +137823,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regYield, addrBrk) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Goto - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Goto) + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0) { // Case 1: The table is a virtual-table. Use the VFilter and VNext // to access the data. var iReg int32 // P3 Value for OP_VFilter @@ -137863,9 +137863,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass != 0 { - return OP_Noop + return uint8(OP_Noop) } - return OP_VNext + return uint8(OP_VNext) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v) iIn = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) @@ -137918,7 +137918,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // simpler and safer to simply not reuse the registers. // // sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_IN | WHERE_COLUMN_EQ))) != U32(0)) { // Case 2: We can directly reference a single row using an // equality comparison against the ROWID field. Or @@ -137935,12 +137935,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI addrNxt = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iCur, addrNxt, iRowidReg) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) == uint64(0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED)) } - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_COLUMN_RANGE) != U32(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != U32(0)) { // Case 3: We have an inequality comparison against the ROWID field. var testOp int32 = OP_Noop var start int32 @@ -137950,10 +137950,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI j = 0 pStart = libc.AssignUintptr(&pEnd, uintptr(0)) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } @@ -137973,10 +137973,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // The following constant maps TK_xx codes into corresponding // seek opcodes. It depends on a particular ordering of TK_xx *(*[4]U8)(unsafe.Pointer(bp + 8 /* aMoveOp */)) = [4]U8{ - /* TK_GT */ OP_SeekGT, - /* TK_LE */ OP_SeekLE, - /* TK_LT */ OP_SeekLT, - /* TK_GE */ OP_SeekGE, + /* TK_GT */ U8(OP_SeekGT), + /* TK_LE */ U8(OP_SeekLE), + /* TK_LT */ U8(OP_SeekLT), + /* TK_GE */ U8(OP_SeekGE), } // Make sure the ordering.. // ... of the TK_xx values... @@ -138037,9 +138037,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI start = Xsqlite3VdbeCurrentAddr(tls, v) (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start @@ -138051,7 +138051,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeChangeP5(tls, v, (uint16(SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL))) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0 { var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) // Number of == or IN terms var nBtm U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) // Length of BTM vector var nTop U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) // Length of TOP vector @@ -138079,7 +138079,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Find any inequality constraint terms for the start and end // of the range. j = int32(nEq) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))) { @@ -138090,7 +138090,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Like optimization range constraints always occur in pairs } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))) { @@ -138113,7 +138113,7 @@ func Xsqlite3WhereCodeOneLoopStart(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 (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_TOP_LIMIT | WHERE_BTM_LIMIT))) == U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) != U32(0)) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) != U32(0)) { nExtraReg = 1 bSeekPastNull = U8(1) @@ -138207,7 +138207,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // above has already left the cursor sitting on the correct row, // so no further seeking is needed } else { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_SeekHit, iIdxCur) } if regBignull != 0 { @@ -138290,16 +138290,16 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != 0 { Xsqlite3VdbeAddOp2(tls, v, OP_SeekHit, iIdxCur, 1) } // Seek the table cursor, if required - omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && + omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0))) if omitTable != 0 { // pIdx is a covering index. No need to access the main table. - } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0) { + } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_TABLE) != 0) || (((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_UNIQ_TABLE) != 0) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_SINGLE) || (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) == 0))) { @@ -138360,29 +138360,29 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } // Record the instruction used to terminate the loop. - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) != 0 { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else if bRev != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Prev + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Prev) } else { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Next + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Next) } (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iIdxCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp3 = func() uint8 { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_UNQ_WANTED) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_UNQ_WANTED)) != U32(0) { return uint8(1) } return uint8(0) }() - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) == U32(0) { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) == U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } else { } if omitTable != 0 { pIdx = uintptr(0) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { // Case 5: Two or more separately indexed terms connected by OR // // Example: @@ -138444,7 +138444,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) /* &.wc */) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Return + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Return) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn // Set up a new SrcList in pOrTab containing the table being scanned @@ -138481,7 +138481,7 @@ func Xsqlite3WhereCodeOneLoopStart(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((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DUPLICATES_OK) == 0 { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowset) } else { @@ -138575,7 +138575,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } return ii }() - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, regRowid) jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_RowSetTest, regRowset, 0, regRowid, iSet) @@ -138613,7 +138613,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, regRowset, regRowid, r, nPk) if iSet != 0 { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } } @@ -138652,9 +138652,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // be available. pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 920 /* &.a */))).FpWLoop - if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & WHERE_INDEXED) != U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0)) && ((ii == 0) || (*(*uintptr)(unsafe.Pointer((pSubLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) == pCov))) && - ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { + ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) } else { @@ -138691,14 +138691,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0 { // Tables marked isRecursive have only a single row that is stored in // a pseudo-cursor. No need to Rewind or Next such cursors. - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else { (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = aStep[bRev] (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = (1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt)) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } } @@ -138743,7 +138743,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __2 } @@ -138828,7 +138828,7 @@ __4: goto __5 } if (((int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator) & WO_IN) != 0) && - (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & EP_xIsSelect) != 0)) && + (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0)) && ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 32 /* &.x */)))).FpEList)).FnExpr > 1) { goto __5 } @@ -138888,21 +138888,21 @@ __6: var aStartOp = [8]U8{ U8(0), U8(0), - OP_Rewind, // 2: (!start_constraints && startEq && !bRev) - OP_Last, // 3: (!start_constraints && startEq && bRev) - OP_SeekGT, // 4: (start_constraints && !startEq && !bRev) - OP_SeekLT, // 5: (start_constraints && !startEq && bRev) - OP_SeekGE, // 6: (start_constraints && startEq && !bRev) - OP_SeekLE, // 7: (start_constraints && startEq && bRev) + U8(OP_Rewind), // 2: (!start_constraints && startEq && !bRev) + U8(OP_Last), // 3: (!start_constraints && startEq && bRev) + U8(OP_SeekGT), // 4: (start_constraints && !startEq && !bRev) + U8(OP_SeekLT), // 5: (start_constraints && !startEq && bRev) + U8(OP_SeekGE), // 6: (start_constraints && startEq && !bRev) + U8(OP_SeekLE), // 7: (start_constraints && startEq && bRev) } /* sqlite3.c:143140:21 */ var aEndOp = [4]U8{ - OP_IdxGE, // 0: (end_constraints && !bRev && !endEq) - OP_IdxGT, // 1: (end_constraints && !bRev && endEq) - OP_IdxLE, // 2: (end_constraints && bRev && !endEq) - OP_IdxLT, // 3: (end_constraints && bRev && endEq) -} /* sqlite3.c:143150:21 */ -var aStep = [2]U8{OP_Next, OP_Prev} /* sqlite3.c:143816:21 */ -var aStart = [2]U8{OP_Rewind, OP_Last} /* sqlite3.c:143817:21 */ + U8(OP_IdxGE), // 0: (end_constraints && !bRev && !endEq) + U8(OP_IdxGT), // 1: (end_constraints && !bRev && endEq) + U8(OP_IdxLE), // 2: (end_constraints && bRev && !endEq) + U8(OP_IdxLT), // 3: (end_constraints && bRev && endEq) +} /* sqlite3.c:143150:21 */ +var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)} /* sqlite3.c:143816:21 */ +var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)} /* sqlite3.c:143817:21 */ // Deallocate all memory associated with a WhereOrInfo object. func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144024:13: */ @@ -138955,7 +138955,7 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint64(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint64(unsafe.Sizeof(WhereTerm{})))) } pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*64) - if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Unlikely)) != U32(0)) { + if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Unlikely))) != U32(0)) { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = (LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270)) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1) @@ -138982,7 +138982,7 @@ func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3. if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR) || (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR)) || (Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (EP_Commuted) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (U32(EP_Commuted)) } { var t uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight @@ -139002,11 +139002,11 @@ func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */ var c U16 if op == TK_IN { - c = WO_IN + c = U16(WO_IN) } else if op == TK_ISNULL { - c = WO_ISNULL + c = U16(WO_ISNULL) } else if op == TK_IS { - c = WO_IS + c = U16(WO_IS) } else { c = (U16(int32(WO_EQ) << (op - TK_EQ))) @@ -139050,10 +139050,10 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr) op = int32((*Expr)(unsafe.Pointer(pRight)).Fop) - if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var pReprepare uintptr = (*Parse)(unsafe.Pointer(pParse)).FpReprepare var iCol int32 = int32((*Expr)(unsafe.Pointer(pRight)).FiColumn) - pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, SQLITE_AFF_BLOB) + pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, uint8(SQLITE_AFF_BLOB)) if (pVal != 0) && (Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT) { z = Xsqlite3_value_text(tls, pVal) } @@ -139120,13 +139120,13 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr var isNum int32 // var rDummy float64 at bp+8, 8 - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) if isNum <= 0 { if (iTo == 1) && (int32(*(*int8)(unsafe.Pointer(zNew))) == '-') { isNum = +1 } else { *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))++ - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))-- } } @@ -139275,13 +139275,13 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft *(*uintptr)(unsafe.Pointer(ppRight)) = pRight if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_NE + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOT + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOTNULL + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) } return res } @@ -139295,17 +139295,17 @@ type Op2 = struct { } /* sqlite3.c:144350:18 */ var aOp = [4]Op2{ - {FzOp: ts + 14159 /* "match" */, FeOp2: SQLITE_INDEX_CONSTRAINT_MATCH}, - {FzOp: ts + 13636 /* "glob" */, FeOp2: SQLITE_INDEX_CONSTRAINT_GLOB}, - {FzOp: ts + 13196 /* "like" */, FeOp2: SQLITE_INDEX_CONSTRAINT_LIKE}, - {FzOp: ts + 19602 /* "regexp" */, FeOp2: SQLITE_INDEX_CONSTRAINT_REGEXP}, + {FzOp: ts + 14159 /* "match" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)}, + {FzOp: ts + 13636 /* "glob" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)}, + {FzOp: ts + 13196 /* "like" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)}, + {FzOp: ts + 19602 /* "regexp" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)}, } /* sqlite3.c:144353:7 */ // If the pBase expression originated in the ON or USING clause of // a join, then transfer the appropriate markings over to derived. func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:144447:13: */ if pDerived != 0 { - *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & EP_FromJoin) + *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pDerived)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pBase)).FiRightJoinTable } } @@ -139506,7 +139506,7 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) pOrWc = (pOrInfo /* &.wc */) libc.X__builtin___memset_chk(tls, pOrWc+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})), libc.X__builtin_object_size(tls, pOrWc+40 /* &.aStatic */, 0)) Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo) - Xsqlite3WhereSplit(tls, pOrWc, pExpr, TK_OR) + Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(TK_OR)) Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return @@ -139534,11 +139534,11 @@ __1: var b Bitmask = uint64(0) *(*uintptr)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) = pAndInfo *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) |= U16((TERM_ANDINFO)) - (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = WO_AND + (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(WO_AND) pAndWC = (pAndInfo /* &.wc */) libc.X__builtin___memset_chk(tls, pAndWC+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})), libc.X__builtin_object_size(tls, pAndWC+40 /* &.aStatic */, 0)) Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo) - Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, TK_AND) + Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(TK_AND)) Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC) (*WhereClause)(unsafe.Pointer(pAndWC)).FpOuter = pWC if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { @@ -139598,10 +139598,10 @@ __3: // empty. (*WhereOrInfo)(unsafe.Pointer(pOrInfo)).Findexable = indexable if indexable != 0 { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) (*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(1) } else { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) } // For a two-way OR, attempt to implementation case 2. @@ -139809,7 +139809,7 @@ func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS) { return 0 } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return 0 } aff1 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) @@ -139974,7 +139974,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) @@ -139989,7 +139989,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect != 0 { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_VARSELECT)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)) prereqAll = prereqAll | (x) extraRight = (x - uint64(1)) // ON clause terms may not be used with an index @@ -140010,9 +140010,9 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pRight uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var opMask U16 if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & prereqLeft) == uint64(0) { - opMask = WO_ALL + opMask = uint16(WO_ALL) } else { - opMask = WO_EQUIV + opMask = uint16(WO_EQUIV) } if (*WhereTerm)(unsafe.Pointer(pTerm)).FiField > 0 { @@ -140055,7 +140055,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if termIsEquivalence(tls, pParse, pDup) != 0 { *(*U16)(unsafe.Pointer(pTerm + 20 /* &.eOperator */)) |= U16((WO_EQUIV)) - eExtraOp = WO_EQUIV + eExtraOp = U16(WO_EQUIV) } } else { pDup = pExpr @@ -140202,8 +140202,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pNewExpr uintptr pNewExpr = Xsqlite3PExpr(tls, pParse, TK_MATCH, uintptr(0), Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)), 0)) - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && (pNewExpr != 0) { - *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (EP_FromJoin) + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (pNewExpr != 0) { + *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pNewExpr)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable } idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) @@ -140212,7 +140212,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = prereqExpr (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiTable *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiColumn) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = WO_AUX + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(WO_AUX) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeMatchOp = *(*uint8)(unsafe.Pointer(bp + 24 /* eOp2 */)) markTermAsChild(tls, pWC, idxNew, idxTerm) pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) @@ -140239,8 +140239,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS))) && ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) && (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) && - ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & EP_xIsSelect) == U32(0)) || - (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & EP_xIsSelect) == U32(0))) { + ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & U32(EP_xIsSelect)) == U32(0)) || + (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & U32(EP_xIsSelect)) == U32(0))) { var i int32 for i = 0; i < nLeft; i++ { var idxNew int32 @@ -140250,7 +140250,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight) transferJoinMarkings(tls, pNew, pExpr) - idxNew = whereClauseInsert(tls, pWC, pNew, TERM_DYNAMIC) + idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC)) exprAnalyze(tls, pSrc, pWC, idxNew) } pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) @@ -140273,7 +140273,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var i int32 for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ { var idxNew int32 - idxNew = whereClauseInsert(tls, pWC, pExpr, TERM_VIRTUAL) + idxNew = whereClauseInsert(tls, pWC, pExpr, uint16(TERM_VIRTUAL)) (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64)).FiField = (i + 1) exprAnalyze(tls, pSrc, pWC, idxNew) markTermAsChild(tls, pWC, idxNew, idxTerm) @@ -140289,7 +140289,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if ((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN)) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { var pNewExpr uintptr var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft @@ -140322,7 +140322,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s *(*Bitmask)(unsafe.Pointer(pTerm + 48 /* &.prereqRight */)) |= (extraRight) } -var ops = [2]U8{TK_GE, TK_LE} /* sqlite3.c:145161:21 */ +var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:145161:21 */ // ************************************************************************** // @@ -140411,7 +140411,7 @@ __3: // tree. func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145504:24: */ var mask Bitmask - if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FixedCol)) != U32(0)) { + if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FixedCol))) != U32(0)) { return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable) } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { @@ -140428,8 +140428,8 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { mask = mask | (Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight)) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_VarSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_VarSelect))) != U32(0) { (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 1 } mask = mask | (exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))) @@ -140522,7 +140522,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 { Xsqlite3SetJoinExpr(tls, pTerm, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) } - whereClauseInsert(tls, pWC, pTerm, TERM_DYNAMIC) + whereClauseInsert(tls, pWC, pTerm, uint16(TERM_DYNAMIC)) } } @@ -140822,7 +140822,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 ((int32(iColumn) != (-2)) || (Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0))) && - ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) { + ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) { if (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) != 0) && (int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < (int32(uint64(unsafe.Sizeof([11]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) && (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight))))).Fop) == @@ -141087,7 +141087,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui continue } for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ { - if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), WO_EQ, pIdx) { + if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), uint32(WO_EQ), pIdx) { if findIndexCol(tls, pParse, pDistinct, iBase, pIdx, i) < 0 { break } @@ -141139,16 +141139,16 @@ __1: goto __2 } if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Copy + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Copy) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = ((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister) (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { if iAutoidxCur != 0 { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Sequence + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Sequence) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = iAutoidxCur } else { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 0 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } @@ -141181,7 +141181,7 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm return 0 } if (((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IS) != 0) { // Cannot use an IS term from the WHERE clause as an index driver for // the RHS of a LEFT JOIN. Such a term can only be used if it is from @@ -141267,7 +141267,7 @@ __1: // table of a LEFT JOIN if !(((((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq == uint64(0)) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VIRTUAL) == 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) != 0)) { goto __4 } @@ -141488,14 +141488,14 @@ __29: } iContinue = Xsqlite3VdbeMakeLabel(tls, pParse) Xsqlite3ExprIfFalse(tls, pParse, pPartial, iContinue, SQLITE_JUMPIFNULL) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_PARTIALIDX) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_PARTIALIDX)) __30: ; regRecord = Xsqlite3GetTempReg(tls, pParse) regBase = Xsqlite3GenerateIndexKey(tls, pParse, pIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0) Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) if !(pPartial != 0) { goto __31 } @@ -141514,7 +141514,7 @@ __31: goto __33 __32: Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (addrTop + 1)) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_STMTSTATUS_AUTOINDEX) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX)) __33: ; Xsqlite3VdbeJumpHere(tls, v, addrTop) @@ -141642,7 +141642,7 @@ __4: // right-hand table of a LEFT JOIN. See tag-20191211-001 for the // equivalent restriction for ordinary tables. if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __5 } @@ -141650,15 +141650,15 @@ __4: (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiTermOffset = i op = (U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL)) if int32(op) == WO_IN { - op = WO_EQ + op = U16(WO_EQ) } if int32(op) == WO_AUX { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp } else if (int32(op) & (WO_ISNULL | WO_IS)) != 0 { if int32(op) == WO_ISNULL { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_ISNULL + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) } else { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_IS + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) } } else { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = U8(op) @@ -141907,7 +141907,7 @@ func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol i if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) { if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } @@ -142357,11 +142357,11 @@ func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */ // Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147476:13: */ if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & (U32(WHERE_VIRTUALTABLE | WHERE_AUTO_INDEX))) != 0 { - if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { + if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */))) *(*U8)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0) - } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzColAff) Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -142415,9 +142415,9 @@ func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 } libc.X__builtin___memcpy_chk(tls, pTo, pFrom, uint64((uintptr(0) + 48 /* &.nLSlot */)), libc.X__builtin_object_size(tls, pTo, 0)) libc.X__builtin___memcpy_chk(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint64(unsafe.Sizeof(uintptr(0)))), libc.X__builtin_object_size(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, 0)) - if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { *(*U8)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) - } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_AUTO_INDEX) != U32(0) { + } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0) { *(*uintptr)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) } return SQLITE_OK @@ -142435,7 +142435,7 @@ func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147 for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ { var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(i)*88) - if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_IN_ABLE) != 0) { + if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 8 /* &.aInLoop */))) } } @@ -142495,8 +142495,8 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { return 0 } // X not a subset of Y since term X[i] not used by Y } - if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) { + if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) { return 0 // Constraint (5) } return 1 // All conditions meet @@ -142515,14 +142515,14 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { // WHERE clause terms than Y and that every WHERE clause term used by X is // also used by Y. func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:147623:13: */ - if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { return } for ; p != 0; p = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop { if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) { continue } - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_INDEXED) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { continue } if whereLoopCheaperProperSubset(tls, p, pTemplate) != 0 { @@ -142578,10 +142578,10 @@ __1: // Any loop using an appliation-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 ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && + if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && ((int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip)) == 0)) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) != U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_COLUMN_EQ) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_COLUMN_EQ)) != U32(0))) && (((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) { goto __3 } @@ -142713,7 +142713,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { } } rc = whereLoopXfer(tls, db, p, pTemplate) - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) { var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) if (pIndex != 0) && ((int32(*(*uint16)(unsafe.Pointer(pIndex + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK) { *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -142863,7 +142863,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr var pColl uintptr // Comparison collation sequence var pLhs uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr var pRhs uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight - if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & U32(EP_xIsSelect)) != 0 { pRhs = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr } else { pRhs = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -142941,7 +142941,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb return SQLITE_NOMEM } - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { opMask = ((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))) } else { @@ -142988,7 +142988,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // be used by the right table of a LEFT JOIN. Only constraints in the // ON clause are allowed. See tag-20191211-002 for the vtab equivalent. if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { continue } @@ -143010,7 +143010,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if (int32(eOp) & WO_IN) != 0 { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows var i int32 nIn = 46 @@ -143061,22 +143061,22 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb } } - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_IN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_IN)) } else if (int32(eOp) & (WO_EQ | WO_IS)) != 0 { var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_EQ) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_EQ)) if (iCol == (-1)) || (((iCol >= 0) && (int32(nInMul) == 0)) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1))) { if ((iCol == (-1)) || ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0)) || (((int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1) && ((*Index)(unsafe.Pointer(pProbe)).FonError != 0)) && (int32(eOp) == WO_EQ)) { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_UNQ_WANTED) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_UNQ_WANTED)) } } } else if (int32(eOp) & WO_ISNULL) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_NULL) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_NULL)) } else if (int32(eOp) & ((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0 { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT)) @@ -143093,7 +143093,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb break } // OOM *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_TOP_LIMIT) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_TOP_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(1) } } else { @@ -143102,7 +143102,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(whereRangeVectorLen(tls, pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) pTop = pTerm - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != U32(0) { pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2))*8)) } else { pBtm = uintptr(0) @@ -143115,7 +143115,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // "x IN(...)" terms are replaced with "x = ?". This block updates // the value of pNew->nOut to account for pTerm (but not nIn/nInMul). - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { // Adjust nOut using stat4 data. Or, if there is no stat4 // data, using some other estimate. whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew) @@ -143131,7 +143131,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if ((((int32(nInMul) == 0) && ((*Index)(unsafe.Pointer(pProbe)).FnSample != 0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol)) && - (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_xIsSelect)) != U32(0)))) && + (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0)))) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (int32(eOp) & ((WO_EQ | WO_ISNULL) | WO_IS)) != 0 { @@ -143196,13 +143196,13 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb whereLoopOutputAdjust(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize) rc = whereLoopInsert(tls, pBuilder, pNew) - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut } else { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted } - if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_TOP_LIMIT) == U32(0)) && + if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_TOP_LIMIT)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn)) { whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nInMul) + nIn))) } @@ -143241,7 +143241,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */))++ (*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_SKIPSCAN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_SKIPSCAN)) nIter = (LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))))) *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((int32(nIter))) // TUNING: Because uncertainties in the estimates for skip-scan queries, @@ -143312,7 +143312,7 @@ func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintpt } pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpRight } - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableQPSG) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableQPSG)) != 0 { pParse = uintptr(0) } i = 0 @@ -143324,8 +143324,8 @@ __1: { var pExpr uintptr pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == iTab)) && - ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == iTab)) && + ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0) { return 1 } @@ -143408,7 +143408,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { if (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex != 0 { // An INDEXED BY clause specifies a particular index to use pProbe = (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pProbe = (*Table)(unsafe.Pointer(pTab)).FpIndex } else { // There is no INDEXED BY clause. Create a fake Index object in local @@ -143421,10 +143421,10 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { (*Index)(unsafe.Pointer(bp /* &sPk */)).FnColumn = U16(1) (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiColumn = bp + 152 /* &aiColumnPk */ (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiRowLogEst = bp + 154 /* &aiRowEstPk[0] */ - (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = OE_Replace + (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = U8(OE_Replace) (*Index)(unsafe.Pointer(bp /* &sPk */)).FpTable = pTab (*Index)(unsafe.Pointer(bp /* &sPk */)).FszIdxRow = (*Table)(unsafe.Pointer(pTab)).FszTabRow - libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, SQLITE_IDXTYPE_IPK, 0, 0x3) + libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3) *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */ + 1*2)) = int16(0) pFirst = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FpIndex @@ -143441,10 +143441,10 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // Automatic indexes if ((((((!(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) && // Not part of an OR optimization ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & SQLITE_AutoIndex) != uint64(0))) && + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & uint64(SQLITE_AutoIndex)) != uint64(0))) && ((*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex == uintptr(0))) && // Has no INDEXED BY clause !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) && // Has no NOT INDEXED clause - (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) + (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isCorrelated */)) & 0x8 >> 3)) != 0)) && // Not a correlated subquery !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5)) != 0) { // Generate auto-index WhereLoops @@ -143469,7 +143469,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // those objects, since there is no opportunity to add schema // indexes on subqueries and views. (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = (LogEst(int32(rLogSize) + int32(rSize))) - if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) == U32(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) == U32(0)) { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) += int16((28)) } else { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) -= int16((10)) @@ -143484,7 +143484,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // not be unreasonable to make this value much larger. (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43) (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, (*WhereLoop)(unsafe.Pointer(pNew)).FnOut) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_AUTO_INDEX + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_AUTO_INDEX) (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) rc = whereLoopInsert(tls, pBuilder, pNew) } @@ -143525,7 +143525,7 @@ __1: if (int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK { // Integer primary key index - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_IPK + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IPK) // Full table scan (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 { @@ -143554,13 +143554,13 @@ __1: if m == uint64(0) { return (uint32(WHERE_IDX_ONLY | WHERE_INDEXED)) } - return WHERE_INDEXED + return uint32(WHERE_INDEXED) }() } // Full scan via index if ((((b != 0) || - !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0))) || ((uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0)) || ((((((m == uint64(0)) && @@ -143626,7 +143626,7 @@ __1: // unique index is used (making the index functionally non-unique) // then the sqlite_stat1 data becomes important for scoring the // plan - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_StatsUsed) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_StatsUsed)) } Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec) (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0 @@ -143828,7 +143828,7 @@ __6: // Set the WHERE_ONEROW flag if the xBestIndex() method indicated // that the scan will visit at most one row. Clear it otherwise. if ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags & SQLITE_INDEX_SCAN_UNIQUE) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW))) } @@ -143918,7 +143918,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus return SQLITE_NOMEM } (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_VIRTUALTABLE + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_VIRTUALTABLE) (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0) *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) nConstraint = (*Sqlite3_index_info)(unsafe.Pointer(p)).FnConstraint @@ -143947,7 +143947,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0 { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) mBestNoIn = ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq) if mBestNoIn == uint64(0) { @@ -144004,7 +144004,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if (rc == SQLITE_OK) && (seenZeroNoIN == 0) { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, mPrereq, WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) } } @@ -144066,7 +144066,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable } else if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur { (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpWInfo = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpOuter = pWC - (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = TK_AND + (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = U8(TK_AND) (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FnTerm = 1 (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fa = pOrTerm (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpWC = bp + 112 /* &tempWC */ @@ -144105,7 +144105,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable } (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1) *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_MULTI_OR + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_MULTI_OR) (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0) libc.X__builtin___memset_chk(tls, (pNew + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct { @@ -144157,7 +144157,7 @@ func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:14921 // Loop over the tables in the join, from left to right pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew whereLoopInit(tls, pNew) - (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = SQLITE_QUERY_PLANNER_LIMIT + (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = uint32(SQLITE_QUERY_PLANNER_LIMIT) iTab = 0 pItem = pTabList + 8 /* &.a */ __1: @@ -144167,7 +144167,7 @@ __1: { var mUnusable Bitmask = uint64(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab) - *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (SQLITE_QUERY_PLANNER_LIMIT_INCR) + *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR)) (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 { // This condition is true when pItem is the FROM clause term on the @@ -144306,7 +144306,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else { pLoop = pLast } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { if (*(*I8)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.vtab */) + 5 /* &.isOrdered */)) != 0) && ((int32(wctrlFlags) & WHERE_DISTINCTBY) == 0) { obSat = obDone } @@ -144360,8 +144360,8 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, obSat = obSat | (Bitmask((uint64(1))) << (i)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0) { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != 0 { pIndex = uintptr(0) nKeyCol = U16(0) nColumn = U16(1) @@ -144372,7 +144372,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, nColumn = (*Index)(unsafe.Pointer(pIndex)).FnColumn isOrderDistinct = (U8(libc.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != OE_None) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_SKIPSCAN) == U32(0))))) + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_SKIPSCAN)) == U32(0))))) } // Loop through all columns of the index and deal with the ones @@ -144497,7 +144497,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } if (isMatch != 0) && ((int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0) { if j == int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_BIGNULL_SORT) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_BIGNULL_SORT)) } else { isMatch = U8(0) } @@ -144776,7 +144776,7 @@ __3: if ((*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf & (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop) != uint64(0) { continue } - if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { + if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { // Do not use an automatic index if the this loop is expected // to run less than 1.25 times. It is tempting to also exclude // automatic index usage on an outer loop, but sometimes an automatic @@ -144968,16 +144968,16 @@ __3: // var notUsed Bitmask at bp+8, 8 var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom, - WHERE_DISTINCTBY, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) + uint16(WHERE_DISTINCTBY), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4) if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) != 0 { if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } else { (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = (*WherePath)(unsafe.Pointer(pFrom)).FisOrdered @@ -144986,11 +144986,11 @@ __3: (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0) if nLoop > 0 { var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)))).FwsFlags - if ((wsFlags & WHERE_ONEROW) == U32(0)) && + if ((wsFlags & U32(WHERE_ONEROW)) == U32(0)) && ((wsFlags & (U32(WHERE_IPK | WHERE_COLUMN_IN))) != (U32(WHERE_IPK | WHERE_COLUMN_IN))) { *(*Bitmask)(unsafe.Pointer(bp + 16 /* m */)) = uint64(0) var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, - WHERE_ORDERBY_LIMIT, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) + uint16(WHERE_ORDERBY_LIMIT), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4) @@ -145098,7 +145098,7 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32((WHERE_COLUMN_EQ | WHERE_ONEROW) | WHERE_INDEXED)) if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IDX_ONLY) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IDX_ONLY)) } (*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(j) *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(j) @@ -145119,7 +145119,7 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr) } if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) } return 1 } @@ -145128,7 +145128,7 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: // Helper function for exprIsDeterministic(). func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:150168:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) == 0) { + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) == 0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -145378,7 +145378,7 @@ __4: // subexpression is separated by an AND operator. (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0 Xsqlite3WhereClauseInit(tls, (pWInfo + 104 /* &.sWC */), pWInfo) - Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, TK_AND) + Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, uint8(TK_AND)) // Special case: No FROM clause if !(nTabList == 0) { @@ -145393,7 +145393,7 @@ __7: if !((int32(wctrlFlags) & WHERE_WANT_DISTINCT) != 0) { goto __8 } - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) __8: ; Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19837 /* "SCAN CONSTANT RO..." */, 0) @@ -145480,7 +145480,7 @@ __15: goto __19 } // The DISTINCT marking is pointless. Ignore it. - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) goto __20 __19: if !(pOrderBy == uintptr(0)) { @@ -145559,7 +145559,7 @@ __29: ; __22: ; - if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReverseOrder) != uint64(0))) { + if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReverseOrder)) != uint64(0))) { goto __31 } (*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1)) @@ -145627,7 +145627,7 @@ __35: __38: ; if !(((int32(wctrlFlags) & WHERE_WANT_DISTINCT) == 0) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0))) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0))) { goto __39 } goto __36 @@ -145648,7 +145648,7 @@ __41: if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) { goto __44 } - if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) || + if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || (int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable) != (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)) { goto __45 } @@ -145742,17 +145742,17 @@ __33: } (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 { if bOnerow != 0 { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_MULTI + return uint8(ONEPASS_MULTI) }() - if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { + if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { goto __54 } if !((int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW) != 0) { goto __55 } - bFordelete = OPFLAG_FORDELETE + bFordelete = U8(OPFLAG_FORDELETE) __55: ; (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))) @@ -145776,13 +145776,13 @@ __56: pTab = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { + if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __59 } // Do nothing goto __60 __59: - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) { goto __61 } pVTab = Xsqlite3GetVTable(tls, db, pTab) @@ -145796,7 +145796,7 @@ __61: // noop goto __64 __63: - if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) && + if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) { goto __65 } @@ -145851,14 +145851,14 @@ __62: ; __60: ; - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0) { goto __72 } pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) op1 = OP_OpenRead // iAuxArg is always set to a positive value if ONEPASS is possible - if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && + if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0)) { goto __73 } @@ -145908,14 +145908,14 @@ __74: } Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx) - if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) != U32(0)) && + if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_RANGE | WHERE_SKIPSCAN))) == U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) == U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) == U32(0))) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ORDERBY_MIN) == 0)) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED)) { goto __82 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SEEKEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ)) __82: ; @@ -145955,7 +145955,7 @@ __85: } pLevel = ((pWInfo + 920 /* &.a */) + uintptr(ii)*88) wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) - if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) { + if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) { goto __88 } constructAutomaticIndex(tls, pParse, (pWInfo + 104 /* &.sWC */), @@ -146031,7 +146031,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * var n int32 if (((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED) && (i == (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1))) && // Ticket [ef9318757b152e3] 2017-10-21 - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && ((uint32(int32(*(*uint16)(unsafe.Pointer((libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))) + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0)) && ((libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */))))) > 0)) && (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36) { @@ -146067,7 +146067,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * } else { Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont) } - if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_ABLE) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { + if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { var pIn uintptr var j int32 Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt) @@ -146092,10 +146092,10 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * // jump over the OP_Next or OP_Prev instruction about to // be coded. Xsqlite3VdbeAddOp2(tls, v, OP_IfNotOpen, (*InLoop)(unsafe.Pointer(pIn)).FiCur, - ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0))))) + ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0))))) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) { Xsqlite3VdbeAddOp4Int(tls, v, OP_IfNoHope, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), (*InLoop)(unsafe.Pointer(pIn)).FiBase, (*InLoop)(unsafe.Pointer(pIn)).FnPrefix) @@ -146187,11 +146187,11 @@ __4: // reference the index. if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_INDEXED | WHERE_IDX_ONLY))) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */)) } if ((pIdx != 0) && - ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)))) && + ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)))) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { last = Xsqlite3VdbeCurrentAddr(tls, v) k = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody @@ -146208,7 +146208,7 @@ __4: (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset) { var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab) x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2))) @@ -146225,7 +146225,7 @@ __4: } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_IdxRowid + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_IdxRowid) } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNullRow { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146895,7 +146895,7 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0)) || ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1)) { Xsqlite3ErrorMsg(tls, pParse, ts+20073 /* "RANGE with offse..." */, 0) - } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0 { + } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0 { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 { Xsqlite3ErrorMsg(tls, pParse, @@ -146976,7 +146976,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { case TK_FUNCTION: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { break } else { var pWin uintptr @@ -147006,19 +147006,19 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in if iCol < 0 { var pDup uintptr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) if (pDup != 0) && (int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION) { - (*Expr)(unsafe.Pointer(pDup)).Fop = TK_FUNCTION + (*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_FUNCTION) } (*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) } if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { - var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Collate)) + var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Static))) libc.X__builtin___memset_chk(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, pExpr, 0)) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 { if iCol < 0 { return (int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1)) @@ -147118,11 +147118,11 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui // var iDummy int32 at bp, 4 var pSub uintptr - for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (EP_Skip)) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { + for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (U32(EP_Skip))) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { } if Xsqlite3ExprIsInteger(tls, pSub, bp /* &iDummy */) != 0 { - (*Expr)(unsafe.Pointer(pSub)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pSub)).Fop = U8(TK_NULL) *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(((EP_IntValue | EP_IsTrue) | EP_IsFalse)))) *(*uintptr)(unsafe.Pointer(pSub + 8 /* &.u */)) = uintptr(0) } @@ -147160,7 +147160,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* defer tls.Free(56) var rc int32 = SQLITE_OK - if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_WinRewrite) == U32(0)) { + if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_WinRewrite)) == U32(0)) { var v uintptr = Xsqlite3GetVdbe(tls, pParse) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSub uintptr = uintptr(0) // The subquery @@ -147190,7 +147190,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* (*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_WinRewrite) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(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 @@ -147234,7 +147234,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // results. for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var pArgs uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) - if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_SUBTYPE) != 0 { + if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_SUBTYPE)) != 0 { selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp+48 /* &pSublist */) (*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 { if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) != 0 { @@ -147279,9 +147279,9 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* var pTab2 uintptr (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(p)).FpSrc) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (SF_Expanded) - pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, SQLITE_AFF_NONE) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & SF_Aggregate) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) + pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, int8(SQLITE_AFF_NONE)) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & U32(SF_Aggregate)) if pTab2 == uintptr(0) { // Might actually be some other kind of error, but in that case // pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get @@ -147289,7 +147289,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* rc = SQLITE_NOMEM } else { libc.X__builtin___memcpy_chk(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{})), libc.X__builtin_object_size(tls, pTab, 0)) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab pTab = pTab2 libc.X__builtin___memset_chk(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})), libc.X__builtin_object_size(tls, bp /* &w */, 0)) @@ -147426,7 +147426,7 @@ __3: if !((int32(eExclude) == 0) && ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_WindowFunc)) != 0)) { goto __4 } - eExclude = TK_NO + eExclude = U8(TK_NO) __4: ; (*Window)(unsafe.Pointer(pWin)).FeExclude = eExclude @@ -147501,9 +147501,9 @@ func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr if p != 0 { *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) = pWin - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_WinFunc) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_WinFunc)) (*Window)(unsafe.Pointer(pWin)).FpOwner = p - if (((*Expr)(unsafe.Pointer(p)).Fflags & EP_Distinct) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Distinct)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { Xsqlite3ErrorMsg(tls, pParse, ts+20325 /* "DISTINCT is not ..." */, 0) } @@ -147606,7 +147606,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var p uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { // The inline versions of min() and max() require a single ephemeral // table and 3 registers. The registers are used as follows: // @@ -147620,7 +147620,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (3) if (pKeyInfo != 0) && (int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + 1))) == 'i') { - *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = KEYINFO_ORDER_DESC + *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = U8(KEYINFO_ORDER_DESC) } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 2) Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9) @@ -147779,7 +147779,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse regArg = reg if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { var addrIsNull int32 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regArg) @@ -147828,7 +147828,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } } } - if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) + 8 /* &.a */))).FpExpr) @@ -147867,7 +147867,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888: for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult) Xsqlite3VdbeAddOp1(tls, v, OP_Last, (*Window)(unsafe.Pointer(pWin)).FcsrApp) @@ -148105,7 +148105,7 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) } - if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { + if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*Window)(unsafe.Pointer(pWin)).FcsrApp) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) @@ -148285,7 +148285,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal // control skips over this test if the BIGNULL flag is set and either // reg1 or reg2 contain a NULL value. Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) Xsqlite3ReleaseTempReg(tls, pParse, reg1) Xsqlite3ReleaseTempReg(tls, pParse, reg2) @@ -148393,7 +148393,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn if op == (*WindowCodeArg)(unsafe.Pointer(p)).FeDelete { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, csr) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } if jumpOnEof != 0 { @@ -148499,7 +148499,7 @@ func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* s var ret int32 = 0 var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, SQLITE_AFF_NUMERIC, bp /* &pVal */) + Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uint8(SQLITE_AFF_NUMERIC), bp /* &pVal */) if (*(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0) && (Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) > 0) { ret = 1 } @@ -149276,7 +149276,7 @@ func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlit } { (*Select)(unsafe.Pointer(pLoop)).FpNext = pNext - *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (SF_Compound) + *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (U32(SF_Compound)) } goto __2 @@ -149288,7 +149288,7 @@ func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlit goto __3 __3: ; - if ((((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { + if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { Xsqlite3ErrorMsg(tls, pParse, ts+20578 /* "too many terms i..." */, 0) } } @@ -149308,7 +149308,7 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq // memset(p, 0, sizeof(Expr)); (*Expr)(unsafe.Pointer(p)).Fop = U8(op) (*Expr)(unsafe.Pointer(p)).FaffExpr = int8(0) - (*Expr)(unsafe.Pointer(p)).Fflags = EP_Leaf + (*Expr)(unsafe.Pointer(p)).Fflags = U32(EP_Leaf) (*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1) (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+24 /* &.pRight */, uintptr(0)) @@ -151634,7 +151634,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(38): /* ccons ::= UNIQUE onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(39): /* ccons ::= CHECK LP expr RP */ @@ -151771,7 +151771,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(67): /* tcons ::= UNIQUE LP sortlist RP onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(68): /* tcons ::= CHECK LP expr RP onconf */ @@ -151826,7 +151826,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(82): /* cmd ::= select */ { - *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: SRT_Output} + *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(SRT_Output)} Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), bp+24 /* &dest */) Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } @@ -151922,7 +151922,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(92): /* values ::= VALUES LP nexprlist RP */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_Values, uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) } break case uint32(93): /* values ::= values COMMA LP nexprlist RP */ @@ -151934,7 +151934,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))) } if pRight != 0 { - (*Select)(unsafe.Pointer(pRight)).Fop = TK_ALL + (*Select)(unsafe.Pointer(pRight)).Fop = U8(TK_ALL) (*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pRight } else { @@ -152064,7 +152064,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } else { var pSubquery uintptr Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) - pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_NestedFrom, uintptr(0)) + pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0)) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } @@ -152510,7 +152510,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break @@ -152527,7 +152527,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break @@ -152734,7 +152734,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { Xsqlite3CreateIndex(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), - (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), SQLITE_IDXTYPE_APPDEF) + (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), uint8(SQLITE_IDXTYPE_APPDEF)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0) { Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) } @@ -152928,7 +152928,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 { - (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = OE_Ignore + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = int8(OE_Ignore) } } break @@ -153194,7 +153194,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{}))) if *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0 { - (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = TK_FILTER + (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = U8(TK_FILTER) (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } else { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) @@ -153599,35 +153599,35 @@ var aKWOffset = [145]uint16{ } /* sqlite3.c:159521:33 */ // aKWCode[i] is the parser symbol code for the i-th keyword var aKWCode = [145]uint8{ - TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE, - TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN, - TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD, - TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE, - TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE, - TK_EXCLUDE, TK_DELETE, TK_TEMP, TK_TEMP, TK_OR, - TK_ISNULL, TK_NULLS, TK_SAVEPOINT, TK_INTERSECT, TK_TIES, - TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW, - TK_EXCEPT, TK_TRANSACTION, TK_ACTION, TK_ON, TK_JOIN_KW, - TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, - TK_INTO, TK_OFFSET, TK_OF, TK_SET, TK_TRIGGER, - TK_RANGE, TK_GENERATED, TK_DETACH, TK_HAVING, TK_LIKE_KW, - TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY, - TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH, - TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE, - TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE, - TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH, - TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT, TK_UPDATE, - TK_VALUES, TK_VIRTUAL, TK_ALWAYS, TK_WHEN, TK_WHERE, - TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND, TK_DEFERRED, - TK_DISTINCT, TK_IS, TK_AUTOINCR, TK_TO, TK_IN, - TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, - TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DROP, - TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER, TK_REPLACE, - TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_LIMIT, - TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER, - TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW, TK_UNBOUNDED, - TK_UNION, TK_USING, TK_VACUUM, TK_VIEW, TK_WINDOW, - TK_DO, TK_BY, TK_INITIALLY, TK_ALL, TK_PRIMARY, + uint8(TK_REINDEX), uint8(TK_INDEXED), uint8(TK_INDEX), uint8(TK_DESC), uint8(TK_ESCAPE), + uint8(TK_EACH), uint8(TK_CHECK), uint8(TK_KEY), uint8(TK_BEFORE), uint8(TK_FOREIGN), + uint8(TK_FOR), uint8(TK_IGNORE), uint8(TK_LIKE_KW), uint8(TK_EXPLAIN), uint8(TK_INSTEAD), + uint8(TK_ADD), uint8(TK_DATABASE), uint8(TK_AS), uint8(TK_SELECT), uint8(TK_TABLE), + uint8(TK_JOIN_KW), uint8(TK_THEN), uint8(TK_END), uint8(TK_DEFERRABLE), uint8(TK_ELSE), + uint8(TK_EXCLUDE), uint8(TK_DELETE), uint8(TK_TEMP), uint8(TK_TEMP), uint8(TK_OR), + uint8(TK_ISNULL), uint8(TK_NULLS), uint8(TK_SAVEPOINT), uint8(TK_INTERSECT), uint8(TK_TIES), + uint8(TK_NOTNULL), uint8(TK_NOT), uint8(TK_NO), uint8(TK_NULL), uint8(TK_LIKE_KW), + uint8(TK_EXCEPT), uint8(TK_TRANSACTION), uint8(TK_ACTION), uint8(TK_ON), uint8(TK_JOIN_KW), + uint8(TK_ALTER), uint8(TK_RAISE), uint8(TK_EXCLUSIVE), uint8(TK_EXISTS), uint8(TK_CONSTRAINT), + uint8(TK_INTO), uint8(TK_OFFSET), uint8(TK_OF), uint8(TK_SET), uint8(TK_TRIGGER), + uint8(TK_RANGE), uint8(TK_GENERATED), uint8(TK_DETACH), uint8(TK_HAVING), uint8(TK_LIKE_KW), + uint8(TK_BEGIN), uint8(TK_JOIN_KW), uint8(TK_REFERENCES), uint8(TK_UNIQUE), uint8(TK_QUERY), + uint8(TK_WITHOUT), uint8(TK_WITH), uint8(TK_JOIN_KW), uint8(TK_RELEASE), uint8(TK_ATTACH), + uint8(TK_BETWEEN), uint8(TK_NOTHING), uint8(TK_GROUPS), uint8(TK_GROUP), uint8(TK_CASCADE), + uint8(TK_ASC), uint8(TK_DEFAULT), uint8(TK_CASE), uint8(TK_COLLATE), uint8(TK_CREATE), + uint8(TK_CTIME_KW), uint8(TK_IMMEDIATE), uint8(TK_JOIN), uint8(TK_INSERT), uint8(TK_MATCH), + uint8(TK_PLAN), uint8(TK_ANALYZE), uint8(TK_PRAGMA), uint8(TK_ABORT), uint8(TK_UPDATE), + uint8(TK_VALUES), uint8(TK_VIRTUAL), uint8(TK_ALWAYS), uint8(TK_WHEN), uint8(TK_WHERE), + uint8(TK_RECURSIVE), uint8(TK_AFTER), uint8(TK_RENAME), uint8(TK_AND), uint8(TK_DEFERRED), + uint8(TK_DISTINCT), uint8(TK_IS), uint8(TK_AUTOINCR), uint8(TK_TO), uint8(TK_IN), + uint8(TK_CAST), uint8(TK_COLUMNKW), uint8(TK_COMMIT), uint8(TK_CONFLICT), uint8(TK_JOIN_KW), + uint8(TK_CTIME_KW), uint8(TK_CTIME_KW), uint8(TK_CURRENT), uint8(TK_PARTITION), uint8(TK_DROP), + uint8(TK_PRECEDING), uint8(TK_FAIL), uint8(TK_LAST), uint8(TK_FILTER), uint8(TK_REPLACE), + uint8(TK_FIRST), uint8(TK_FOLLOWING), uint8(TK_FROM), uint8(TK_JOIN_KW), uint8(TK_LIMIT), + uint8(TK_IF), uint8(TK_ORDER), uint8(TK_RESTRICT), uint8(TK_OTHERS), uint8(TK_OVER), + uint8(TK_JOIN_KW), uint8(TK_ROLLBACK), uint8(TK_ROWS), uint8(TK_ROW), uint8(TK_UNBOUNDED), + uint8(TK_UNION), uint8(TK_USING), uint8(TK_VACUUM), uint8(TK_VIEW), uint8(TK_WINDOW), + uint8(TK_DO), uint8(TK_BY), uint8(TK_INITIALLY), uint8(TK_ALL), uint8(TK_PRIMARY), } /* sqlite3.c:159536:28 */ // Hash table decoded: @@ -154654,7 +154654,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: switch int32(*(*int8)(unsafe.Pointer(zSql))) { case ';': { // A semicolon - token = TkSEMI + token = U8(TkSEMI) break } @@ -154668,14 +154668,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case '\f': { // White space is ignored - token = TkWS + token = U8(TkWS) break } case '/': { // C-style comments if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '*' { - token = TkOTHER + token = U8(TkOTHER) break } zSql += uintptr(2) @@ -154686,14 +154686,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: return 0 } zSql++ - token = TkWS + token = U8(TkWS) break } case '-': { // SQL-style comments from "--" to end of line if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '-' { - token = TkOTHER + token = U8(TkOTHER) break } for (*(*int8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*int8)(unsafe.Pointer(zSql))) != '\n') { @@ -154702,7 +154702,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return (libc.Bool32(int32(state) == 1)) } - token = TkWS + token = U8(TkWS) break } @@ -154715,7 +154715,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -154733,7 +154733,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -154750,9 +154750,9 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: case 'C': { if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+21051 /* "create" */, 6) == 0) { - token = TkCREATE + token = U8(TkCREATE) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -154763,13 +154763,13 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: case 'T': { if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+17886 /* "trigger" */, 7) == 0) { - token = TkTRIGGER + token = U8(TkTRIGGER) } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+21058 /* "temp" */, 4) == 0) { - token = TkTEMP + token = U8(TkTEMP) } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+21063 /* "temporary" */, 9) == 0) { - token = TkTEMP + token = U8(TkTEMP) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -154780,11 +154780,11 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: case 'E': { if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+21073 /* "end" */, 3) == 0) { - token = TkEND + token = U8(TkEND) } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+21077 /* "explain" */, 7) == 0) { - token = TkEXPLAIN + token = U8(TkEXPLAIN) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -154792,7 +154792,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough default: { - token = TkOTHER + token = U8(TkOTHER) break } @@ -154800,7 +154800,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: zSql += (uintptr(nId - 1)) } else { // Operators and special symbols - token = TkOTHER + token = U8(TkOTHER) } break @@ -154838,8 +154838,8 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16088 return rc } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zSql, SQLITE_UTF16LE, uintptr(0)) - zSql8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zSql, uint8(SQLITE_UTF16LE), uintptr(0)) + zSql8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zSql8 != 0 { rc = Xsqlite3_complete(tls, zSql8) } else { @@ -155326,11 +155326,11 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // silently truncated if necessary so that it does not exceed the // compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE // compile-time option. - if (mxMmap < int64(0)) || (mxMmap > SQLITE_MAX_MMAP_SIZE) { - mxMmap = SQLITE_MAX_MMAP_SIZE + if (mxMmap < int64(0)) || (mxMmap > int64(SQLITE_MAX_MMAP_SIZE)) { + mxMmap = int64(SQLITE_MAX_MMAP_SIZE) } if szMmap < int64(0) { - szMmap = SQLITE_DEFAULT_MMAP_SIZE + szMmap = int64(SQLITE_DEFAULT_MMAP_SIZE) } if szMmap > mxMmap { szMmap = mxMmap @@ -155414,10 +155414,10 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32 } if sz >= (LOOKASIDE_SMALL * 3) { nBig = (int32(szAlloc / (Sqlite3_int64((3 * LOOKASIDE_SMALL) + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz >= (LOOKASIDE_SMALL * 2) { nBig = (int32(szAlloc / (Sqlite3_int64(LOOKASIDE_SMALL + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz > 0 { nBig = (int32(szAlloc / Sqlite3_int64(sz))) nSm = 0 @@ -155590,22 +155590,22 @@ var aFlagOp = [16]struct { Fop int32 Fmask U32 }{ - {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: SQLITE_ForeignKeys}, - {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: SQLITE_EnableTrigger}, + {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: U32(SQLITE_ForeignKeys)}, + {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: U32(SQLITE_EnableTrigger)}, {Fop: SQLITE_DBCONFIG_ENABLE_VIEW, Fmask: SQLITE_EnableView}, - {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: SQLITE_Fts3Tokenizer}, - {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: SQLITE_LoadExtension}, - {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: SQLITE_NoCkptOnClose}, - {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: SQLITE_EnableQPSG}, - {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: SQLITE_TriggerEQP}, - {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: SQLITE_ResetDatabase}, - {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: SQLITE_Defensive}, + {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: U32(SQLITE_Fts3Tokenizer)}, + {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: U32(SQLITE_LoadExtension)}, + {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: U32(SQLITE_NoCkptOnClose)}, + {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: U32(SQLITE_EnableQPSG)}, + {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: U32(SQLITE_TriggerEQP)}, + {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: U32(SQLITE_ResetDatabase)}, + {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: U32(SQLITE_Defensive)}, {Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: (U32(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, - {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: SQLITE_LegacyAlter}, - {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: SQLITE_DqsDDL}, - {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: SQLITE_DqsDML}, - {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: SQLITE_LegacyFileFmt}, - {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: SQLITE_TrustedSchema}, + {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: U32(SQLITE_LegacyAlter)}, + {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: U32(SQLITE_DqsDDL)}, + {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: U32(SQLITE_DqsDML)}, + {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: U32(SQLITE_LegacyFileFmt)}, + {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: U32(SQLITE_TrustedSchema)}, } /* sqlite3.c:161939:9 */ // This is the default collating function named "BINARY" which is always @@ -155781,7 +155781,7 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_CLOSE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_CLOSE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) } // Force xDisconnect calls on all virtual tables @@ -155805,7 +155805,7 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit } // Convert the connection into a zombie and then close it. - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_ZOMBIE + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_ZOMBIE) Xsqlite3LeaveMutexAndCloseZombie(tls, db) return SQLITE_OK } @@ -155838,7 +155838,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: // If there are outstanding sqlite3_stmt or sqlite3_backup objects // or if the connection has not yet been closed by sqlite3_close_v2(), // then just leave the mutex and return. - if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != SQLITE_MAGIC_ZOMBIE) || (connectionIsBusy(tls, db) != 0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != U32(SQLITE_MAGIC_ZOMBIE)) || (connectionIsBusy(tls, db) != 0) { Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return } @@ -155952,7 +155952,7 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // the database rollback and schema reset, which can cause false // corruption reports in some cases. Xsqlite3BtreeEnterAll(tls, db) - schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) + schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt @@ -155975,7 +155975,7 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // Any deferred constraint violations have now been resolved. (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) // If one has been configured, invoke the rollback-hook callback if ((*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0) && ((inTrans != 0) || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) { @@ -156213,7 +156213,7 @@ func Xsqlite3CreateFunc(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 = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(0)) - if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { + if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, ts+21709 /* "unable to delete..." */, 0) @@ -156238,7 +156238,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++ } *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) = pDestructor - (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) | U32(extraFlags)) + (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) | U32(extraFlags)) (*FuncDef)(unsafe.Pointer(p)).FxSFunc = func() uintptr { if xSFunc != 0 { @@ -156322,7 +156322,7 @@ func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, SQLITE_UTF16LE) + zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, uint8(SQLITE_UTF16LE)) rc = Xsqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3DbFree(tls, db, zFunc8) rc = Xsqlite3ApiExit(tls, db, rc) @@ -156365,7 +156365,7 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i var zCopy uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, SQLITE_UTF8, uint8(0)) != uintptr(0))) + rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0))) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if rc != 0 { return SQLITE_OK @@ -156393,7 +156393,7 @@ func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uin pOld = (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg (*Sqlite3)(unsafe.Pointer(db)).FmTrace = func() uint8 { if xTrace != 0 { - return SQLITE_TRACE_LEGACY + return uint8(SQLITE_TRACE_LEGACY) } return uint8(0) }() @@ -156923,7 +156923,7 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u zVfs = zDefaultVfs nUri = Xsqlite3Strlen30(tls, zUri) - if !(((((flags & SQLITE_OPEN_URI) != 0) || // IMP: R-48725-32206 + if !(((((flags & uint32(SQLITE_OPEN_URI)) != 0) || // IMP: R-48725-32206 (Xsqlite3Config.FbOpenUri != 0)) && // IMP: R-51689-46548 (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+21912 /* "file:" */, uint64(5)) == 0)) { goto __1 @@ -156933,7 +156933,7 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u // 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 = flags | (SQLITE_OPEN_URI) + flags = flags | (uint32(SQLITE_OPEN_URI)) iIn = 0 __3: @@ -157294,13 +157294,13 @@ __1: isThreadsafe = 0 goto __3 __2: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_NOMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_NOMUTEX)) != 0) { goto __4 } isThreadsafe = 0 goto __5 __4: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_FULLMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_FULLMUTEX)) != 0) { goto __6 } isThreadsafe = 1 @@ -157314,7 +157314,7 @@ __5: __3: ; - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_PRIVATECACHE) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_PRIVATECACHE)) != 0) { goto __8 } *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_SHAREDCACHE)) @@ -157323,7 +157323,7 @@ __8: if !(Xsqlite3Config.FsharedCacheEnabled != 0) { goto __10 } - *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= SQLITE_OPEN_SHAREDCACHE + *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= uint32(SQLITE_OPEN_SHAREDCACHE) __10: ; __9: @@ -157385,8 +157385,8 @@ __12: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(((((((uint32(SQLITE_ShortColNames | SQLITE_EnableTrigger)) | SQLITE_EnableView) | - SQLITE_CacheSpill) | - SQLITE_TrustedSchema) | + uint32(SQLITE_CacheSpill)) | + uint32(SQLITE_TrustedSchema)) | // The SQLITE_DQS compile-time option determines the default settings // for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML. // @@ -157401,10 +157401,10 @@ __12: // Legacy behavior is 3 (double-quoted string literals are allowed anywhere) // and so that is the default. But developers are encouranged to use // -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible. - SQLITE_DqsDML) | - SQLITE_DqsDDL) | + uint32(SQLITE_DqsDML)) | + uint32(SQLITE_DqsDDL)) | - SQLITE_AutoIndex)) + uint32(SQLITE_AutoIndex))) Xsqlite3HashInit(tls, (db + 600 /* &.aCollSeq */)) Xsqlite3HashInit(tls, (db + 528 /* &.aModule */)) @@ -157414,19 +157414,19 @@ __12: // // EVIDENCE-OF: R-52786-44878 SQLite defines three built-in collating // functions: - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16BE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16LE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, ts+19650 /* "NOCASE" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+19650 /* "NOCASE" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{nocaseCollatingFunc})), uintptr(0)) - createCollation(tls, db, ts+22056 /* "RTRIM" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+22056 /* "RTRIM" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{rtrimCollFunc})), uintptr(0)) if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -157483,7 +157483,7 @@ __18: // Open the backend database driver rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 16 /* zOpen */)), db, ((*Sqlite3)(unsafe.Pointer(db)).FaDb + 8 /* &.pBt */), 0, - (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | SQLITE_OPEN_MAIN_DB))) + (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | uint32(SQLITE_OPEN_MAIN_DB)))) if !(rc != SQLITE_OK) { goto __20 } @@ -157513,7 +157513,7 @@ __22: (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 5702 /* "main" */ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = (U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)) (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 21058 /* "temp" */ - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = PAGER_SYNCHRONOUS_OFF + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = U8(PAGER_SYNCHRONOUS_OFF) (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_OPEN if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -157598,7 +157598,7 @@ __31: if !(rc != SQLITE_OK) { goto __33 } - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_SICK + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_SICK) __33: ; __32: @@ -157633,14 +157633,14 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* zFilename = ts + 22062 /* "\x00\x00" */ } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, SQLITE_UTF16LE, uintptr(0)) - zFilename8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(SQLITE_UTF16LE), uintptr(0)) + zFilename8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zFilename8 != 0 { rc = openDatabase(tls, zFilename8, ppDb, (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0)) if (rc == SQLITE_OK) && !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) { - ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, SQLITE_UTF16LE) + ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, U8(SQLITE_UTF16LE)) } } else { rc = SQLITE_NOMEM @@ -157674,7 +157674,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, SQLITE_UTF16LE) + zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, uint8(SQLITE_UTF16LE)) if zName8 != 0 { rc = createCollation(tls, db, zName8, U8(enc), pCtx, xCompare, uintptr(0)) Xsqlite3DbFree(tls, db, zName8) @@ -157838,7 +157838,7 @@ __7: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __9 } - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { goto __10 } iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) @@ -157874,7 +157874,7 @@ __4: zCollSeq = (*Column)(unsafe.Pointer(pCol)).FzColl notnull = (libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0)) primarykey = (libc.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0)) - autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)))) + autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)))) goto __13 __12: zDataType = ts + 10927 /* "INTEGER" */ @@ -158253,7 +158253,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: { var db uintptr = libc.VaUintptr(&ap) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (DBFLAG_InternalFunc) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (U32(DBFLAG_InternalFunc)) break } @@ -159870,7 +159870,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 { var z uintptr = Xsqlite3_value_text(tls, pValue) var n U32 = U32(Xsqlite3_value_bytes(tls, pValue)) - if Xsqlite3_value_subtype(tls, pValue) == JSON_SUBTYPE { + if Xsqlite3_value_subtype(tls, pValue) == uint32(JSON_SUBTYPE) { jsonAppendRaw(tls, p, z, n) } else { jsonAppendString(tls, p, z, n) @@ -159901,7 +159901,7 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ } return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})) }(), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) jsonZero(tls, p) } @@ -160050,7 +160050,7 @@ func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr jsonInit(tls, bp /* &s */, pCtx) jsonRenderNode(tls, pNode, bp /* &s */, aReplace) jsonResult(tls, bp /* &s */) - Xsqlite3_result_subtype(tls, pCtx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, pCtx, uint32(JSON_SUBTYPE)) } // Translate a single byte of Hex into an integer. @@ -160195,7 +160195,7 @@ int_as_real: __6: z1 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) - Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), SQLITE_UTF8) + Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), uint8(SQLITE_UTF8)) Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp /* r */))) goto __1 @@ -160415,7 +160415,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } if (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i)))))) == '{' { // Parse object - iThis = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -160472,7 +160472,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 return (int32(j + U32(1))) } else if int32(c) == '[' { // Parse array - iThis = jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -160521,7 +160521,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 if ((((((((int32(c) == '"') || (int32(c) == '\\')) || (int32(c) == '/')) || (int32(c) == 'b')) || (int32(c) == 'f')) || (int32(c) == 'n')) || (int32(c) == 'r')) || (int32(c) == 't')) || ((int32(c) == 'u') && (jsonIs4Hex(tls, ((z+uintptr(j))+uintptr(1))) != 0)) { - jnFlags = JNODE_ESCAPE + jnFlags = U8(JNODE_ESCAPE) } else { return -1 } @@ -160530,7 +160530,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } j++ } - jsonParseAddNode(tls, pParse, JSON_STRING, ((j + U32(1)) - i), (z + uintptr(i))) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), ((j + U32(1)) - i), (z + uintptr(i))) if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) { (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)).FjnFlags = jnFlags } @@ -160538,17 +160538,17 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } else if ((int32(c) == 'n') && (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5502 /* "null" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 't') && (libc.Xstrncmp(tls, (z+uintptr(i)), ts+6913 /* "true" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 'f') && (libc.Xstrncmp(tls, (z+uintptr(i)), ts+6918 /* "false" */, uint64(5)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(5))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_FALSE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_FALSE), uint32(0), uintptr(0)) return (int32(i + U32(5))) } else if (int32(c) == '-') || ((int32(c) >= '0') && (int32(c) <= '9')) { // Parse number @@ -160606,9 +160606,9 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } jsonParseAddNode(tls, pParse, func() uint32 { if seenDP != 0 { - return JSON_REAL + return uint32(JSON_REAL) } - return JSON_INT + return uint32(JSON_INT) }(), (j - i), (z + uintptr(i))) return int32(j) @@ -160853,8 +160853,8 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp var iStart U32 var iLabel U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0))) - iLabel = U32(jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey)) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0))) + iLabel = U32(jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey)) zPath += uintptr(i) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { @@ -160943,7 +160943,7 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp if (i == U32(0)) && (pApnd != 0) { var iStart U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(1), uintptr(0))) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(1), uintptr(0))) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) @@ -160966,16 +160966,16 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186690:17: */ *(*int32)(unsafe.Pointer(pApnd)) = 1 if int32(*(*int8)(unsafe.Pointer(zPath))) == 0 { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } return ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16) } if int32(*(*int8)(unsafe.Pointer(zPath))) == '.' { - jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) } else if libc.Xstrncmp(tls, zPath, ts+22267 /* "[0]" */, uint64(3)) == 0 { - jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) } else { return uintptr(0) } @@ -161107,7 +161107,7 @@ func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq jsonInit(tls, bp /* &jx */, ctx) jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv))) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // Implementation of the json_array(VALUE,...) function. Return a JSON @@ -161128,7 +161128,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq } jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_array_length(JSON) @@ -161211,7 +161211,7 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* if (argc > 2) && (i == argc) { jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } jsonReset(tls, bp /* &jx */) } @@ -161265,9 +161265,9 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) if (j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn) && (int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*16)).FeType) != JSON_NULL) { var iStart int32 var iPatch int32 - iStart = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0)) - jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey) - iPatch = jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + iStart = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey) + iPatch = jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } @@ -161350,7 +161350,7 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s } jsonAppendChar(tls, bp /* &jx */, int8('}')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_remove(JSON, PATH, ...) @@ -161472,7 +161472,7 @@ __7: if !(pNode != 0) { goto __8 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __8: ; @@ -161569,7 +161569,7 @@ __9: if !((pNode != 0) && ((*(*int32)(unsafe.Pointer(bp + 48 /* bApnd */)) != 0) || (bIsSet != 0))) { goto __11 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __11: ; @@ -161683,7 +161683,7 @@ func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c: } else { Xsqlite3_result_text(tls, ctx, ts+22436 /* "[]" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187353:13: */ @@ -161787,7 +161787,7 @@ func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c } else { Xsqlite3_result_text(tls, ctx, ts+22439 /* "{}" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187460:13: */ @@ -162646,7 +162646,7 @@ func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:188649:13 // Given a node number iNode, return the corresponding key to use // in the Rtree.aHash table. func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:188658:21: */ - return ((uint32(iNode)) % HASHSIZE) + return ((uint32(iNode)) % uint32(HASHSIZE)) } // Search the node hash table for node iNode. If found, return a pointer @@ -163832,7 +163832,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -163891,7 +163891,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt } (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -163994,27 +163994,27 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql var op U8 switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) { case SQLITE_INDEX_CONSTRAINT_EQ: - op = RTREE_EQ + op = U8(RTREE_EQ) break fallthrough case SQLITE_INDEX_CONSTRAINT_GT: - op = RTREE_GT + op = U8(RTREE_GT) break fallthrough case SQLITE_INDEX_CONSTRAINT_LE: - op = RTREE_LE + op = U8(RTREE_LE) break fallthrough case SQLITE_INDEX_CONSTRAINT_LT: - op = RTREE_LT + op = U8(RTREE_LT) break fallthrough case SQLITE_INDEX_CONSTRAINT_GE: - op = RTREE_GE + op = U8(RTREE_GE) break fallthrough case SQLITE_INDEX_CONSTRAINT_MATCH: - op = RTREE_MATCH + op = U8(RTREE_MATCH) break fallthrough default: @@ -164985,7 +164985,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei var rc int32 = SQLITE_OK var n int32 - libc.X__builtin___memset_chk(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * RTREE_MAX_DIMENSIONS), libc.X__builtin_object_size(tls, bp /* &aCenterCoord[0] */, 0)) + libc.X__builtin___memset_chk(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * uint64(RTREE_MAX_DIMENSIONS)), libc.X__builtin_object_size(tls, bp /* &aCenterCoord[0] */, 0)) nCell = (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) + 1) n = ((nCell + 1) & (libc.CplInt32(1))) @@ -165625,7 +165625,7 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit rc = Xsqlite3_table_column_metadata(tls, db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+9660 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == SQLITE_ERROR { return SQLITE_OK } @@ -165647,13 +165647,13 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit if rc == SQLITE_OK { if nRow == int64(0) { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) } else { (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 { - if (nRow) > (RTREE_MIN_ROWEST) { + if (nRow) > (int64(RTREE_MIN_ROWEST)) { return nRow } - return RTREE_MIN_ROWEST + return int64(RTREE_MIN_ROWEST) }() } } @@ -166862,7 +166862,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit // is available // var r float64 at bp, 8 - Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, SQLITE_UTF8) + Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, uint8(SQLITE_UTF8)) *(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp /* r */))) } *(*uintptr)(unsafe.Pointer(p /* &.z */)) += (uintptr(j)) @@ -168145,7 +168145,7 @@ __1: (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule)) (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + 1*968) (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + int64(1)))) - (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = RTREE_COORD_REAL32 + (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(RTREE_COORD_REAL32) (*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2) (*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4) libc.X__builtin___memcpy_chk(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb), libc.X__builtin_object_size(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, 0)) @@ -168297,7 +168297,7 @@ func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -168388,7 +168388,7 @@ __12: ; (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -168872,11 +168872,11 @@ func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20 }{rtreecheck})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_REAL32 + var c uintptr = uintptr(RTREE_COORD_REAL32) rc = Xsqlite3_create_module_v2(tls, db, ts+25260 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_INT32 + var c uintptr = uintptr(RTREE_COORD_INT32) rc = Xsqlite3_create_module_v2(tls, db, ts+25548 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { @@ -170812,7 +170812,6 @@ __15: goto __14 goto __16 __16: - } // This is a helper function for rbuObjIterCacheTableInfo(). It populates @@ -177662,7 +177661,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_OK var nCmd int32 = int32(libc.Xstrlen(tls, zCmd)) if Xsqlite3_strnicmp(tls, ts+30164 /* "prefix" */, zCmd, nCmd) == 0 { - var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * FTS5_MAX_PREFIX_INDEXES)) + var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * uint64(FTS5_MAX_PREFIX_INDEXES))) var p uintptr var bFirst int32 = 1 if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -182674,7 +182673,7 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 if rc == SQLITE_OK { var aOut uintptr = uintptr(0) // Read blob data into this buffer var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader) - var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + FTS5_DATA_PADDING)) + var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + uint64(FTS5_DATA_PADDING))) pRet = Xsqlite3_malloc64(tls, uint64(nAlloc)) if pRet != 0 { (*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte @@ -182980,10 +182979,10 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c: // Configuration cookie var pData uintptr - pData = fts5DataRead(tls, p, FTS5_STRUCTURE_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_STRUCTURE_ROWID)) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { // TODO: Do we need this if the leaf-index is appended? Probably... - libc.X__builtin___memset_chk(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, FTS5_DATA_PADDING, libc.X__builtin_object_size(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0)) + libc.X__builtin___memset_chk(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, uint64(FTS5_DATA_PADDING), libc.X__builtin_object_size(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0)) (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp /* &iCookie */, bp+8 /* &pRet */) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0) || ((*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp /* iCookie */)))) { (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp /* iCookie */))) @@ -183110,7 +183109,7 @@ func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3. } } - fts5DataWrite(tls, p, FTS5_STRUCTURE_ROWID, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) + fts5DataWrite(tls, p, int64(FTS5_STRUCTURE_ROWID), (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) sqlite3Fts5BufferFree(tls, bp /* &buf */) } } @@ -185100,7 +185099,7 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, } return sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), pBuf, (uint32(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + FTS5_DATA_ZERO_PADDING) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn))) }()) { - libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, FTS5_DATA_ZERO_PADDING, libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0)) + libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, uint64(FTS5_DATA_ZERO_PADDING), libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0)) if pColset == uintptr(0) { fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32) @@ -186757,7 +186756,7 @@ func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBu *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (nData) } - libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, FTS5_DATA_ZERO_PADDING, libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0)) + libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, uint64(FTS5_DATA_ZERO_PADDING), libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0)) } } @@ -187172,7 +187171,7 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, } fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) - pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + FTS5_DATA_ZERO_PADDING))) + pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + uint64(FTS5_DATA_ZERO_PADDING)))) if pData != 0 { (*Fts5Data)(unsafe.Pointer(pData)).Fp = (pData + 1*16) (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+12 /* &.szLeaf */, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn) @@ -187241,7 +187240,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22158 fts5StructureInvalidate(tls, p) fts5IndexDiscardData(tls, p) libc.X__builtin___memset_chk(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Fts5Structure{})), libc.X__builtin_object_size(tls, bp /* &s */, 0)) - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, ts+713 /* "" */, 0) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+713 /* "" */, 0) fts5StructureWrite(tls, p, bp /* &s */) return fts5IndexReturn(tls, p) } @@ -187518,7 +187517,7 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize *(*I64)(unsafe.Pointer(pnRow)) = int64(0) libc.X__builtin___memset_chk(tls, anSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64(nCol)), libc.X__builtin_object_size(tls, anSize, 0)) - pData = fts5DataRead(tls, p, FTS5_AVERAGES_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID)) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0) { var i int32 = 0 var iCol int32 @@ -187536,7 +187535,7 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize // supplied as the second argument. func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:221923:12: */ - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, pData, nData) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData) return fts5IndexReturn(tls, p) } @@ -187564,7 +187563,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3Fts5Put32(tls, bp /* &aCookie[0] */, iNew) rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, - ts+31420 /* "block" */, FTS5_STRUCTURE_ROWID, 1, bp+8 /* &pBlob */) + ts+31420 /* "block" */, int64(FTS5_STRUCTURE_ROWID), 1, bp+8 /* &pBlob */) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)), bp /* &aCookie[0] */, 4, 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */))) @@ -187965,7 +187964,7 @@ func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sql fts5DecodeRowid(tls, iKey, bp+32 /* &iSegid */, bp+36 /* &bDlidx */, bp+40 /* &iHeight */, bp+44 /* &iPgno */) if *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)) == 0 { - if iKey == FTS5_AVERAGES_ROWID { + if iKey == int64(FTS5_AVERAGES_ROWID) { sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31903 /* "{averages} " */, 0) } else { sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31915 /* "{structure}" */, 0) @@ -188265,7 +188264,7 @@ __3: if !(*(*int32)(unsafe.Pointer(bp + 68 /* iSegid */)) == 0) { goto __8 } - if !(iRowid == FTS5_AVERAGES_ROWID) { + if !(iRowid == int64(FTS5_AVERAGES_ROWID)) { goto __10 } fts5DecodeAverages(tls, bp+64 /* &rc */, bp+48 /* &s */, a, n) @@ -189305,7 +189304,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u rc = SQLITE_NOMEM } else { rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+8 /* &pRet */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+8 /* &pRet */, uintptr(0)) if rc != SQLITE_OK { *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+2702 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) } @@ -189460,7 +189459,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+24 /* &pStmt */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+24 /* &pStmt */, uintptr(0)) Xsqlite3_free(tls, zSql) if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { @@ -194657,7 +194656,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -194666,13 +194665,13 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -194686,7 +194685,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -194717,7 +194716,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -194731,7 +194730,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -194740,7 +194739,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -194763,7 +194762,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) diff --git a/libtest/sqlite_darwin_arm64.go b/libtest/sqlite_darwin_arm64.go index b14beeb..967ea0b 100644 --- a/libtest/sqlite_darwin_arm64.go +++ b/libtest/sqlite_darwin_arm64.go @@ -15383,17 +15383,17 @@ var Xsqlite3CtypeMap = [256]uint8{ var Xsqlite3Config = Sqlite3Config{ // bMemstat FbCoreMutex: U8(1), // bCoreMutex FbFullMutex: (U8(libc.Bool32(SQLITE_THREADSAFE == 1))), // bOpenUri - FbUseCis: SQLITE_ALLOW_COVERING_INDEX_SCAN, // bSmallMalloc + FbUseCis: U8(SQLITE_ALLOW_COVERING_INDEX_SCAN), // bSmallMalloc FbExtraSchemaChecks: U8(1), // bExtraSchemaChecks FmxStrlen: 0x7ffffffe, // neverCorrupt FszLookaside: 1200, FnLookaside: 40, // szLookaside, nLookaside - FnStmtSpill: (64 * 1024), // szMmap - FmxMmap: SQLITE_MAX_MMAP_SIZE, // szPage - FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled - FszPma: SQLITE_SORTER_PMASZ, // pLogArg - FmxMemdbSize: SQLITE_MEMDB_DEFAULT_MAXSIZE, // bLocaltimeFault - FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold - FszSorterRef: SQLITE_DEFAULT_SORTERREF_SIZE, // iPrngSeed + FnStmtSpill: (64 * 1024), // szMmap + FmxMmap: int64(SQLITE_MAX_MMAP_SIZE), // szPage + FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled + FszPma: U32(SQLITE_SORTER_PMASZ), // pLogArg + FmxMemdbSize: int64(SQLITE_MEMDB_DEFAULT_MAXSIZE), // bLocaltimeFault + FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold + FszSorterRef: U32(SQLITE_DEFAULT_SORTERREF_SIZE), // iPrngSeed } /* sqlite3.c:20578:48 */ // Hash table for global functions - functions common to all @@ -16876,7 +16876,7 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i return 0 } else if (Xsqlite3StrICmp(tls, zDate, ts+412 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) { return setDateTimeToCurrent(tls, context, p) - } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), SQLITE_UTF8) > 0 { + } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp /* r */))) return 0 } @@ -17184,7 +17184,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i // weekday N where 0==Sunday, 1==Monday, and so forth. If the // date is already on the appropriate weekday, this is a no-op. if ((((Xsqlite3_strnicmp(tls, z, ts+497 /* "weekday " */, 8) == 0) && - (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), SQLITE_UTF8) > 0)) && + (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), uint8(SQLITE_UTF8)) > 0)) && ((float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) { var Z Sqlite3_int64 computeYMD_HMS(tls, p) @@ -17263,7 +17263,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i var i int32 for n = 1; ((*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ':')) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))]) & 0x01) != 0); n++ { } - if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, SQLITE_UTF8) <= 0 { + if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, uint8(SQLITE_UTF8)) <= 0 { *(*int32)(unsafe.Pointer(bp /* rc */)) = 1 break } @@ -19436,7 +19436,7 @@ func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite } return dbMallocRawFinish(tls, db, n) } - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ @@ -19471,7 +19471,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* if (Uptr(p)) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { return p } } else if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { @@ -19679,31 +19679,31 @@ type Et_info = et_info /* sqlite3.c:28197:3 */ var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 760 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28210:19 */ var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 793 /* "-x0\x00X0" */)) /* sqlite3.c:28211:19 */ var fmtinfo = [23]Et_info{ - {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtSTRING}, - {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(30)}, - {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtDYNSTRING}, - {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE}, - {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE2}, - {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtSQLESCAPE3}, - {Ffmttype: int8('c'), Ftype: EtCHARX}, + {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtByte(EtSTRING)}, + {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(30)}, + {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtByte(EtDYNSTRING)}, + {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE)}, + {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE2)}, + {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE3)}, + {Ffmttype: int8('c'), Ftype: EtByte(EtCHARX)}, {Ffmttype: int8('o'), Fbase: EtByte(8), Fprefix: EtByte(2)}, - {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtDECIMAL}, + {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtByte(EtDECIMAL)}, {Ffmttype: int8('x'), Fbase: EtByte(16), Fcharset: EtByte(16), Fprefix: EtByte(1)}, {Ffmttype: int8('X'), Fbase: EtByte(16), Fprefix: EtByte(4)}, - {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtFLOAT}, - {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(30)}, - {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(14)}, - {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(14)}, - {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('n'), Ftype: EtSIZE}, - {Ffmttype: int8('%'), Ftype: EtPERCENT}, - {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtPOINTER, Fprefix: EtByte(1)}, + {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtByte(EtFLOAT)}, + {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(30)}, + {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(14)}, + {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(14)}, + {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('n'), Ftype: EtByte(EtSIZE)}, + {Ffmttype: int8('%'), Ftype: EtByte(EtPERCENT)}, + {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtByte(EtPOINTER), Fprefix: EtByte(1)}, // All the rest are undocumented and are for internal use only - {Ffmttype: int8('T'), Ftype: EtTOKEN}, - {Ffmttype: int8('S'), Ftype: EtSRCLIST}, - {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtORDINAL}, + {Ffmttype: int8('T'), Ftype: EtByte(EtTOKEN)}, + {Ffmttype: int8('S'), Ftype: EtByte(EtSRCLIST)}, + {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtORDINAL)}, } /* sqlite3.c:28212:22 */ // Floating point constants used for rounding @@ -19786,12 +19786,12 @@ func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* return uintptr(0) } if (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc)) && (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc)) { - setStrAccumError(tls, pAccum, SQLITE_TOOBIG) + setStrAccumError(tls, pAccum, uint8(SQLITE_TOOBIG)) return uintptr(0) } z = Xsqlite3DbMallocRaw(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n)) if z == uintptr(0) { - setStrAccumError(tls, pAccum, SQLITE_NOMEM) + setStrAccumError(tls, pAccum, uint8(SQLITE_NOMEM)) } return z } @@ -19879,7 +19879,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_lis var pSrc uintptr var k1 int32 var pItem uintptr - xtype = EtINVALID + xtype = EtByte(EtINVALID) zExtra = uintptr(0) pArgList = uintptr(0) // Conversion buffer @@ -20145,7 +20145,7 @@ __14: // Fetch the info entry for the field infop = (uintptr(unsafe.Pointer(&fmtinfo))) - xtype = EtINVALID + xtype = EtByte(EtINVALID) idx = 0 __54: if !(idx < (int32(uint64(unsafe.Sizeof(fmtinfo)) / uint64(unsafe.Sizeof(Et_info{}))))) { @@ -20607,11 +20607,11 @@ __142: if !((exp < -4) || (exp > precision)) { goto __146 } - xtype = EtEXP + xtype = EtByte(EtEXP) goto __147 __146: precision = (precision - exp) - xtype = EtFLOAT + xtype = EtByte(EtFLOAT) __147: ; goto __145 @@ -20635,7 +20635,7 @@ __149: } return int64(0) }()) + I64(precision)) + I64(width)) + int64(15)) - if !(szBufNeeded > SQLITE_PRINT_BUF_SIZE) { + if !(szBufNeeded > int64(SQLITE_PRINT_BUF_SIZE)) { goto __150 } bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded)) @@ -20925,7 +20925,7 @@ __70: goto __198 } bufpt = getTextArg(tls, pArgList) - xtype = EtSTRING + xtype = EtByte(EtSTRING) goto __199 __198: bufpt = libc.VaUintptr(&ap) @@ -21268,7 +21268,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite return 0 } if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc == U32(0) { - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return (int32(((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar) - U32(1))) } else { var zOld uintptr @@ -21286,7 +21286,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite } if szNew > I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return 0 } else { (*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(int32(szNew)) @@ -21306,7 +21306,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) return 0 } } @@ -21367,7 +21367,7 @@ func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:2915 libc.X__builtin___memcpy_chk(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1))), libc.X__builtin_object_size(tls, zText, 0)) *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) } (*StrAccum)(unsafe.Pointer(p)).FzText = zText return zText @@ -21387,7 +21387,7 @@ func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:291 // sqlite3_malloc() fails to provide space for a real one. This // sqlite3_str object accepts no new text and always returns // an SQLITE_NOMEM error. -var sqlite3OomStr = Sqlite3_str{FaccError: SQLITE_NOMEM} /* sqlite3.c:29185:20 */ +var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)} /* sqlite3.c:29185:20 */ // Finalize a string created using sqlite3_str_new(). func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191:17: */ @@ -21489,7 +21489,7 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui Xsqlite3StrAccumInit(tls, bp /* &acc */, db, bp+32 /* &zBase[0] */, int32(unsafe.Sizeof([70]int8{})), *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = SQLITE_PRINTF_INTERNAL + (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) Xsqlite3_str_vappendf(tls, bp /* &acc */, zFormat, ap) z = Xsqlite3StrAccumFinish(tls, bp /* &acc */) if int32((*StrAccum)(unsafe.Pointer(bp /* &acc */)).FaccError) == SQLITE_NOMEM { @@ -22313,10 +22313,10 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: var b1 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz)) var b2 U8 = *(*U8)(unsafe.Pointer((((*Mem)(unsafe.Pointer(pMem)).Fz) + uintptr(1)))) if (int32(b1) == 0xFE) && (int32(b2) == 0xFF) { - bom = SQLITE_UTF16BE + bom = U8(SQLITE_UTF16BE) } if (int32(b1) == 0xFF) && (int32(b2) == 0xFE) { - bom = SQLITE_UTF16LE + bom = U8(SQLITE_UTF16LE) } } @@ -22775,7 +22775,7 @@ func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uin ap = va z = Xsqlite3VMPrintf(tls, db, zFormat, ap) _ = ap - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) } } @@ -22879,7 +22879,7 @@ func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31439:21: */ if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))))) == '"' { return (uint32(EP_Quoted | EP_DblQuoted)) } - return EP_Quoted + return uint32(EP_Quoted) }()) Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } @@ -23612,7 +23612,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq } return 2 } else { - return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) } return int32(0) } @@ -23834,7 +23834,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -23843,13 +23843,13 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -23863,7 +23863,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -23895,7 +23895,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -23909,7 +23909,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -23918,7 +23918,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -23941,7 +23941,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) @@ -24133,7 +24133,7 @@ func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548 func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32565:20: */ var magic U32 magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic - if ((magic != SQLITE_MAGIC_SICK) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { + if ((magic != U32(SQLITE_MAGIC_SICK)) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { logBadConnection(tls, ts+910 /* "invalid" */) return 0 @@ -24490,8 +24490,8 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:329 var elem uintptr var next_elem uintptr // For looping over existing elements - if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > SQLITE_MALLOC_SOFT_LIMIT { - new_size = (uint32(SQLITE_MALLOC_SOFT_LIMIT / uint64(unsafe.Sizeof(_ht{})))) + if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { + new_size = (uint32(uint64(SQLITE_MALLOC_SOFT_LIMIT) / uint64(unsafe.Sizeof(_ht{})))) } if new_size == (*Hash)(unsafe.Pointer(pH)).Fhtsize { return 0 @@ -33843,7 +33843,7 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 if m != 0 { m2 = m } else { - m2 = SQLITE_DEFAULT_FILE_PERMISSIONS + m2 = uint16(SQLITE_DEFAULT_FILE_PERMISSIONS) } for 1 != 0 { fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, z, (f | O_CLOEXEC), int32(m2)) @@ -34261,7 +34261,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql // in the header of every SQLite database. In this way, if there // is a race condition such that another thread has already populated // the first page of the database, no damage is done. - if ((*stat)(unsafe.Pointer(bp /* &statbuf */)).Fst_size == int64(0)) && (((*UnixFile)(unsafe.Pointer(pFile)).FfsFlags & SQLITE_FSFLAGS_IS_MSDOS) != uint32(0)) { + if ((*stat)(unsafe.Pointer(bp /* &statbuf */)).Fst_size == int64(0)) && (((*UnixFile)(unsafe.Pointer(pFile)).FfsFlags & uint32(SQLITE_FSFLAGS_IS_MSDOS)) != uint32(0)) { for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__error(tls)))) == EINTR)) { rc = int32((*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 11*24 + 8 /* &.pCurrent */))))(tls, fd, ts+4763 /* "S" */, uint64(1))) } @@ -34391,10 +34391,10 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / if !(reserved != 0) && !(int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FbProcessLock) != 0) { // var lock flock at bp+32, 24 - (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 1)) (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_GETLK, libc.VaList(bp, bp+32 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(14) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) @@ -34452,10 +34452,10 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite if int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { // var lock flock at bp+16, 24 - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = SHARED_SIZE - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = int64(SHARED_SIZE) + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = int16(F_WRLCK) rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK, libc.VaList(bp, bp+16 /* &lock */)) if rc < 0 { return rc @@ -34594,7 +34594,7 @@ __4: goto __5 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ goto end_lock @@ -34605,16 +34605,16 @@ __5: // acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will // be released. (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_whence = int16(SEEK_SET) if !((eFileLock == SHARED_LOCK) || ((eFileLock == EXCLUSIVE_LOCK) && (int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) < PENDING_LOCK))) { goto __6 } (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = func() int16 { if eFileLock == SHARED_LOCK { - return F_RDLCK + return int16(F_RDLCK) } - return F_WRLCK + return int16(F_WRLCK) }() (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = Off_t(Xsqlite3PendingByte) if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) { @@ -34642,7 +34642,7 @@ __6: // Now get the read-lock (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) { goto __11 } @@ -34654,7 +34654,7 @@ __11: // Drop the temporary PENDING lock (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = Off_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = F_UNLCK + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = int16(F_UNLCK) if !((unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) && (rc == SQLITE_OK)) { goto __12 } @@ -34676,7 +34676,7 @@ __15: goto end_lock goto __14 __13: - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared = 1 __14: @@ -34695,7 +34695,7 @@ __16: // assumed that there is a SHARED or greater lock on the file // already. ; - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = int16(F_WRLCK) if !(eFileLock == RESERVED_LOCK) { goto __18 @@ -34705,7 +34705,7 @@ __16: goto __19 __18: (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = int64(SHARED_SIZE) __19: ; @@ -34737,8 +34737,8 @@ __22: if !(eFileLock == EXCLUSIVE_LOCK) { goto __24 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = PENDING_LOCK - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = PENDING_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(PENDING_LOCK) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) __24: ; __23: @@ -34833,8 +34833,8 @@ __2: } // Error code from system call errors divSize = (int64(SHARED_SIZE - 1)) - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = divSize if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == (-1)) { @@ -34846,8 +34846,8 @@ __2: goto end_unlock __7: ; - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_RDLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_RDLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = divSize if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == (-1)) { @@ -34864,10 +34864,10 @@ __9: goto end_unlock __8: ; - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = ((Off_t(Xsqlite3PendingByte + 2)) + divSize) - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = (SHARED_SIZE - divSize) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = (int64(SHARED_SIZE) - divSize) if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == (-1)) { goto __10 } @@ -34880,10 +34880,10 @@ __10: goto __6 __5: - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_RDLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_RDLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = (Off_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp+48 /* &lock */) != 0) { goto __11 } @@ -34902,14 +34902,14 @@ __6: ; __4: ; - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = Off_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = 2 if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == 0) { goto __12 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = SHARED_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) goto __13 __12: rc = (SQLITE_IOERR | (int32(8) << 8)) @@ -34929,19 +34929,19 @@ __3: if !((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared == 0) { goto __15 } - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = libc.AssignPtrInt64(bp+48 /* &lock */ +8 /* &.l_len */, 0) if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == 0) { goto __16 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) goto __17 __16: rc = (SQLITE_IOERR | (int32(8) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) __17: ; __15: @@ -35227,7 +35227,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite // To downgrade to shared, simply update our internal notion of the // lock state. No need to mess with the file on disk. if eFileLock == SHARED_LOCK { - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) return SQLITE_OK } @@ -35244,7 +35244,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite } return rc } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) return SQLITE_OK } @@ -35435,7 +35435,7 @@ func flockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3. if robust_flock(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, LOCK_UN) != 0 { return (SQLITE_IOERR | (int32(8) << 8)) } else { - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) return SQLITE_OK } return int32(0) @@ -35564,7 +35564,7 @@ func afpSetLock(tls *libc.TLS, path uintptr, pFile uintptr, offset uint64, lengt return ts + 810 /* "" */ }(), offset, length)) } - err = libc.Xfsctl(tls, path, ((((uint64(0x80000000 | X__uint32_t(0x40000000))) | (uint64((uint64(unsafe.Sizeof(ByteRangeLockPB2{})) & IOCPARM_MASK)) << 16)) | (uint64(int32(('z')) << 8))) | (uint64(23))), bp+64 /* &pb */, uint32(0)) + err = libc.Xfsctl(tls, path, ((((uint64(0x80000000 | X__uint32_t(0x40000000))) | (uint64((uint64(unsafe.Sizeof(ByteRangeLockPB2{})) & uint64(IOCPARM_MASK))) << 16)) | (uint64(int32(('z')) << 8))) | (uint64(23))), bp+64 /* &pb */, uint32(0)) if err == -1 { var rc int32 var tErrno int32 = *(*int32)(unsafe.Pointer(libc.X__error(tls))) @@ -35738,7 +35738,7 @@ __4: goto __5 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ goto afp_end_lock @@ -35811,7 +35811,7 @@ __13: rc = lrc1 goto __16 __15: - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared = 1 __16: @@ -35861,7 +35861,7 @@ __19: failed2 = SQLITE_OK // now attemmpt to get the exclusive lock range failed1 = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, (uint64(Xsqlite3PendingByte + 2)), - SHARED_SIZE, 1) + uint64(SHARED_SIZE), 1) if !((failed1 != 0) && (libc.AssignInt32(&failed2, afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, ((uint64(Xsqlite3PendingByte+2))+(*UnixInodeInfo)(unsafe.Pointer(pInode)).FsharedByte), uint64(1), 1)) != 0)) { goto __24 @@ -35904,8 +35904,8 @@ __26: if !(eFileLock == EXCLUSIVE_LOCK) { goto __28 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = PENDING_LOCK - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = PENDING_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(PENDING_LOCK) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) __28: ; __27: @@ -35964,7 +35964,7 @@ func afpUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c: Xsqlite3_io_error_benign = 0 if int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) == EXCLUSIVE_LOCK { - rc = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, (uint64(Xsqlite3PendingByte + 2)), SHARED_SIZE, 0) + rc = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, (uint64(Xsqlite3PendingByte + 2)), uint64(SHARED_SIZE), 0) if (rc == SQLITE_OK) && ((eFileLock == SHARED_LOCK) || ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared > 1)) { // only re-establish the shared lock if necessary var sharedLockByte int32 = (int32((uint64(Xsqlite3PendingByte + 2)) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FsharedByte)) @@ -35983,7 +35983,7 @@ func afpUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c: } } if (rc == SQLITE_OK) && ((eFileLock == SHARED_LOCK) || ((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared > 1)) { - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = SHARED_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) } } if (rc == SQLITE_OK) && (eFileLock == NO_LOCK) { @@ -36004,8 +36004,8 @@ func afpUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c: rc = afpSetLock(tls, (*AfpLockingContext)(unsafe.Pointer(context)).FdbPath, pFile, sharedLockByte, uint64(1), 0) } if !(rc != 0) { - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) } } if rc == SQLITE_OK { @@ -36649,13 +36649,13 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { } case SQLITE_FCNTL_PERSIST_WAL: { - unixModeBit(tls, pFile, UNIXFILE_PERSIST_WAL, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PERSIST_WAL), pArg) return SQLITE_OK } case SQLITE_FCNTL_POWERSAFE_OVERWRITE: { - unixModeBit(tls, pFile, UNIXFILE_PSOW, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PSOW), pArg) return SQLITE_OK } @@ -36803,7 +36803,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, var res int32 // Initialize the locking parameters (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_type = int16(lockType) - (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = Off_t(ofst) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = Off_t(n) res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_SETLK, libc.VaList(bp, bp+8 /* &f */)) @@ -36896,10 +36896,10 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // 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. - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (int64(((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK)) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK, libc.VaList(bp, bp+8 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(15) << 8)) } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_UNLCK { @@ -37810,7 +37810,7 @@ func autolockIoFinderImpl(tls *libc.TLS, filePath uintptr, pNew uintptr) uintptr return uintptr(unsafe.Pointer(&nolockIoMethods)) } if libc.Xstatfs(tls, filePath, bp+8 /* &fsInfo */) != -1 { - if ((*statfs)(unsafe.Pointer(bp+8 /* &fsInfo */)).Ff_flags & MNT_RDONLY) != 0 { + if ((*statfs)(unsafe.Pointer(bp+8 /* &fsInfo */)).Ff_flags & Uint32_t(MNT_RDONLY)) != 0 { return uintptr(unsafe.Pointer(&nolockIoMethods)) } for i = 0; aMap[i].FzFilesystem != 0; i++ { @@ -37825,8 +37825,8 @@ func autolockIoFinderImpl(tls *libc.TLS, filePath uintptr, pNew uintptr) uintptr // assume that the file-system supports POSIX style locks. (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_len = int64(1) (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_start = int64(0) - (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_whence = SEEK_SET - (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_type = F_RDLCK + (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_whence = int16(SEEK_SET) + (*flock)(unsafe.Pointer(bp + 2176 /* &lockInfo */)).Fl_type = int16(F_RDLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pNew)).Fh, F_GETLK, libc.VaList(bp, bp+2176 /* &lockInfo */)) != -1 { if libc.Xstrcmp(tls, bp+8 /* &fsInfo */ +72 /* &.f_fstypename */, ts+5730 /* "nfs" */) == 0 { return uintptr(unsafe.Pointer(&nfsIoMethods)) @@ -38515,13 +38515,13 @@ __27: if !(0 == libc.Xstrncmp(tls, ts+5890 /* "msdos" */, bp+552 /* &fsInfo */ +72 /* &.f_fstypename */, uint64(5))) { goto __28 } - *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (SQLITE_FSFLAGS_IS_MSDOS) + *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (uint32(SQLITE_FSFLAGS_IS_MSDOS)) __28: ; if !(0 == libc.Xstrncmp(tls, ts+5896 /* "exfat" */, bp+552 /* &fsInfo */ +72 /* &.f_fstypename */, uint64(5))) { goto __29 } - *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (SQLITE_FSFLAGS_IS_MSDOS) + *(*uint32)(unsafe.Pointer(pFile + 124 /* &.fsFlags */)) |= (uint32(SQLITE_FSFLAGS_IS_MSDOS)) __29: ; @@ -38572,7 +38572,7 @@ __34: useProxy = (libc.Bool32(libc.Xatoi(tls, envforce) > 0)) goto __37 __36: - useProxy = libc.BoolInt32(!(((*statfs)(unsafe.Pointer(bp+552 /* &fsInfo */)).Ff_flags & MNT_LOCAL) != 0)) + useProxy = libc.BoolInt32(!(((*statfs)(unsafe.Pointer(bp+552 /* &fsInfo */)).Ff_flags & Uint32_t(MNT_LOCAL)) != 0)) __37: ; if !(useProxy != 0) { @@ -39629,7 +39629,7 @@ func proxyCreateLockPath(tls *libc.TLS, lockPath uintptr) int32 { /* sqlite3.c:4 if (((i - start) > 2) || ((((i - start) == 1) && (int32(*(*int8)(unsafe.Pointer(bp + 48 /* &buf[0] */ + uintptr(start)))) != '.')) && (int32(*(*int8)(unsafe.Pointer(bp + 48 /* &buf[0] */ + uintptr(start)))) != '/'))) || ((((i - start) == 2) && (int32(*(*int8)(unsafe.Pointer(bp + 48 /* &buf[0] */ + uintptr(start)))) != '.')) && (int32(*(*int8)(unsafe.Pointer(bp + 48 /* &buf[0] */ + uintptr((start + 1))))) != '.')) { *(*int8)(unsafe.Pointer(bp + 48 /* &buf[0] */ + uintptr(i))) = int8(0) - if (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 18*24 + 8 /* &.pCurrent */))))(tls, bp+48 /* &buf[0] */, SQLITE_DEFAULT_PROXYDIR_PERMISSIONS) != 0 { + if (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 18*24 + 8 /* &.pCurrent */))))(tls, bp+48 /* &buf[0] */, uint16(SQLITE_DEFAULT_PROXYDIR_PERMISSIONS)) != 0 { var err int32 = *(*int32)(unsafe.Pointer(libc.X__error(tls))) if err != EEXIST { if Xsqlite3OSTrace != 0 { @@ -39789,7 +39789,7 @@ func proxyGetHostID(tls *libc.TLS, pHostID uintptr, pError uintptr) int32 { /* s bp := tls.Alloc(16) defer tls.Free(16) - libc.X__builtin___memset_chk(tls, pHostID, 0, PROXY_HOSTIDLEN, libc.X__builtin_object_size(tls, pHostID, 0)) + libc.X__builtin___memset_chk(tls, pHostID, 0, uint64(PROXY_HOSTIDLEN), libc.X__builtin_object_size(tls, pHostID, 0)) { *(*timespec)(unsafe.Pointer(bp /* timeout */)) = timespec{Ftv_sec: int64(1)} // 1 sec timeout if libc.Xgethostuuid(tls, pHostID, bp /* &timeout */) != 0 { @@ -39843,8 +39843,8 @@ func proxyBreakConchLock(tls *libc.TLS, pFile uintptr, myHostID uintptr) int32 { _ = myHostID // create a new path by replace the trailing '-conch' with '-break' - pathLen = libc.Xstrlcpy(tls, bp+64 /* &tPath[0] */, cPath, PATH_MAX) - if !(((pathLen > PATH_MAX) || (pathLen < uint64(6))) || (libc.Xstrlcpy(tls, (bp+64 /* &tPath */ +uintptr((pathLen-uint64(5)))), ts+6218 /* "break" */, uint64(6)) != uint64(5))) { + pathLen = libc.Xstrlcpy(tls, bp+64 /* &tPath[0] */, cPath, uint64(PATH_MAX)) + if !(((pathLen > uint64(PATH_MAX)) || (pathLen < uint64(6))) || (libc.Xstrlcpy(tls, (bp+64 /* &tPath */ +uintptr((pathLen-uint64(5)))), ts+6218 /* "break" */, uint64(6)) != uint64(5))) { goto __1 } Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+1088 /* &errmsg[0] */, ts+6224 /* "path error (len ..." */, libc.VaList(bp, int32(pathLen))) @@ -39953,9 +39953,9 @@ func proxyConchLock(tls *libc.TLS, pFile uintptr, myHostID uintptr, lockType int storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) return (SQLITE_IOERR | (int32(15) << 8)) } - if (len > (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) && (int32(*(*int8)(unsafe.Pointer(bp + 160 /* &tBuf[0] */))) == int32(PROXY_CONCHVERSION)) { + if (len > (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) && (int32(*(*int8)(unsafe.Pointer(bp + 160 /* &tBuf[0] */))) == int32(int8(PROXY_CONCHVERSION))) { // don't break the lock if the host id doesn't match - if 0 != libc.Xmemcmp(tls, (bp+160 /* &tBuf */ +1), myHostID, PROXY_HOSTIDLEN) { + if 0 != libc.Xmemcmp(tls, (bp+160 /* &tBuf */ +1), myHostID, uint64(PROXY_HOSTIDLEN)) { return SQLITE_BUSY } } else { @@ -40074,7 +40074,7 @@ __5: goto end_takeconch goto __7 __6: - if !((readLen <= (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) || (int32(*(*int8)(unsafe.Pointer(bp + 76 /* &readBuf[0] */))) != int32(PROXY_CONCHVERSION))) { + if !((readLen <= (PROXY_HEADERLEN + PROXY_HOSTIDLEN)) || (int32(*(*int8)(unsafe.Pointer(bp + 76 /* &readBuf[0] */))) != int32(int8(PROXY_CONCHVERSION)))) { goto __8 } // a short read or version format mismatch means we need to create a new @@ -40093,7 +40093,7 @@ __9: // in case we need to try again for an :auto: named lock file goto __12 } hostIdMatch = libc.BoolInt32(!(libc.Xmemcmp(tls, (bp+76 /* &readBuf */ +1), bp+56, /* &myHostID[0] */ - PROXY_HOSTIDLEN) != 0)) + uint64(PROXY_HOSTIDLEN)) != 0)) // if the conch has data compare the contents if !(!(int32((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath) != 0)) { goto __13 @@ -40105,7 +40105,7 @@ __9: // in case we need to try again for an :auto: named lock file } pathLen = (Size_t(readLen - (PROXY_HEADERLEN + PROXY_HOSTIDLEN))) - if !(pathLen >= PATH_MAX) { + if !(pathLen >= uint64(PATH_MAX)) { goto __16 } pathLen = (uint64(PATH_MAX - 1)) @@ -40148,7 +40148,7 @@ __18: if !(!(int32((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath) != 0)) { goto __19 } - proxyGetLockPath(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FdbPath, bp+1117 /* &lockPath[0] */, PATH_MAX) + proxyGetLockPath(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FdbPath, bp+1117 /* &lockPath[0] */, uint64(PATH_MAX)) tempLockPath = bp + 1117 /* &lockPath[0] */ // create a copy of the lock path _only_ if the conch is taken __19: @@ -40182,16 +40182,16 @@ __21: } writeSize = 0 - *(*int8)(unsafe.Pointer(bp + 2141 /* &writeBuffer[0] */)) = PROXY_CONCHVERSION - libc.X__builtin___memcpy_chk(tls, (bp + 2141 /* &writeBuffer */ + 1), bp+56 /* &myHostID[0] */, PROXY_HOSTIDLEN, libc.X__builtin_object_size(tls, (bp+2141 /* &writeBuffer */ +1), 0)) + *(*int8)(unsafe.Pointer(bp + 2141 /* &writeBuffer[0] */)) = int8(PROXY_CONCHVERSION) + libc.X__builtin___memcpy_chk(tls, (bp + 2141 /* &writeBuffer */ + 1), bp+56 /* &myHostID[0] */, uint64(PROXY_HOSTIDLEN), libc.X__builtin_object_size(tls, (bp+2141 /* &writeBuffer */ +1), 0)) if !((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != (uintptr(0))) { goto __25 } libc.Xstrlcpy(tls, (bp + 2141 /* &writeBuffer */ + 17), (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath, - PATH_MAX) + uint64(PATH_MAX)) goto __26 __25: - libc.Xstrlcpy(tls, (bp + 2141 /* &writeBuffer */ + 17), tempLockPath, PATH_MAX) + libc.Xstrlcpy(tls, (bp + 2141 /* &writeBuffer */ + 17), tempLockPath, uint64(PATH_MAX)) __26: ; writeSize = (int32((uint64(PROXY_HEADERLEN + PROXY_HOSTIDLEN)) + libc.Xstrlen(tls, (bp+2141 /* &writeBuffer */ +17)))) @@ -40424,7 +40424,7 @@ func switchLockProxyPath(tls *libc.TLS, pFile uintptr, path uintptr) int32 { /* } // nothing to do if the path is NULL, :auto: or matches the existing path - if ((!(path != 0) || (int32(*(*int8)(unsafe.Pointer(path))) == 0)) || !(libc.Xstrcmp(tls, path, ts+5929 /* ":auto:" */) != 0)) || ((oldPath != 0) && !(libc.Xstrncmp(tls, oldPath, path, PATH_MAX) != 0)) { + if ((!(path != 0) || (int32(*(*int8)(unsafe.Pointer(path))) == 0)) || !(libc.Xstrcmp(tls, path, ts+5929 /* ":auto:" */) != 0)) || ((oldPath != 0) && !(libc.Xstrncmp(tls, oldPath, path, uint64(PATH_MAX)) != 0)) { return SQLITE_OK } else { var lockProxy uintptr = (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxy @@ -40455,7 +40455,7 @@ func proxyGetDbPathForUnixFile(tls *libc.TLS, pFile uintptr, dbPath uintptr) int // of the struct libc.Xstrlcpy(tls, dbPath, (*AfpLockingContext)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FlockingContext)).FdbPath, - PATH_MAX) + uint64(PATH_MAX)) } else if (*UnixFile)(unsafe.Pointer(pFile)).FpMethod == uintptr(unsafe.Pointer(&dotlockIoMethods)) { // dot lock style uses the locking context to store the dot lock // file path @@ -40464,7 +40464,7 @@ func proxyGetDbPathForUnixFile(tls *libc.TLS, pFile uintptr, dbPath uintptr) int } else { // all other styles use the locking context to store the db file path - libc.Xstrlcpy(tls, dbPath, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, PATH_MAX) + libc.Xstrlcpy(tls, dbPath, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, uint64(PATH_MAX)) } return SQLITE_OK } @@ -40527,7 +40527,7 @@ func proxyTransformUnixFile(tls *libc.TLS, pFile uintptr, path uintptr) int32 { if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 4*24 + 8 /* &.pCurrent */))))(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FconchFilePath, bp+1072 /* &conchInfo */) == -1 { var err int32 = *(*int32)(unsafe.Pointer(libc.X__error(tls))) if (err == ENOENT) && (libc.Xstatfs(tls, bp+40 /* &dbPath[0] */, bp+1216 /* &fsInfo */) != -1) { - goLockless = (libc.Bool32(((*statfs)(unsafe.Pointer(bp+1216 /* &fsInfo */)).Ff_flags & MNT_RDONLY) == MNT_RDONLY)) + goLockless = (libc.Bool32(((*statfs)(unsafe.Pointer(bp+1216 /* &fsInfo */)).Ff_flags & Uint32_t(MNT_RDONLY)) == Uint32_t(MNT_RDONLY))) } } if goLockless != 0 { @@ -40614,7 +40614,7 @@ func proxyFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { if isProxyStyle != 0 { var pCtx uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext if !(libc.Xstrcmp(tls, pArg, ts+5929 /* ":auto:" */) != 0) || - (((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != 0) && !(libc.Xstrncmp(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath, proxyPath, PATH_MAX) != 0)) { + (((*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != 0) && !(libc.Xstrncmp(tls, (*ProxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath, proxyPath, uint64(PATH_MAX)) != 0)) { rc = SQLITE_OK } else { rc = switchLockProxyPath(tls, pFile, proxyPath) @@ -40912,7 +40912,7 @@ var memdb_io_methods = Sqlite3_io_methods{ // to free. func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:47969:12: */ var p uintptr = pFile - if ((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_FREEONCLOSE) != 0 { + if ((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_FREEONCLOSE)) != 0 { Xsqlite3_free(tls, (*MemFile)(unsafe.Pointer(p)).FaData) } return SQLITE_OK @@ -40935,7 +40935,7 @@ func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sql // Try to enlarge the memory allocation to hold at least sz bytes func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:47997:12: */ var pNew uintptr - if (((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_RESIZEABLE) == uint32(0)) || ((*MemFile)(unsafe.Pointer(p)).FnMmap > 0) { + if (((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_RESIZEABLE)) == uint32(0)) || ((*MemFile)(unsafe.Pointer(p)).FnMmap > 0) { return SQLITE_FULL } if newSz > (*MemFile)(unsafe.Pointer(p)).FszMax { @@ -40957,7 +40957,7 @@ func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqli // Write data to an memdb-file. func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48017:12: */ var p uintptr = pFile - if ((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_READONLY) != 0 { + if ((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_READONLY)) != 0 { return SQLITE_READONLY } if (iOfst + Sqlite_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz { @@ -41005,7 +41005,7 @@ func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlit func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:48072:12: */ var p uintptr = pFile if (eLock > SQLITE_LOCK_SHARED) && - (((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_READONLY) != uint32(0)) { + (((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_READONLY)) != uint32(0)) { return SQLITE_READONLY } (*MemFile)(unsafe.Pointer(p)).FeLock = eLock @@ -41187,7 +41187,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if piSize != 0 { *(*Sqlite3_int64)(unsafe.Pointer(piSize)) = (*MemFile)(unsafe.Pointer(p)).Fsz } - if (mFlags & SQLITE_SERIALIZE_NOCOPY) != 0 { + if (mFlags & uint32(SQLITE_SERIALIZE_NOCOPY)) != 0 { pOut = (*MemFile)(unsafe.Pointer(p)).FaData } else { pOut = Xsqlite3_malloc64(tls, uint64((*MemFile)(unsafe.Pointer(p)).Fsz)) @@ -41220,7 +41220,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if piSize != 0 { *(*Sqlite3_int64)(unsafe.Pointer(piSize)) = sz } - if (mFlags & SQLITE_SERIALIZE_NOCOPY) != 0 { + if (mFlags & uint32(SQLITE_SERIALIZE_NOCOPY)) != 0 { pOut = uintptr(0) } else { pOut = Xsqlite3_malloc64(tls, uint64(sz)) @@ -41369,15 +41369,15 @@ func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlit return 0 } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM)))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) } else { - var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { if *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i { return 1 } - h = (U32((uint64(h + U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64(h + U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) } return 0 } @@ -41413,7 +41413,7 @@ __1: i-- __2: - if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { + if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { goto __3 } bin = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor) @@ -41434,21 +41434,21 @@ __4: goto __2 __3: ; - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) { goto __6 } - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) return SQLITE_OK __6: ; - h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) // if there wasn't a hash collision, and this doesn't // completely fill the hash, then just add it without // worring about sub-dividing and re-hashing. if !(!(int32(*(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4))) != 0)) { goto __7 } - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { goto __8 } goto bitvec_set_end @@ -41469,7 +41469,7 @@ __10: __13: ; h++ - if !(uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __14 } h = U32(0) @@ -41487,7 +41487,7 @@ __12: // available free spot. check to see if this is going to // make our hash too "full". bitvec_set_rehash: - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { goto __15 } aiValues = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(unsafe.Sizeof([124]U32{}))) @@ -41499,11 +41499,11 @@ bitvec_set_rehash: __16: libc.X__builtin___memcpy_chk(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})), libc.X__builtin_object_size(tls, aiValues, 0)) libc.X__builtin___memset_chk(tls, p+16 /* &.u */ /* &.apSub */, 0, uint64(unsafe.Sizeof([62]uintptr{})), libc.X__builtin_object_size(tls, p+16 /* &.u */ /* &.apSub */, 0)) - (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) + (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) rc = Xsqlite3BitvecSet(tls, p, i) j = uint32(0) __18: - if !(uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __20 } if !(*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) { @@ -41549,21 +41549,21 @@ func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sql return } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) } else { var j uint32 var aiValues uintptr = pBuf libc.X__builtin___memcpy_chk(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})), libc.X__builtin_object_size(tls, aiValues, 0)) libc.X__builtin___memset_chk(tls, p+16 /* &.u */ /* &.aHash */, 0, uint64(unsafe.Sizeof([124]U32{})), libc.X__builtin_object_size(tls, p+16 /* &.u */ /* &.aHash */, 0)) (*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0) - for j = uint32(0); uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { + for j = uint32(0); uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { if (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) && (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != (i + U32(1))) { - var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) (*Bitvec)(unsafe.Pointer(p)).FnSet++ for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { h++ - if uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { + if uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { h = U32(0) } } @@ -41580,7 +41580,7 @@ func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */ } if (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 { var i uint32 - for i = uint32(0); uint64(i) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { + for i = uint32(0); uint64(i) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer((p + 16 /* &.u */ /* &.apSub */) + uintptr(i)*8))) } } @@ -41647,7 +41647,7 @@ func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* // bits to act as the reference pBitvec = Xsqlite3BitvecCreate(tls, uint32(sz)) pV = Xsqlite3MallocZero(tls, (uint64(((sz + 7) / 8) + 1))) - pTmpSpace = Xsqlite3_malloc64(tls, BITVEC_SZ) + pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if !(((pBitvec == uintptr(0)) || (pV == uintptr(0))) || (pTmpSpace == uintptr(0))) { goto __1 } @@ -42059,7 +42059,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u libc.X__builtin___memset_chk(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8), libc.X__builtin_object_size(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0)) (*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache (*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno - (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = PGHDR_CLEAN + (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = U16(PGHDR_CLEAN) return Xsqlite3PcacheFetchFinish(tls, pCache, pgno, pPage) } @@ -42090,7 +42090,7 @@ func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49388:37: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { pcacheUnpin(tls, p) } else { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } } @@ -42108,7 +42108,7 @@ func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */ func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0 { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) } (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1) @@ -42123,7 +42123,7 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) ^= U16((PGHDR_DIRTY | PGHDR_CLEAN)) - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_ADD) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD)) } } @@ -42133,7 +42133,7 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: // make it so. func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: */ - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((PGHDR_DIRTY | PGHDR_NEED_SYNC) | PGHDR_WRITEABLE)))) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) |= U16((PGHDR_CLEAN)) @@ -42177,7 +42177,7 @@ func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:4 (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 72 /* &.xRekey */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno) (*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno if ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0) && ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_NEED_SYNC) != 0) { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } @@ -43634,7 +43634,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174: (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) + p) (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint64(N) - (((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) / uint64(unsafe.Sizeof(RowSetEntry{})))) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) (*RowSet)(unsafe.Pointer(p)).FiBatch = 0 } return p @@ -43656,7 +43656,7 @@ func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: * (*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) } // Deallocate all chunks from a RowSet. This frees all memory that @@ -45402,7 +45402,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, // of two greater than or equal to 512 or 32, and not greater than their // respective compile time maximum limits. if (((((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) < U32(512)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) < U32(32))) || - (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > SQLITE_MAX_PAGE_SIZE)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > MAX_SECTOR_SIZE)) || + (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > U32(SQLITE_MAX_PAGE_SIZE))) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > U32(MAX_SECTOR_SIZE))) || (((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */))) != U32(0))) || (((*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */))) != U32(0)) { // If the either the page-size or sector-size in the journal-header is // invalid, then the process that wrote the journal-header must have @@ -45574,7 +45574,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) { var rc int32 // Error code returned by pagerUnlockDb() var iDc int32 @@ -45607,7 +45607,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ // without clearing the error code. This is intentional - the error // code is cleared and the cache reset in the block below. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } // If Pager.errCode is set, the contents of the pager cache cannot be @@ -45619,13 +45619,13 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { pager_reset(tls, pPager) (*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(0) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else { (*Pager)(unsafe.Pointer(pPager)).FeState = func() uint8 { if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) { - return PAGER_OPEN + return uint8(PAGER_OPEN) } - return PAGER_READER + return uint8(PAGER_READER) }() } if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 { @@ -45662,7 +45662,7 @@ func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:5 if (rc2 == SQLITE_FULL) || (rc2 == SQLITE_IOERR) { (*Pager)(unsafe.Pointer(pPager)).FerrCode = rc - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) } return rc @@ -45847,7 +45847,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi (!((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || (Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0)) { rc2 = pagerUnlockDb(tls, pPager, SHARED_LOCK) } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0) return func() int32 { @@ -46827,7 +46827,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720: // bytes 92..95 store the change counter for which the version number // is valid. Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(92)), change_counter) - Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), SQLITE_VERSION_NUMBER) + Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(SQLITE_VERSION_NUMBER)) } // This function is invoked once for each page that has already been @@ -47062,7 +47062,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 rc = Xsqlite3PagerOpenWal(tls, pPager, uintptr(0)) } } else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_WAL { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_DELETE + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_DELETE) } } } @@ -47299,26 +47299,26 @@ func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: // Numeric values associated with these states are OFF==1, NORMAL=2, // and FULL=3. func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55248:21: */ - var level uint32 = (pgFlags & PAGER_SYNCHRONOUS_MASK) + var level uint32 = (pgFlags & uint32(PAGER_SYNCHRONOUS_MASK)) if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 { (*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1) (*Pager)(unsafe.Pointer(pPager)).FfullSync = U8(0) (*Pager)(unsafe.Pointer(pPager)).FextraSync = U8(0) } else { (*Pager)(unsafe.Pointer(pPager)).FnoSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_OFF { + if level == uint32(PAGER_SYNCHRONOUS_OFF) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FfullSync = func() uint8 { - if level >= PAGER_SYNCHRONOUS_FULL { + if level >= uint32(PAGER_SYNCHRONOUS_FULL) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FextraSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_EXTRA { + if level == uint32(PAGER_SYNCHRONOUS_EXTRA) { return uint8(1) } return uint8(0) @@ -47326,19 +47326,19 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s } if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 { (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(0) - } else if (pgFlags & PAGER_FULLFSYNC) != 0 { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_FULL + } else if (pgFlags & uint32(PAGER_FULLFSYNC)) != 0 { + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_FULL) } else { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_NORMAL) } (*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = (U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2)) if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))) } - if ((pgFlags & PAGER_CKPT_FULLFSYNC) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { + if ((pgFlags & uint32(PAGER_CKPT_FULLFSYNC)) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32(SQLITE_SYNC_FULL) << 2)) } - if (pgFlags & PAGER_CACHESPILL) != 0 { + if (pgFlags & uint32(PAGER_CACHESPILL)) != 0 { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_OFF))) } else { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) |= U8((SPILLFLAG_OFF)) @@ -47689,7 +47689,7 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr return SQLITE_NOMEM } (*PgHdr)(unsafe.Pointer(p)).FpExtra = (p + 1*72) - (*PgHdr)(unsafe.Pointer(p)).Fflags = PGHDR_MMAP + (*PgHdr)(unsafe.Pointer(p)).Fflags = U16(PGHDR_MMAP) (*PgHdr)(unsafe.Pointer(p)).FnRef = int16(1) (*PgHdr)(unsafe.Pointer(p)).FpPager = pPager } @@ -47775,7 +47775,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq { var a uintptr = uintptr(0) - if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoCkptOnClose))) && + if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoCkptOnClose)))) && (SQLITE_OK == databaseIsUnmoved(tls, pPager)) { a = pTmp } @@ -47966,7 +47966,7 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3 // successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on // all pages. Xsqlite3PcacheClearSyncFlags(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_DBMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_DBMOD) return SQLITE_OK } @@ -48309,7 +48309,7 @@ func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u nPathname = 0 useJournal = (libc.Bool32((flags & PAGER_OMIT_JOURNAL) == 0)) pcacheSize = Xsqlite3PcacheSize(tls) - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_DEFAULT_PAGE_SIZE) zUri = uintptr(0) nUriByte = 1 nUri = 0 // Number of URI parameters @@ -48568,10 +48568,10 @@ __22: if !(*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize) { goto __27 } - if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > SQLITE_MAX_DEFAULT_PAGE_SIZE) { + if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) { goto __28 } - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_MAX_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_MAX_DEFAULT_PAGE_SIZE) goto __29 __28: *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize @@ -48605,9 +48605,9 @@ __23: // This branch also runs for files marked as immutable. act_like_temp_file: tempFile = 1 - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = PAGER_READER // Pretend we already have a lock - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = EXCLUSIVE_LOCK // Pretend we are in EXCLUSIVE mode - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = U8(PAGER_READER) // Pretend we already have a lock + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = U8(EXCLUSIVE_LOCK) // Pretend we are in EXCLUSIVE mode + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking readOnly = (vfsFlags & SQLITE_OPEN_READONLY) __24: ; @@ -48659,7 +48659,7 @@ __33: // pPager->stmtSize = 0; // pPager->stmtJSize = 0; // pPager->nPage = 0; - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = SQLITE_MAX_PAGE_COUNT + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = Pgno(SQLITE_MAX_PAGE_COUNT) // pPager->state = PAGER_UNLOCK; // pPager->errMask = 0; (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FtempFile = U8(tempFile) @@ -48678,7 +48678,7 @@ __33: __34: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FfullSync = U8(1) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FextraSync = U8(0) - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = U8(SQLITE_SYNC_NORMAL) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FwalSyncFlags = (U8(SQLITE_SYNC_NORMAL | (int32(SQLITE_SYNC_NORMAL) << 2))) __35: ; @@ -48692,13 +48692,13 @@ __35: if !(!(useJournal != 0)) { goto __36 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_OFF + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_OFF) goto __37 __36: if !((memDb != 0) || (memJM != 0)) { goto __38 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_MEMORY + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_MEMORY) __38: ; __37: @@ -49017,7 +49017,7 @@ __8: goto __13 } rc = pager_playback(tls, pPager, libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) __13: ; goto __12 @@ -49128,7 +49128,7 @@ failed: goto __24 __23: - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock = U8(1) __24: ; @@ -49543,7 +49543,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5743 (*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) } else { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_CACHEMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_CACHEMOD) } return rc @@ -49611,7 +49611,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor // transactions may copy data from the sub-journal into the database // file as well as into the page cache. Which would be incorrect in // WAL mode. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_LOCKED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_LOCKED) (*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbFileSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize @@ -50209,7 +50209,7 @@ commit_phase_one_exit: if !((rc == SQLITE_OK) && !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) { goto __19 } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_FINISHED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_FINISHED) __19: ; return rc @@ -50253,7 +50253,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit ((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST) { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) return SQLITE_OK } @@ -50314,7 +50314,7 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // state to indicate that the contents of the cache may not be trusted. // Any active readers will get SQLITE_ABORT. (*Pager)(unsafe.Pointer(pPager)).FerrCode = SQLITE_ABORT - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) return rc } @@ -50991,8 +50991,8 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { rc = pagerOpenWal(tls, pPager) if rc == SQLITE_OK { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_WAL - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_WAL) + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } } else { *(*int32)(unsafe.Pointer(pbOpen)) = 1 @@ -51776,12 +51776,12 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt // Request a pointer to the required page from the VFS if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE { - *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))) + *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))) if !(int32(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))) != 0) { rc = SQLITE_NOMEM } } else { - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), ((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) if rc == SQLITE_OK { @@ -51885,7 +51885,7 @@ func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */ var nCksum int32 = int32((uintptr(0) + 40 /* &.aCksum */)) (*Wal)(unsafe.Pointer(pWal)).Fhdr.FisInit = U8(1) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = WALINDEX_MAX_VERSION + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(WALINDEX_MAX_VERSION) walChecksumBytes(tls, 1, (pWal + 72 /* &.hdr */), nCksum, uintptr(0), pWal+72 /* &.hdr */ +40 /* &.aCksum */) // Possible TSAN false-positive. See tag-20200519-1 libc.X__builtin___memcpy_chk(tls, (libc.AtomicLoadUintptr(&aHdr) + 1*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})), libc.X__builtin_object_size(tls, (libc.AtomicLoadUintptr(&aHdr)+1*48), 0)) @@ -52014,7 +52014,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 U32) int32 { /* sqlite3.c:60301:12: */ - return (int32((iPage * HASHTABLE_HASH_1) & (U32((HASHTABLE_NPAGE * 2) - 1)))) + return (int32((iPage * U32(HASHTABLE_HASH_1)) & (U32((HASHTABLE_NPAGE * 2) - 1)))) } func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60306:12: */ @@ -52059,7 +52059,7 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4) (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(0) } else { - (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) + (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) } (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + libc.UintptrFromInt32(-1)*4) } @@ -52071,7 +52071,7 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { // iFrame. The wal-index is broken up into 32KB pages. Wal-index pages // are numbered starting from 0. func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60365:12: */ - var iHash int32 = (int32((((uint64(iFrame + HASHTABLE_NPAGE)) - (HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / HASHTABLE_NPAGE)) + var iHash int32 = (int32((((uint64(iFrame + U32(HASHTABLE_NPAGE))) - (uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / uint64(HASHTABLE_NPAGE))) return iHash } @@ -52082,7 +52082,7 @@ func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60 if iHash == 0 { return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((((((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))+uint64(iFrame))-uint64(1)))*4)) } - return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(HASHTABLE_NPAGE-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%HASHTABLE_NPAGE))*4)) + return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(uint64(HASHTABLE_NPAGE)-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%uint64(HASHTABLE_NPAGE)))*4)) } // Remove entries from the hash table that point to WAL slots greater @@ -52261,7 +52261,7 @@ __1: __2: ; - if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > int64(WAL_HDRSIZE)) { goto __3 } // Buffer to load WAL header into aPrivate = uintptr(0) // Heap copy of *-shm hash being populated @@ -52282,7 +52282,7 @@ __4: // WAL file. magic = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */)) szPage = int32(Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 8))) - if !(((((magic & 0xFFFFFFFE) != WAL_MAGIC) || + if !(((((magic & 0xFFFFFFFE) != U32(WAL_MAGIC)) || ((szPage & (szPage - 1)) != 0)) || (szPage > SQLITE_MAX_PAGE_SIZE)) || (szPage < 512)) { @@ -52310,7 +52310,7 @@ __6: // Verify that the version number on the WAL format is one that // are able to understand version = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 4)) - if !(version != WAL_MAX_VERSION) { + if !(version != U32(WAL_MAX_VERSION)) { goto __7 } rc = Xsqlite3CantopenError(tls, 60635) @@ -52320,7 +52320,7 @@ __7: // Malloc a buffer to read frames into. szFrame = (szPage + WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))))) + aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))))) if !(!(aFrame != 0)) { goto __8 } @@ -52332,23 +52332,23 @@ __8: aPrivate = (aData + uintptr(szPage)) // Read all frames from the log file. - iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - WAL_HDRSIZE) / I64(szFrame))) + iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - int64(WAL_HDRSIZE)) / I64(szFrame))) iPg = U32(0) __9: if !(iPg <= U32(walFramePage(tls, iLastFrame))) { goto __11 } // Index of last frame read iLast = func() uint32 { - if (uint64(iLastFrame)) < ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE))) { + if (uint64(iLastFrame)) < ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE)))) { return iLastFrame } - return (uint32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE)))) + return (uint32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE))))) }() iFirst = (U32(uint64(1) + (func() uint64 { if iPg == U32(0) { return uint64(0) } - return ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * HASHTABLE_NPAGE))) + return ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * U32(HASHTABLE_NPAGE)))) }()))) rc = walIndexPage(tls, pWal, int32(iPg), bp+56 /* &aShare */) if !(rc != 0) { @@ -52364,7 +52364,7 @@ __13: if !(iFrame <= iLast) { goto __15 } - iOffset = (WAL_HDRSIZE + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header // Read and decode the next log frame. rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset) @@ -52423,7 +52423,7 @@ __15: // do that, according to the spec, but no memcpy() implementation that // we know of actually does that, which is why we say that memcpy() // is safe for this. Memcpy() is certainly a lot faster. - libc.X__builtin___memcpy_chk(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr)), libc.X__builtin_object_size(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */))+uintptr(nHdr32)*4), 0)) + libc.X__builtin___memcpy_chk(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr)), libc.X__builtin_object_size(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */))+uintptr(nHdr32)*4), 0)) if !(iFrame <= iLast) { goto __20 } @@ -52574,16 +52574,16 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt (*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(1) (*Wal)(unsafe.Pointer(pRet)).FexclusiveMode = func() uint8 { if bNoShm != 0 { - return WAL_HEAPMEMORY_MODE + return uint8(WAL_HEAPMEMORY_MODE) } - return WAL_NORMAL_MODE + return uint8(WAL_NORMAL_MODE) }() // Open file handle on the write-ahead log file. *(*int32)(unsafe.Pointer(bp /* flags */)) = ((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_WAL) rc = Xsqlite3OsOpen(tls, pVfs, zWalName, (*Wal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */) if (rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp /* flags */)) & SQLITE_OPEN_READONLY) != 0) { - (*Wal)(unsafe.Pointer(pRet)).FreadOnly = WAL_RDONLY + (*Wal)(unsafe.Pointer(pRet)).FreadOnly = U8(WAL_RDONLY) } if rc != SQLITE_OK { @@ -52809,8 +52809,8 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int // of memory will be freed before this function returns. aTmp = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Ht_slot(0))) * (func() uint64 { - if iLast > HASHTABLE_NPAGE { - return HASHTABLE_NPAGE + if iLast > U32(HASHTABLE_NPAGE) { + return uint64(HASHTABLE_NPAGE) } return uint64(iLast) }())))) @@ -53107,7 +53107,7 @@ __18: goto __16 __19: ; - iOffset = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset) if !(rc != SQLITE_OK) { @@ -53270,7 +53270,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, if (zBuf != uintptr(0)) && (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)))) { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = Xsqlite3WalCheckpoint(tls, pWal, db, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0), sync_flags, nBuf, zBuf, uintptr(0), uintptr(0)) @@ -53417,7 +53417,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // and there is no writer on hand to fix it. (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(1) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_HEAPMEMORY_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_HEAPMEMORY_MODE) *(*int32)(unsafe.Pointer(pChanged)) = 1 } else { return rc // Any other non-OK return is just an error @@ -53472,7 +53472,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // If the header is read successfully, check the version number to make // sure the wal-index was not constructed with some future format that // this version of SQLite cannot understand. - if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != WALINDEX_MAX_VERSION) { + if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION)) { rc = Xsqlite3CantopenError(tls, 61769) } if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { @@ -53487,7 +53487,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s rc = -1 } } - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) } return rc @@ -53581,7 +53581,7 @@ __1: // even if some external agent does a "chmod" to make the shared-memory // writable by us, until sqlite3OsShmUnmap() has been called. // This is a requirement on the VFS implementation. - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) // SQLITE_OK not possible for read-only connection if !(rc != (SQLITE_READONLY | (int32(5) << 8))) { goto __3 @@ -53610,7 +53610,7 @@ __3: goto begin_unreliable_shm_out __4: ; - if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < int64(WAL_HDRSIZE)) { goto __5 } // If the wal file is too small to contain a wal-header and the @@ -53667,7 +53667,7 @@ __8: // the caller. *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) - iOffset = (WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) __9: if !((iOffset + I64(szFrame)) <= *(*I64)(unsafe.Pointer(bp + 8 /* szWal */))) { goto __11 @@ -54036,7 +54036,7 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3. iDbOff = ((I64(pgno - U32(1))) * I64(szPage)) if (iDbOff + I64(szPage)) <= *(*I64)(unsafe.Pointer(bp /* szDb */)) { - iWalOff = ((WAL_HDRSIZE + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iWalOff = ((int64(WAL_HDRSIZE) + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff) if rc == SQLITE_OK { @@ -54264,7 +54264,7 @@ func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pO sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) sz = ((sz & 0xfe00) + ((sz & 0x0001) << 16)) - iOffset = ((WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 { if nOut > sz { @@ -54563,7 +54563,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(1) { iCksumOff = int64(24) } else { - iCksumOff = ((WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) + iCksumOff = ((int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) } rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (int32(uint64(unsafe.Sizeof(U32(0))) * uint64(2))), iCksumOff) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = Xsqlite3Get4byte(tls, aBuf) @@ -54572,7 +54572,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli iRead = (*Wal)(unsafe.Pointer(pWal)).FiReCksum (*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0) for ; (rc == SQLITE_OK) && (iRead <= iLast); iRead++ { - var iOff I64 = (WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + var iOff I64 = (int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (szPage + WAL_FRAME_HDRSIZE), iOff) if rc == SQLITE_OK { var iPgno U32 @@ -54632,7 +54632,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // Checksum for wal-header Xsqlite3Put4byte(tls, (bp /* &aWalHdr */), (uint32(WAL_MAGIC | SQLITE_BIGENDIAN))) - Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), WAL_MAX_VERSION) + Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), uint32(WAL_MAX_VERSION)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 8), uint32(szPage)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 12), (*Wal)(unsafe.Pointer(pWal)).FnCkpt) if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) { @@ -54644,7 +54644,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 28), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4))) (*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = SQLITE_BIGENDIAN + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(SQLITE_BIGENDIAN) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */)) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4)) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(1) @@ -54675,7 +54675,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = int64(0) (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FsyncFlags = sync_flags (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FszPage = szPage - iOffset = (WAL_HDRSIZE + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) szFrame = (szPage + WAL_FRAME_HDRSIZE) // Write all frames into the log file exactly once @@ -54691,7 +54691,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3WalFindFrame(tls, pWal, (*PgHdr)(unsafe.Pointer(p)).Fpgno, bp+40 /* &iWrite */) if *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) >= iFirst { - var iOff I64 = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + var iOff I64 = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) var pData uintptr if ((*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0)) || (*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum) { (*Wal)(unsafe.Pointer(pWal)).FiReCksum = *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) @@ -54771,8 +54771,8 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // journal size limit, if possible. if ((isCommit != 0) && ((*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0)) && ((*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0)) { var sz I64 = (*Wal)(unsafe.Pointer(pWal)).FmxWalSize - if (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { - sz = (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + if (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { + sz = (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) } walLimitSize(tls, pWal, sz) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0) @@ -54975,9 +54975,9 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* if op == 0 { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) if walLockShared(tls, pWal, (3+(int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) != SQLITE_OK { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) } else { @@ -54987,7 +54987,7 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* } else if op > 0 { walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) rc = 1 } else { rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) @@ -56228,7 +56228,7 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c: *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((BTS_EXCLUSIVE | BTS_PENDING)))) for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext { - (*BtLock)(unsafe.Pointer(pLock)).FeLock = READ_LOCK + (*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(READ_LOCK) } } } @@ -56274,7 +56274,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo if (int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags) & BTCF_Incrblob) != 0 { (*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(1) if ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot) && ((isClearTable != 0) || ((*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow)) { - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_INVALID) } } } @@ -56412,7 +56412,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: return (SQLITE_CONSTRAINT | (int32(11) << 8)) } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) } else { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 0 } @@ -56420,7 +56420,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: rc = saveCursorKey(tls, pCur) if rc == SQLITE_OK { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_ValidNKey | BTCF_ValidOvfl) | BTCF_AtLast)))) @@ -56490,7 +56490,7 @@ func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65272: Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey) (*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) } // In this version of BtreeMoveto, pKey is a packed index record @@ -56552,7 +56552,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_FAULT { return (*BtCursor)(unsafe.Pointer(pCur)).FskipNext } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) if Xsqlite3FaultSim(tls, 410) != 0 { rc = SQLITE_IOERR } else { @@ -56566,7 +56566,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp /* skipNext */)) } if ((*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) } } return rc @@ -56595,7 +56595,7 @@ func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65378:25 return uintptr(unsafe.Pointer(&fakeCursor)) } -var fakeCursor U8 = CURSOR_VALID /* sqlite3.c:65379:13 */ +var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:65379:13 */ // This routine restores a cursor back to its original position after it // has been moved by some outside activity (such as a btree rebalance or @@ -57031,7 +57031,7 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, return } ovfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize) - 4)))) - ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, PTRMAP_OVERFLOW1, (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) + ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) } } @@ -57744,7 +57744,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: (*MemPage)(unsafe.Pointer(pPage)).FnFree = -1 // Indicate that this value is yet uncomputed (*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1) - if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_CellSizeCk) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_CellSizeCk)) != 0 { return btreeCellSizeCheck(tls, pPage) } return SQLITE_OK @@ -58079,7 +58079,7 @@ __2: return SQLITE_NOMEM __3: ; - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) (*Btree)(unsafe.Pointer(p)).Fdb = db (*Btree)(unsafe.Pointer(p)).Flock.FpBtree = p (*Btree)(unsafe.Pointer(p)).Flock.FiTable = Pgno(1) @@ -58239,7 +58239,7 @@ __24: // determined by the 2-byte integer located at an offset of 16 bytes from // the beginning of the database file. (*BtShared)(unsafe.Pointer(pBt)).FpageSize = (U32((int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 16))) << 8) | (int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 17))) << 16))) - if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > SQLITE_MAX_PAGE_SIZE)) || + if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE))) || ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)) & (*BtShared)(unsafe.Pointer(pBt)).FpageSize) != U32(0))) { goto __25 } @@ -58854,7 +58854,7 @@ __2: nPage = *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)) __3: ; - if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __4 } nPage = U32(0) @@ -58941,7 +58941,7 @@ __14: // EVIDENCE-OF: R-25008-21688 The size of a page is a power of two // between 512 and 65536 inclusive. if !(((((pageSize - U32(1)) & pageSize) != U32(0)) || - (pageSize > SQLITE_MAX_PAGE_SIZE)) || + (pageSize > U32(SQLITE_MAX_PAGE_SIZE))) || (pageSize <= U32(256))) { goto __15 } @@ -59168,7 +59168,7 @@ func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVers __1: ; - if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & SQLITE_ResetDatabase) != 0) && + if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != 0) && (int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0)) { goto __2 } @@ -59234,7 +59234,7 @@ __11: // Any read-only or read-write transaction implies a read-lock on // page 1. So if some other shared-cache client already has a write-lock // on page 1, the transaction cannot be opened. - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) if !(SQLITE_OK != rc) { goto __12 } @@ -59325,7 +59325,7 @@ __16: goto __28 } - (*Btree)(unsafe.Pointer(p)).Flock.FeLock = READ_LOCK + (*Btree)(unsafe.Pointer(p)).Flock.FeLock = U8(READ_LOCK) (*Btree)(unsafe.Pointer(p)).Flock.FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock (*BtShared)(unsafe.Pointer(pBt)).FpLock = (p + 48 /* &.lock */) __28: @@ -59334,9 +59334,9 @@ __27: ; (*Btree)(unsafe.Pointer(p)).FinTrans = func() uint8 { if wrflag != 0 { - return TRANS_WRITE + return uint8(TRANS_WRITE) } - return TRANS_READ + return uint8(TRANS_READ) }() if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) > int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction)) { goto __29 @@ -59437,13 +59437,13 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12 if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, pCell) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } } if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8)))) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } return *(*int32)(unsafe.Pointer(bp /* rc */)) @@ -59563,7 +59563,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag } else { var nextOvfl Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pDbPage)).FaData) if nextOvfl != Pgno(0) { - ptrmapPut(tls, pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage, bp /* &rc */) + ptrmapPut(tls, pBt, nextOvfl, uint8(PTRMAP_OVERFLOW2), iFreePage, bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp /* rc */)) } @@ -59642,7 +59642,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // var pFreePg uintptr at bp+8, 8 - rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, BTALLOC_EXACT) + rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, uint8(BTALLOC_EXACT)) if rc != SQLITE_OK { return rc } @@ -59654,8 +59654,8 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // Index of free page to move pLastPg to // var pLastPg uintptr at bp+24, 8 - var eMode U8 = BTALLOC_ANY // Mode parameter for allocateBtreePage() - var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() + var eMode U8 = U8(BTALLOC_ANY) // Mode parameter for allocateBtreePage() + var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() rc = btreeGetPage(tls, pBt, iLastPg, bp+24 /* &pLastPg */, 0) if rc != SQLITE_OK { @@ -59669,7 +59669,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // looping until a free-page located within the first nFin pages // of the file is found. if bCommit == 0 { - eMode = BTALLOC_LE + eMode = U8(BTALLOC_LE) iNear = nFin } for ok := true; ok; ok = ((bCommit != 0) && (*(*Pgno)(unsafe.Pointer(bp + 40 /* iFreePg */)) > nFin)) { @@ -59872,7 +59872,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ // handle, downgrade to a read-only transaction. The other statements // may still be reading from the database. downgradeAllSharedCacheTableLocks(tls, p) - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_READ + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_READ) } else { // If the handle had any kind of transaction open, decrement the // transaction count of the shared btree. If the transaction count @@ -59882,13 +59882,13 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ clearAllSharedCacheTableLocks(tls, p) (*BtShared)(unsafe.Pointer(pBt)).FnTransaction-- if 0 == (*BtShared)(unsafe.Pointer(pBt)).FnTransaction { - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_NONE + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_NONE) } } // Set the current transaction state to TRANS_NONE and unlock the // pager if this call closed the only read or write transaction. - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) unlockBtreeIfUnused(tls, pBt) } @@ -59937,7 +59937,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 return rc } (*Btree)(unsafe.Pointer(p)).FiDataVersion-- // Compensate for pPager->iDataVersion++; - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -59999,7 +59999,7 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w } } else { Xsqlite3BtreeClearCursor(tls, p) - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_FAULT + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_FAULT) (*BtCursor)(unsafe.Pointer(p)).FskipNext = errCode } btreeReleaseAllCursorPages(tls, p) @@ -60074,7 +60074,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */))) } - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -60226,7 +60226,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u (*BtCursor)(unsafe.Pointer(pCur)).FpBt = pBt (*BtCursor)(unsafe.Pointer(pCur)).FcurFlags = func() uint8 { if wrFlag != 0 { - return BTCF_WriteFlag + return uint8(BTCF_WriteFlag) } return uint8(0) }() @@ -60234,7 +60234,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u if wrFlag != 0 { return uint8(0) } - return PAGER_GET_READONLY + return uint8(PAGER_GET_READONLY) }() // If there are two or more cursors on the same btree, then all such // cursors *must* have the BTCF_Multiple flag set. @@ -60246,7 +60246,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u } (*BtCursor)(unsafe.Pointer(pCur)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpCursor (*BtShared)(unsafe.Pointer(pBt)).FpCursor = pCur - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_OK } @@ -60848,7 +60848,7 @@ __1: if !((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot == Pgno(0)) { goto __6 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_EMPTY goto __7 __6: @@ -60871,7 +60871,7 @@ __8: if !(rc != SQLITE_OK) { goto __10 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return rc __10: ; @@ -60910,7 +60910,7 @@ skip_init: if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) { goto __12 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) goto __13 __12: if !(!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0)) { @@ -60923,11 +60923,11 @@ __12: __16: ; subpage = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8)))) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) rc = moveToChild(tls, pCur, subpage) goto __15 __14: - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) rc = SQLITE_EMPTY __15: ; @@ -61502,7 +61502,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ return SQLITE_DONE } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext > 0 { return SQLITE_OK } @@ -61541,7 +61541,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ } for ok := true; ok; ok = (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -61619,7 +61619,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * return SQLITE_DONE } if CURSOR_SKIPNEXT == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext < 0 { return SQLITE_OK } @@ -61638,7 +61638,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * } else { for int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -62280,7 +62280,7 @@ __5: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __7 } - ptrmapPut(tls, pBt, iPage, PTRMAP_FREEPAGE, uint32(0), bp+8 /* &rc */) + ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+8 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) { goto __8 } @@ -62631,9 +62631,9 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) { var eType U8 = func() uint8 { if pgnoPtrmap != 0 { - return PTRMAP_OVERFLOW2 + return uint8(PTRMAP_OVERFLOW2) } - return PTRMAP_OVERFLOW1 + return uint8(PTRMAP_OVERFLOW1) }() ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoOvfl */)), eType, pgnoPtrmap, bp+12 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -63436,7 +63436,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // be marked as dirty. Returning an error code will cause a // rollback, undoing any changes made to the parent page. if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) if int32(*(*U16)(unsafe.Pointer(bp + 24 /* szCell */))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FminLocal) { ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), bp+136 /* &rc */) } @@ -64284,7 +64284,7 @@ __82: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __83 } - ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) + ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { goto __84 } @@ -64489,7 +64489,7 @@ __108: if !(!(leafCorrection != 0)) { goto __111 } - ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) + ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) __111: ; if !(int32(cachedCellSize(tls, bp+96 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) { @@ -64708,7 +64708,7 @@ __134: goto __136 } key = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FaData + 8)) - ptrmapPut(tls, pBt, key, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) + ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) goto __135 __135: i++ @@ -64804,7 +64804,7 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = allocateBtreePage(tls, pBt, bp /* &pChild */, bp+8 /* &pgnoChild */, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, uint8(0)) copyNodeContent(tls, pRoot, *(*uintptr)(unsafe.Pointer(bp /* pChild */)), bp+12 /* &rc */) if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) } } if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -65417,7 +65417,7 @@ __23: // Also, set the cursor state to invalid. This stops saveCursorPosition() // from trying to save the current position of the cursor. (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK)) { goto __33 } @@ -65438,7 +65438,7 @@ __36: ; __34: ; - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) (*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey __33: ; @@ -65632,7 +65632,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { if bSkipnext != 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) if iCellIdx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = -1 (*BtCursor)(unsafe.Pointer(pCur)).Fix = (U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)) @@ -65643,7 +65643,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = moveToRoot(tls, pCur) if bPreserve != 0 { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_EMPTY { *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK @@ -65705,7 +65705,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags // 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). - *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), BTALLOC_EXACT) + *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(BTALLOC_EXACT)) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } @@ -65763,7 +65763,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } // Update the pointer-map and meta-data with the new root-page number. - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), PTRMAP_ROOTPAGE, uint32(0), bp+40 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(PTRMAP_ROOTPAGE), uint32(0), bp+40 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 { releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))) return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) @@ -66020,7 +66020,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) } - *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), PTRMAP_ROOTPAGE, uint32(0), iTable, 0) + *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), uint8(PTRMAP_ROOTPAGE), uint32(0), iTable, 0) releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */))) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) @@ -66308,7 +66308,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 if isFreeList != 0 { var n U32 = Xsqlite3Get4byte(tls, (pOvflData + 4)) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iPage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0)) } if n > (((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize / U32(4)) - U32(2)) { checkAppendMsg(tls, pCheck, @@ -66318,7 +66318,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 for i = 0; i < int32(n); i++ { var iFreePage Pgno = Xsqlite3Get4byte(tls, (pOvflData + uintptr((8 + (i * 4))))) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iFreePage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iFreePage, uint8(PTRMAP_FREEPAGE), uint32(0)) } checkRef(tls, pCheck, iFreePage) } @@ -66330,7 +66330,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 // the following page matches iPage. if ((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0) && (N > U32(0)) { i = int32(Xsqlite3Get4byte(tls, pOvflData)) - checkPtrmap(tls, pCheck, uint32(i), PTRMAP_OVERFLOW2, iPage) + checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage) } } iPage = Xsqlite3Get4byte(tls, pOvflData) @@ -66546,7 +66546,7 @@ __5: goto __8 } (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 7275 /* "On page %u at ri..." */ - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __8: ; depth = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -66623,7 +66623,7 @@ __14: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __17 } - checkPtrmap(tls, pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage) + checkPtrmap(tls, pCheck, pgnoOvfl, uint8(PTRMAP_OVERFLOW1), iPage) __17: ; checkList(tls, pCheck, 0, pgnoOvfl, nPage) @@ -66638,7 +66638,7 @@ __16: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __20 } - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __20: ; d2 = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -66856,7 +66856,7 @@ __1: (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = uintptr(0) (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = uintptr(0) Xsqlite3StrAccumInit(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */), uintptr(0), bp+136 /* &zErr[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) - (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = SQLITE_PRINTF_INTERNAL + (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage == Pgno(0)) { goto __3 } @@ -66949,7 +66949,7 @@ __10: __8: ; - *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CellSizeCk)) + *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CellSizeCk))) i = Pgno(0) __17: if !((int32(i) < nRoot) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) { @@ -66964,7 +66964,7 @@ __20: if !((((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1))) && !(bPartial != 0)) { goto __21 } - checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), PTRMAP_ROOTPAGE, uint32(0)) + checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(PTRMAP_ROOTPAGE), uint32(0)) __21: ; checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+240 /* ¬Used */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) @@ -67129,7 +67129,7 @@ func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74 var rc int32 Xsqlite3BtreeEnter(tls, p) - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) Xsqlite3BtreeLeave(tls, p) return rc @@ -68202,7 +68202,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem) (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & uint64(0x3fffffff))) - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Str | MEM_Term)) if bForce != 0 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Int | MEM_Real) | MEM_IntReal)))) @@ -68227,7 +68227,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { libc.X__builtin___memset_chk(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})), libc.X__builtin_object_size(tls, bp /* &ctx */, 0)) libc.X__builtin___memset_chk(tls, bp+56 /* &t */, 0, uint64(unsafe.Sizeof(Mem{})), libc.X__builtin_object_size(tls, bp+56 /* &t */, 0)) - (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fdb = (*Mem)(unsafe.Pointer(pMem)).Fdb (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpOut = bp + 56 /* &t */ (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpMem = pMem @@ -68279,7 +68279,7 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325 (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(p)).Fz) } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) } // Release memory held by the Mem p, both external memory cleared @@ -68509,7 +68509,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 case SQLITE_AFF_BLOB: { // Really a cast to BLOB if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) == 0 { - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 { (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob)) @@ -68542,7 +68542,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16(((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) >> 3)) - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Blob) | MEM_Zero)))) return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding)) @@ -68576,7 +68576,7 @@ func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76652:21 if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeMemClearExternAndSetNull(tls, pMem) } else { - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) } } @@ -68594,7 +68594,7 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit n = 0 } *(*int32)(unsafe.Pointer(pMem /* &.u */)) = n - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } @@ -68604,7 +68604,7 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76682:29: */ Xsqlite3VdbeMemSetNull(tls, pMem) *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } // Delete any previous value and set the value stored in *pMem to val, @@ -68614,7 +68614,7 @@ func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3. vdbeReleaseAndSetInt64(tls, pMem, val) } else { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } } @@ -68650,7 +68650,7 @@ func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sql Xsqlite3VdbeMemSetNull(tls, pMem) if !(Xsqlite3IsNaN(tls, val) != 0) { *(*float64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Real) } } @@ -68740,7 +68740,7 @@ func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3 Xsqlite3VdbeMemRelease(tls, pTo) libc.X__builtin___memcpy_chk(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{})), libc.X__builtin_object_size(tls, pTo, 0)) - (*Mem)(unsafe.Pointer(pFrom)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pFrom)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(pFrom)).FszMalloc = 0 } @@ -68775,9 +68775,9 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc } flags = func() uint16 { if int32(enc) == 0 { - return MEM_Blob + return uint16(MEM_Blob) } - return MEM_Str + return uint16(MEM_Str) }() if nByte < 0 { @@ -68868,7 +68868,7 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc // to read from the disk) then the pMem is left in an inconsistent state. func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77006:20: */ var rc int32 - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) if Xsqlite3BtreeMaxRecordSize(tls, pCur) < (Sqlite3_int64(offset + amt)) { return Xsqlite3CorruptError(tls, 77015) } @@ -68876,7 +68876,7 @@ func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz) if rc == SQLITE_OK { *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = int8(0) // Overrun area used when reading malformed records - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob) (*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt) } else { Xsqlite3VdbeMemRelease(tls, pMem) @@ -68974,7 +68974,7 @@ func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3 func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77122:30: */ var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{}))) if p != 0 { - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(p)).Fdb = db } return p @@ -69017,7 +69017,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153 (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = (pRec + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))))) for i = 0; i < nCol; i++ { - (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fdb = db } } else { @@ -69085,7 +69085,7 @@ __1: pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), nVal, enc, uint8(0)) if !((((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & (U32(SQLITE_FUNC_CONSTANT | SQLITE_FUNC_SLOCHNG))) == U32(0)) || - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) { + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) { goto __2 } return SQLITE_OK @@ -69145,7 +69145,7 @@ __9: Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+834 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal))) goto __11 __10: - Xsqlite3ValueApplyAffinity(tls, pVal, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) if !((rc == SQLITE_OK) && (Xsqlite3VdbeMemTooBig(tls, pVal) != 0)) { @@ -69246,8 +69246,8 @@ __3: if !(*(*uintptr)(unsafe.Pointer(ppVal)) != 0) { goto __5 } - Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, SQLITE_UTF8) - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, SQLITE_UTF8) + Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, uint8(SQLITE_UTF8)) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, uint8(SQLITE_UTF8)) __5: ; return rc @@ -69277,7 +69277,7 @@ __6: goto no_mem __9: ; - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) { goto __10 } Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), (I64(*(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))) * I64(negInt))) @@ -69290,16 +69290,16 @@ __10: goto no_mem __12: ; - Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) __11: ; if !(((op == TK_INTEGER) || (op == TK_FLOAT)) && (int32(affinity) == SQLITE_AFF_BLOB)) { goto __13 } - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), SQLITE_AFF_NUMERIC, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8)) goto __14 __13: - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, uint8(SQLITE_UTF8)) __14: ; @@ -69394,7 +69394,7 @@ __30: if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) { goto __33 } - (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = MEM_Int + (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0))) __33: ; @@ -69479,7 +69479,7 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 { Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) } - } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var v uintptr var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar) @@ -69723,7 +69723,7 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77 (*Vdbe)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe (*Vdbe)(unsafe.Pointer(p)).FpPrev = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FpVdbe = p - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_INIT + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_INIT) (*Vdbe)(unsafe.Pointer(p)).FpParse = pParse (*Parse)(unsafe.Pointer(pParse)).FpVdbe = p @@ -69870,7 +69870,7 @@ func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3 *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) (*VdbeOp)(unsafe.Pointer(pOp)).FzComment = uintptr(0) return i } @@ -70376,7 +70376,7 @@ __1: *(*int32)(unsafe.Pointer(pOut + 8 /* &.p2 */)) += ((*Vdbe)(unsafe.Pointer(p)).FnOp) } (*VdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp3) - (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOut + 16 /* &.p4 */)) = uintptr(0) (*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0) (*VdbeOp)(unsafe.Pointer(pOut)).FzComment = uintptr(0) @@ -70450,7 +70450,7 @@ func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sq // If the input FuncDef structure is ephemeral, then free it. If // the FuncDef is not ephermal, then do nothing. func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:78840:13: */ - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_EPHEM) != U32(0) { + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_EPHEM)) != U32(0) { Xsqlite3DbFreeNN(tls, db, pDef) } } @@ -70564,9 +70564,9 @@ func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* s pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32) freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Noop + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Noop) return 1 } @@ -71146,7 +71146,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: (*Mem)(unsafe.Pointer(p)).FszMalloc = 0 } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Undefined) } } } @@ -71316,7 +71316,7 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * // Loop counter var rc int32 = SQLITE_OK // Return code var pMem uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaMem + 1*56) // First Mem of result set - var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TriggerEQP) != uint64(0)))) + var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TriggerEQP)) != uint64(0)))) // var aOp uintptr at bp+8, 8 // Array of opcodes var pOp uintptr // Current opcode @@ -71360,12 +71360,12 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(1)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4) } else { Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(0)*56), int64(*(*int32)(unsafe.Pointer(bp /* i */)))) Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(1)*56), Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)), - -1, SQLITE_UTF8, uintptr(0)) + -1, uint8(SQLITE_UTF8), uintptr(0)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(3)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(4)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) @@ -71373,10 +71373,10 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(6)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp5)) { var zCom uintptr = Xsqlite3VdbeDisplayComment(tls, db, pOp, zP4) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(7)*56), zCom, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(7)*56), zCom, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) } - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8) } (*Vdbe)(unsafe.Pointer(p)).FpResultSet = pMem @@ -71436,11 +71436,11 @@ func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */ // There should be at least one opcode. // Set the magic to VDBE_MAGIC_RUN sooner rather than later. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RUN + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_RUN) (*Vdbe)(unsafe.Pointer(p)).Fpc = -1 (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) (*Vdbe)(unsafe.Pointer(p)).FnChange = 0 (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = U32(1) (*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = U8(255) @@ -71562,9 +71562,9 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite } else { (*Vdbe)(unsafe.Pointer(p)).FnCursor = nCursor (*Vdbe)(unsafe.Pointer(p)).FnVar = YnVar(nVar) - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null)) (*Vdbe)(unsafe.Pointer(p)).FnMem = nMem - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, MEM_Undefined) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined)) libc.X__builtin___memset_chk(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0)))), libc.X__builtin_object_size(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0)) } Xsqlite3VdbeRewind(tls, p) @@ -71703,7 +71703,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, uint16(MEM_Null)) } // Set the name of the idx'th column to be returned by the SQL statement. @@ -71724,7 +71724,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa } pColName = ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr((idx+(var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))))*56) - rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, SQLITE_UTF8, xDel) + rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, uint8(SQLITE_UTF8), xDel) return rc } @@ -72041,7 +72041,7 @@ func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sq if ((deferred != 0) && (((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons + (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons) > int64(0))) || (!(deferred != 0) && ((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0))) { (*Vdbe)(unsafe.Pointer(p)).Frc = (SQLITE_CONSTRAINT | (int32(3) << 8)) - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) Xsqlite3VdbeError(tls, p, ts+8032 /* "FOREIGN KEY cons..." */, 0) return SQLITE_ERROR } @@ -72078,7 +72078,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * // state. We need to rollback the statement transaction, if there is // one, or the complete transaction if there is no statement transaction. - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN { + if (*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_RUN) { return SQLITE_OK } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -72164,7 +72164,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } else { (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) Xsqlite3CommitInternalChanges(tls, db) } } else { @@ -72231,7 +72231,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_HALT + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_HALT) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM @@ -72273,7 +72273,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80 if (*Sqlite3)(unsafe.Pointer(db)).FpErr == uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).FpErr = Xsqlite3ValueNew(tls, db) } - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) Xsqlite3EndBenignMalloc(tls) (*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc-- } else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { @@ -72338,7 +72338,7 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: (*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0) // Save profiling information from this VDBE run. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RESET + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_RESET) return ((*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } @@ -72346,7 +72346,7 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: // the result code. Write any error message text into *pzErrMsg. func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:20: */ var rc int32 = SQLITE_OK - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_HALT) { + if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == U32(VDBE_MAGIC_HALT)) { rc = Xsqlite3VdbeReset(tls, p) } @@ -72403,7 +72403,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3. vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp) Xsqlite3DbFree(tls, db, pSub) } - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_INIT { + if (*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_INIT) { releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpVList) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpFree) @@ -72429,7 +72429,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ if (*Vdbe)(unsafe.Pointer(p)).FpNext != 0 { (*Vdbe)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpNext)).FpPrev = (*Vdbe)(unsafe.Pointer(p)).FpPrev } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_DEAD + (*Vdbe)(unsafe.Pointer(p)).Fmagic = U32(VDBE_MAGIC_DEAD) (*Vdbe)(unsafe.Pointer(p)).Fdb = uintptr(0) Xsqlite3DbFreeNN(tls, db, p) } @@ -72454,7 +72454,7 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:812 } atomic.AddInt32(&Xsqlite3_search_count, 1) (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) return SQLITE_OK } @@ -72472,7 +72472,7 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: var rc int32 rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */)), bp /* &isDifferentRow */) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) if *(*int32)(unsafe.Pointer(bp /* isDifferentRow */)) != 0 { (*VdbeCursor)(unsafe.Pointer(p)).FnullRow = U8(1) } @@ -72698,7 +72698,7 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { // EVIDENCE-OF: R-29851-52272 Value is a big-endian 64-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*I64)(unsafe.Pointer(bp /* &x */)) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } else { // EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit @@ -72707,9 +72707,9 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { libc.X__builtin___memcpy_chk(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint64(unsafe.Sizeof(U64(0))), libc.X__builtin_object_size(tls, (pMem /* &.u */ /* &.r */), 0)) (*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 { if (((*(*U64)(unsafe.Pointer(bp /* x */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* x */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0)) { - return MEM_Null + return uint16(MEM_Null) } - return MEM_Real + return uint16(MEM_Real) }() } return U32(8) @@ -72731,7 +72731,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin case U32(0): { // Null // EVIDENCE-OF: R-24078-09375 Value is a NULL. - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) break } @@ -72740,7 +72740,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-44885-25196 Value is an 8-bit twos-complement // integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = I64(I8(*(*uint8)(unsafe.Pointer((buf))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(1) @@ -72750,7 +72750,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-49794-35026 Value is a big-endian 16-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(2) @@ -72760,7 +72760,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-37839-54301 Value is a big-endian 24-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(((65536 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 2))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(3) @@ -72770,7 +72770,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((((16777216 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 16)) | (int32(*(*uint8)(unsafe.Pointer((buf) + 2))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 3))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(4) @@ -72780,7 +72780,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-50385-09674 Value is a big-endian 48-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = ((I64((((U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2))))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(6) @@ -72801,7 +72801,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-12976-22893 Value is the integer 0. // EVIDENCE-OF: R-18143-12121 Value is the integer 1. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(serial_type - U32(8))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(0) } @@ -72928,15 +72928,15 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin // var c2 Mem at bp+56, 56 - Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) - Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) + Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) + Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) Xsqlite3VdbeMemShallowCopy(tls, bp /* &c1 */, pMem1, MEM_Ephem) Xsqlite3VdbeMemShallowCopy(tls, bp+56 /* &c2 */, pMem2, MEM_Ephem) v1 = Xsqlite3ValueText(tls, bp /* &c1 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) v2 = Xsqlite3ValueText(tls, bp+56 /* &c2 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) if (v1 == uintptr(0)) || (v2 == uintptr(0)) { if prcErr != 0 { - *(*U8)(unsafe.Pointer(prcErr)) = SQLITE_NOMEM + *(*U8)(unsafe.Pointer(prcErr)) = U8(SQLITE_NOMEM) } rc = 0 } else { @@ -73324,7 +73324,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else if *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)) != 0 { (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb - (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = MEM_Str + (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = U16(MEM_Str) (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fz = (aKey1 + uintptr(d1)) rc = vdbeCompareMemString(tls, bp+8 /* &mem1 */, pRhs, *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)), (pPKey2 + 19 /* &.errCode */)) @@ -73834,7 +73834,7 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin var pRet uintptr = Xsqlite3ValueNew(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb) if pRet != 0 { Xsqlite3VdbeMemCopy(tls, pRet, pMem) - Xsqlite3ValueApplyAffinity(tls, pRet, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pRet, aff, uint8(SQLITE_UTF8)) } return pRet } @@ -73936,7 +73936,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName libc.X__builtin___memset_chk(tls, bp /* &preupdate */, 0, uint64(unsafe.Sizeof(PreUpdate{})), libc.X__builtin_object_size(tls, bp /* &preupdate */, 0)) - if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) == 0 { + if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) == 0 { iKey1 = libc.AssignInt64(&iKey2, int64(0)) (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab) } else { @@ -74044,7 +74044,7 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c: (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 248 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)))) } if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_PROFILE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_PROFILE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) } (*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0) } @@ -74119,7 +74119,7 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: Xsqlite3_mutex_enter(tls, mutex) for i = 0; i < int32((*Vdbe)(unsafe.Pointer(p)).FnVar); i++ { Xsqlite3VdbeMemRelease(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)) - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = U16(MEM_Null) } if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 { @@ -74157,11 +74157,11 @@ func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:831 } func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83172:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF8) + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF8)) } func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83175:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF16LE) + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF16LE)) } func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83178:19: */ @@ -74200,19 +74200,19 @@ func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr } func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83204:32: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) } func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83208:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83211:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16BE) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16BE)) } func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83214:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } // EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five @@ -74223,70 +74223,70 @@ func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83222 } var aType = [64]U8{ - SQLITE_BLOB, // 0x00 (not possible) - SQLITE_NULL, // 0x01 NULL - SQLITE_TEXT, // 0x02 TEXT - SQLITE_NULL, // 0x03 (not possible) - SQLITE_INTEGER, // 0x04 INTEGER - SQLITE_NULL, // 0x05 (not possible) - SQLITE_INTEGER, // 0x06 INTEGER + TEXT - SQLITE_NULL, // 0x07 (not possible) - SQLITE_FLOAT, // 0x08 FLOAT - SQLITE_NULL, // 0x09 (not possible) - SQLITE_FLOAT, // 0x0a FLOAT + TEXT - SQLITE_NULL, // 0x0b (not possible) - SQLITE_INTEGER, // 0x0c (not possible) - SQLITE_NULL, // 0x0d (not possible) - SQLITE_INTEGER, // 0x0e (not possible) - SQLITE_NULL, // 0x0f (not possible) - SQLITE_BLOB, // 0x10 BLOB - SQLITE_NULL, // 0x11 (not possible) - SQLITE_TEXT, // 0x12 (not possible) - SQLITE_NULL, // 0x13 (not possible) - SQLITE_INTEGER, // 0x14 INTEGER + BLOB - SQLITE_NULL, // 0x15 (not possible) - SQLITE_INTEGER, // 0x16 (not possible) - SQLITE_NULL, // 0x17 (not possible) - SQLITE_FLOAT, // 0x18 FLOAT + BLOB - SQLITE_NULL, // 0x19 (not possible) - SQLITE_FLOAT, // 0x1a (not possible) - SQLITE_NULL, // 0x1b (not possible) - SQLITE_INTEGER, // 0x1c (not possible) - SQLITE_NULL, // 0x1d (not possible) - SQLITE_INTEGER, // 0x1e (not possible) - SQLITE_NULL, // 0x1f (not possible) - SQLITE_FLOAT, // 0x20 INTREAL - SQLITE_NULL, // 0x21 (not possible) - SQLITE_TEXT, // 0x22 INTREAL + TEXT - SQLITE_NULL, // 0x23 (not possible) - SQLITE_FLOAT, // 0x24 (not possible) - SQLITE_NULL, // 0x25 (not possible) - SQLITE_FLOAT, // 0x26 (not possible) - SQLITE_NULL, // 0x27 (not possible) - SQLITE_FLOAT, // 0x28 (not possible) - SQLITE_NULL, // 0x29 (not possible) - SQLITE_FLOAT, // 0x2a (not possible) - SQLITE_NULL, // 0x2b (not possible) - SQLITE_FLOAT, // 0x2c (not possible) - SQLITE_NULL, // 0x2d (not possible) - SQLITE_FLOAT, // 0x2e (not possible) - SQLITE_NULL, // 0x2f (not possible) - SQLITE_BLOB, // 0x30 (not possible) - SQLITE_NULL, // 0x31 (not possible) - SQLITE_TEXT, // 0x32 (not possible) - SQLITE_NULL, // 0x33 (not possible) - SQLITE_FLOAT, // 0x34 (not possible) - SQLITE_NULL, // 0x35 (not possible) - SQLITE_FLOAT, // 0x36 (not possible) - SQLITE_NULL, // 0x37 (not possible) - SQLITE_FLOAT, // 0x38 (not possible) - SQLITE_NULL, // 0x39 (not possible) - SQLITE_FLOAT, // 0x3a (not possible) - SQLITE_NULL, // 0x3b (not possible) - SQLITE_FLOAT, // 0x3c (not possible) - SQLITE_NULL, // 0x3d (not possible) - SQLITE_FLOAT, // 0x3e (not possible) - SQLITE_NULL, // 0x3f (not possible) + U8(SQLITE_BLOB), // 0x00 (not possible) + U8(SQLITE_NULL), // 0x01 NULL + U8(SQLITE_TEXT), // 0x02 TEXT + U8(SQLITE_NULL), // 0x03 (not possible) + U8(SQLITE_INTEGER), // 0x04 INTEGER + U8(SQLITE_NULL), // 0x05 (not possible) + U8(SQLITE_INTEGER), // 0x06 INTEGER + TEXT + U8(SQLITE_NULL), // 0x07 (not possible) + U8(SQLITE_FLOAT), // 0x08 FLOAT + U8(SQLITE_NULL), // 0x09 (not possible) + U8(SQLITE_FLOAT), // 0x0a FLOAT + TEXT + U8(SQLITE_NULL), // 0x0b (not possible) + U8(SQLITE_INTEGER), // 0x0c (not possible) + U8(SQLITE_NULL), // 0x0d (not possible) + U8(SQLITE_INTEGER), // 0x0e (not possible) + U8(SQLITE_NULL), // 0x0f (not possible) + U8(SQLITE_BLOB), // 0x10 BLOB + U8(SQLITE_NULL), // 0x11 (not possible) + U8(SQLITE_TEXT), // 0x12 (not possible) + U8(SQLITE_NULL), // 0x13 (not possible) + U8(SQLITE_INTEGER), // 0x14 INTEGER + BLOB + U8(SQLITE_NULL), // 0x15 (not possible) + U8(SQLITE_INTEGER), // 0x16 (not possible) + U8(SQLITE_NULL), // 0x17 (not possible) + U8(SQLITE_FLOAT), // 0x18 FLOAT + BLOB + U8(SQLITE_NULL), // 0x19 (not possible) + U8(SQLITE_FLOAT), // 0x1a (not possible) + U8(SQLITE_NULL), // 0x1b (not possible) + U8(SQLITE_INTEGER), // 0x1c (not possible) + U8(SQLITE_NULL), // 0x1d (not possible) + U8(SQLITE_INTEGER), // 0x1e (not possible) + U8(SQLITE_NULL), // 0x1f (not possible) + U8(SQLITE_FLOAT), // 0x20 INTREAL + U8(SQLITE_NULL), // 0x21 (not possible) + U8(SQLITE_TEXT), // 0x22 INTREAL + TEXT + U8(SQLITE_NULL), // 0x23 (not possible) + U8(SQLITE_FLOAT), // 0x24 (not possible) + U8(SQLITE_NULL), // 0x25 (not possible) + U8(SQLITE_FLOAT), // 0x26 (not possible) + U8(SQLITE_NULL), // 0x27 (not possible) + U8(SQLITE_FLOAT), // 0x28 (not possible) + U8(SQLITE_NULL), // 0x29 (not possible) + U8(SQLITE_FLOAT), // 0x2a (not possible) + U8(SQLITE_NULL), // 0x2b (not possible) + U8(SQLITE_FLOAT), // 0x2c (not possible) + U8(SQLITE_NULL), // 0x2d (not possible) + U8(SQLITE_FLOAT), // 0x2e (not possible) + U8(SQLITE_NULL), // 0x2f (not possible) + U8(SQLITE_BLOB), // 0x30 (not possible) + U8(SQLITE_NULL), // 0x31 (not possible) + U8(SQLITE_TEXT), // 0x32 (not possible) + U8(SQLITE_NULL), // 0x33 (not possible) + U8(SQLITE_FLOAT), // 0x34 (not possible) + U8(SQLITE_NULL), // 0x35 (not possible) + U8(SQLITE_FLOAT), // 0x36 (not possible) + U8(SQLITE_NULL), // 0x37 (not possible) + U8(SQLITE_FLOAT), // 0x38 (not possible) + U8(SQLITE_NULL), // 0x39 (not possible) + U8(SQLITE_FLOAT), // 0x3a (not possible) + U8(SQLITE_NULL), // 0x3b (not possible) + U8(SQLITE_FLOAT), // 0x3c (not possible) + U8(SQLITE_NULL), // 0x3d (not possible) + U8(SQLITE_FLOAT), // 0x3e (not possible) + U8(SQLITE_NULL), // 0x3f (not possible) } /* sqlite3.c:83223:19 */ // Return true if a parameter to xUpdate represents an unchanged column @@ -74384,13 +74384,13 @@ func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqli func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83413:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) } func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83419:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF16LE, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(-1)) } func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:83425:17: */ @@ -74412,7 +74412,7 @@ func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType u var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut Xsqlite3VdbeMemRelease(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) } @@ -74425,13 +74425,13 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83455:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF8, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) } func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:83464:17: */ if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } if n > uint64(0x7fffffff) { invokeValueDestructor(tls, z, xDel, pCtx) @@ -74442,17 +74442,17 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83481:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83490:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16BE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16BE), xDel) } func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83499:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:83509:17: */ @@ -74484,7 +74484,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* }() if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Null) != 0 { Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, Xsqlite3ErrStr(tls, errCode), -1, - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) } } @@ -74493,7 +74493,7 @@ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83 (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_TOOBIG Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+8230 /* "string or blob t..." */, -1, - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) } // An SQLITE_NOMEM error. @@ -74546,7 +74546,7 @@ func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83602:12: */ var db uintptr var rc int32 - if !((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) { + if !((*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_RUN)) { goto __1 } // We used to require that sqlite3_reset() be called before retrying @@ -74827,7 +74827,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } else { Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Agg + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Agg) *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 { libc.X__builtin___memset_chk(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte), libc.X__builtin_object_size(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0)) @@ -74990,7 +74990,7 @@ func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84002:18: */ } var nullMem = Mem{ - /* .flags = */ Fflags: MEM_Null, + /* .flags = */ Fflags: U16(MEM_Null), } /* sqlite3.c:84012:20 */ // Check to see if column iCol of the given statement is valid. If @@ -75239,7 +75239,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 return Xsqlite3MisuseError(tls, 84320) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { + if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_MISUSE) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) Xsqlite3_log(tls, SQLITE_MISUSE, @@ -75254,7 +75254,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 i-- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56) Xsqlite3VdbeMemRelease(tls, pVar) - (*Mem)(unsafe.Pointer(pVar)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pVar)).Fflags = U16(MEM_Null) (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FerrCode = SQLITE_OK // If the bit corresponding to this variable in Vdbe.expmask is set, then @@ -75368,7 +75368,7 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, } func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84472:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF8) + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF8)) } func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:84481:16: */ @@ -75377,7 +75377,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, return invokeValueDestructor(tls, zData, xDel, uintptr(0)) } else { if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } return bindText(tls, pStmt, i, zData, int32(nData), xDel, enc) } @@ -75385,7 +75385,7 @@ func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, } func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84498:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF16LE) + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:84508:16: */ @@ -75565,7 +75565,7 @@ func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: // Return true if the prepared statement is in need of being reset. func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84675:16: */ var v uintptr = pStmt - return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == VDBE_MAGIC_RUN)) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) + return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == U32(VDBE_MAGIC_RUN))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) } // Return a pointer to the next prepared statement after pStmt associated @@ -76064,7 +76064,7 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { (*Mem)(unsafe.Pointer(bp + 192 /* &utf8 */)).Fdb = db Xsqlite3VdbeMemSetStr(tls, bp+192 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, (*Mem)(unsafe.Pointer(pVar)).Fn, enc, uintptr(0)) if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+192 /* &utf8 */, SQLITE_UTF8) { - (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = SQLITE_NOMEM + (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = U8(SQLITE_NOMEM) (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FnAlloc = U32(0) } pVar = bp + 192 /* &utf8 */ @@ -76421,15 +76421,15 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28 if rc <= 0 { if (rc == 0) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } else { - return MEM_Real + return U16(MEM_Real) } } else if (rc == 1) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } - return MEM_Real + return U16(MEM_Real) } // Return the numeric type for pMem, either MEM_Int or MEM_Real or both or @@ -76453,7 +76453,7 @@ func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */ // overwritten with an integer value. func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:85961:28: */ Xsqlite3VdbeMemSetNull(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } @@ -76465,7 +76465,7 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3. if (int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { //OPTIMIZATION-IF-FALSE return out2PrereleaseWithClear(tls, pOut) } else { - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } return uintptr(0) @@ -79521,7 +79521,7 @@ __12: // jump ; pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 32))) // Most jump operations do a goto to this spot in order to update @@ -79538,7 +79538,7 @@ __13: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*32) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __10 // Opcode: InitCoroutine P1 P2 P3 * * @@ -79557,7 +79557,7 @@ __14: // jump pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = (I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1)) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) { goto __186 } @@ -79579,7 +79579,7 @@ __15: pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*32) pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*32) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __10 // Opcode: Yield P1 P2 * * * @@ -79597,7 +79597,7 @@ __15: __16: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) pcDest = int32(*(*I64)(unsafe.Pointer(pIn1 /* &.u */))) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 32))) @@ -79750,7 +79750,7 @@ __20: // out2 // Write that value into register P2. __21: // same as TK_FLOAT, out2 pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Real) *(*float64)(unsafe.Pointer(pOut /* &.u */)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) goto __10 @@ -79770,7 +79770,7 @@ __22: // same as TK_STRING, out2 if !(int32(encoding) != SQLITE_UTF8) { goto __196 } - rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, SQLITE_UTF8, uintptr(0)) + rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, uint8(SQLITE_UTF8), uintptr(0)) if !(rc != 0) { goto __197 @@ -79804,7 +79804,7 @@ __196: goto too_big __200: ; - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_String + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_String) // Opcode: String P1 P2 P3 P4 P5 // Synopsis: r[P2]='P4' (len=P1) @@ -79846,7 +79846,7 @@ __24: if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 { return (uint16(MEM_Null | MEM_Cleared)) } - return MEM_Null + return uint16(MEM_Null) }()) (*Mem)(unsafe.Pointer(pOut)).Fn = 0 __201: @@ -80110,7 +80110,7 @@ __218: if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_ROW) != 0) { goto __219 } - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_ROW, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) __219: ; @@ -80601,7 +80601,7 @@ __45: // jump, in1 if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { goto __274 } - applyAffinity(tls, pIn1, SQLITE_AFF_NUMERIC, encoding) + applyAffinity(tls, pIn1, int8(SQLITE_AFF_NUMERIC), encoding) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { goto __275 } @@ -81249,7 +81249,7 @@ __62: // same as TK_BITNOT, in1, out2 if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { goto __330 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = ^Xsqlite3VdbeIntValue(tls, pIn1) __330: ; @@ -81700,7 +81700,7 @@ __375: if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < (len + 2)) { goto __377 } - (*Mem)(unsafe.Pointer(pDest)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pDest)).Fflags = U16(MEM_Null) if !(Xsqlite3VdbeMemGrow(tls, pDest, (len+2), 0) != 0) { goto __379 } @@ -82166,7 +82166,7 @@ __434: __432: ; (*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Blob) if !(nZero != 0) { goto __435 } @@ -82393,7 +82393,7 @@ __457: if !(p12 == SAVEPOINT_ROLLBACK) { goto __463 } - isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0))) + isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0))) ii = 0 __465: if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { @@ -82445,7 +82445,7 @@ __471: } Xsqlite3ExpirePreparedStatements(tls, db, 0) Xsqlite3ResetAllSchemasOfConnection(tls, db) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) __473: ; __458: @@ -82649,7 +82649,7 @@ __484: __76: *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) = 0 - if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_QueryOnly) != uint64(0))) { + if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_QueryOnly)) != uint64(0))) { goto __494 } rc = SQLITE_READONLY @@ -82798,7 +82798,7 @@ __78: } // When the schema cookie changes, record the new cookie internally (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = ((*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5)) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) goto __505 __504: if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_FILE_FORMAT) { @@ -82991,7 +82991,7 @@ __516: ; // Table with INTEGER PRIMARY KEY and nothing else - pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, CURTYPE_BTREE) + pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, uint8(CURTYPE_BTREE)) if !(pCur == uintptr(0)) { goto __518 } @@ -83035,7 +83035,7 @@ __82: // The new cursor // Only ephemeral cursors can be duplicated - pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, CURTYPE_BTREE) + pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, uint8(CURTYPE_BTREE)) if !(pCx == uintptr(0)) { goto __520 } @@ -83095,11 +83095,11 @@ __84: // so that the table is empty again, rather than creating a new table. (*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0) - (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(CACHE_STALE) rc = Xsqlite3BtreeClearTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0)) goto __522 __521: - pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_BTREE) + pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_BTREE)) if !(pCx1 == uintptr(0)) { goto __523 } @@ -83140,8 +83140,8 @@ __528: (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0) goto __527 __526: - (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = SCHEMA_ROOT - rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, SCHEMA_ROOT, BTREE_WRCSR, + (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(SCHEMA_ROOT) + rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, uint32(SCHEMA_ROOT), BTREE_WRCSR, uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */))) (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1) __527: @@ -83172,7 +83172,7 @@ __529: __85: ; - pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_SORTER) + pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_SORTER)) if !(pCx2 == uintptr(0)) { goto __530 } @@ -83226,7 +83226,7 @@ __532: __87: ; - pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, CURTYPE_PSEUDO) + pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, uint8(CURTYPE_PSEUDO)) if !(pCx3 == uintptr(0)) { goto __533 } @@ -83354,7 +83354,7 @@ __92: // Only interested in == results (*VdbeCursor)(unsafe.Pointer(pC3)).FnullRow = U8(0) (*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = U32(CACHE_STALE) if !((*VdbeCursor)(unsafe.Pointer(pC3)).FisTable != 0) { goto __534 } @@ -83453,7 +83453,7 @@ __534: // OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be // immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively, // with the same key. - if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), BTREE_SEEK_EQ) != 0) { + if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uint32(BTREE_SEEK_EQ)) != 0) { goto __549 } eqOnly = 1 @@ -83796,7 +83796,7 @@ __580: alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0)) (*VdbeCursor)(unsafe.Pointer(pC6)).FnullRow = (U8(1 - alreadyExists)) (*VdbeCursor)(unsafe.Pointer(pC6)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = U32(CACHE_STALE) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Found) { goto __581 } @@ -83878,7 +83878,7 @@ __99: // changing the datatype of pIn3, however, as it is used by other // parts of the prepared statement. *(*Mem)(unsafe.Pointer(bp + 360 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3)) - applyAffinity(tls, bp+360 /* &x */, SQLITE_AFF_NUMERIC, encoding) + applyAffinity(tls, bp+360 /* &x */, int8(SQLITE_AFF_NUMERIC), encoding) if !((int32((*Mem)(unsafe.Pointer(bp+360 /* &x */)).Fflags) & MEM_Int) == 0) { goto __586 } @@ -83903,7 +83903,7 @@ notExistsWithKey: (*VdbeCursor)(unsafe.Pointer(pC7)).FmovetoTarget = I64(iKey1) // Used by OP_Delete (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(CACHE_STALE) (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0) (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) @@ -84107,7 +84107,7 @@ __610: __605: ; (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(CACHE_STALE) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */)) goto __10 @@ -84232,7 +84232,7 @@ __620: rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+432, /* &x1 */ (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_APPEND | OPFLAG_SAVEPOSITION)), seekResult) (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(CACHE_STALE) // Invoke the update-hook if required. if !(rc != 0) { @@ -84347,7 +84347,7 @@ __627: // Only flags that can be set are SAVEPOISTION and AUXDELETE rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5)) - (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(CACHE_STALE) (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult = 0 if !(rc != 0) { goto __628 @@ -84361,7 +84361,7 @@ __628: goto __629 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ - if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __630 } (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName, @@ -84446,7 +84446,7 @@ __107: goto abort_due_to_error __633: ; - (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = U32(CACHE_STALE) goto __10 // Opcode: RowData P1 P2 P3 * * @@ -84541,7 +84541,7 @@ __109: if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { goto __638 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __10 goto __639 __638: @@ -84580,7 +84580,7 @@ __645: if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { goto __646 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __10 __646: ; @@ -84604,7 +84604,7 @@ __110: pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) (*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow = U8(1) - (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = U32(CACHE_STALE) if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_BTREE) { goto __647 } @@ -84658,7 +84658,7 @@ __648: rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+496 /* &res7 */) (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */))) (*VdbeCursor)(unsafe.Pointer(pC16)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { goto __650 } @@ -84770,7 +84770,7 @@ __657: rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+504 /* &res9 */) (*VdbeCursor)(unsafe.Pointer(pC18)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = U32(CACHE_STALE) __658: ; if !(rc != 0) { @@ -84863,7 +84863,7 @@ __119: // jump rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3) next_tail: - (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(CACHE_STALE) if !(rc == SQLITE_OK) { goto __661 @@ -84949,7 +84949,7 @@ __664: return 0 }()) - (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { goto __665 } @@ -85025,7 +85025,7 @@ __668: if !(*(*int32)(unsafe.Pointer(bp + 584 /* res10 */)) == 0) { goto __669 } - rc = Xsqlite3BtreeDelete(tls, pCrsr7, BTREE_AUXDELETE) + rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(BTREE_AUXDELETE)) if !(rc != 0) { goto __671 } @@ -85044,7 +85044,7 @@ __672: __670: ; - (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = U32(CACHE_STALE) (*VdbeCursor)(unsafe.Pointer(pC22)).FseekResult = 0 goto __10 @@ -85274,12 +85274,12 @@ __130: ; pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > ((*Sqlite3)(unsafe.Pointer(db)).FnVDestroy + 1)) { goto __687 } rc = SQLITE_LOCKED - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) goto abort_due_to_error goto __688 __687: @@ -85287,7 +85287,7 @@ __687: *(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) = 0 // Not needed. Only to silence a warning. rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+628 /* &iMoved */) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))) if !(rc != 0) { goto __689 @@ -85449,8 +85449,8 @@ __135: } Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpSchema) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))) - rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), INITFLAG_AlterTable) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), uint32(INITFLAG_AlterTable)) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) goto __700 __699: @@ -85610,7 +85610,7 @@ __708: goto __711 __710: *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) - 1)) - Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) __711: ; __709: @@ -85854,7 +85854,7 @@ __731: if !(pMem2 != pEnd) { goto __733 } - (*Mem)(unsafe.Pointer(pMem2)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pMem2)).Fflags = U16(MEM_Undefined) (*Mem)(unsafe.Pointer(pMem2)).Fdb = db goto __732 __732: @@ -85917,7 +85917,7 @@ __145: // (deferred foreign key constraints). Otherwise, if P1 is zero, the // statement counter is incremented (immediate foreign key constraints). __146: - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { goto __734 } *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) @@ -86179,7 +86179,7 @@ __755: ; (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = ((pCtx + 48 /* &.argv */) + uintptr(n4)*8) - Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, MEM_Null) + Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32((int64(pOp) - int64(aOp)) / 32)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p @@ -86191,7 +86191,7 @@ __755: // OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_AggStep1 + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_AggStep1) __155: ; @@ -86259,7 +86259,7 @@ __765: __764: ; Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut) - (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(MEM_Null) (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0 if !(rc != 0) { goto __766 @@ -86500,7 +86500,7 @@ __787: (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((MEM_Str | MEM_Static) | MEM_Term)) (*Mem)(unsafe.Pointer(pOut)).Fz = Xsqlite3JournalModename(tls, eNew) (*Mem)(unsafe.Pointer(pOut)).Fn = Xsqlite3Strlen30(tls, (*Mem)(unsafe.Pointer(pOut)).Fz) - (*Mem)(unsafe.Pointer(pOut)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pOut)).Fenc = U8(SQLITE_UTF8) Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) if !(rc != 0) { goto __788 @@ -86627,7 +86627,7 @@ __164: // used to generate an error message if the lock cannot be obtained. __165: isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3) - if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReadUncommit))) { + if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReadUncommit)))) { goto __794 } p13 = (*Op)(unsafe.Pointer(pOp)).Fp1 @@ -86753,7 +86753,7 @@ __803: (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)))).FpVtab = pVtab1 // Initialize vdbe cursor object - pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, CURTYPE_VTAB) + pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, uint8(CURTYPE_VTAB)) if !(pCur1 != 0) { goto __804 } @@ -86956,8 +86956,8 @@ __819: // in register P1 is passed as the zName argument to the xRename method. __173: - isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_LegacyAlter) + isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_LegacyAlter)) pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab pName = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) @@ -86972,7 +86972,7 @@ __820: if !(isLegacy == 0) { goto __821 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyAlter)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyAlter))) __821: ; Xsqlite3VtabImportErrmsg(tls, p, pVtab5) @@ -87075,7 +87075,7 @@ __829: __832: (*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 { if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Replace { - return OE_Abort + return uint8(OE_Abort) } return uint8((*Op)(unsafe.Pointer(pOp)).Fp5) }() @@ -87309,11 +87309,11 @@ __847: goto __849 } z3 = Xsqlite3MPrintf(tls, db, ts+8908 /* "-- %s" */, libc.VaList(bp+136, zTrace)) - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) Xsqlite3DbFree(tls, db, z3) goto __850 __849: - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) __850: ; __848: @@ -87481,7 +87481,7 @@ var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:87461:32 */ var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:87681:32 */ var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:87684:32 */ -var aFlag1 = [2]U16{MEM_Blob, (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88134:24 */ +var aFlag1 = [2]U16{U16(MEM_Blob), (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88134:24 */ var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:89263:20 */ //************* End of vdbe.c *********************************************** @@ -87561,7 +87561,7 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) // Set the value of register r[1] in the SQL statement to integer iRow. // This is done directly as a performance optimization - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56 /* &.u */)) = iRow // If the statement has been run before (and is paused at the OP_ResultRow) @@ -87683,7 +87683,7 @@ __4: Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+9061 /* "cannot open virt..." */, libc.VaList(bp, zTable)) __5: ; - if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __6 } pTab = uintptr(0) @@ -87752,7 +87752,7 @@ __14: goto __15 } zFault = uintptr(0) - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { goto __16 } pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey @@ -87869,7 +87869,7 @@ __33: if !(wrFlag != 0) { goto __35 } - (*VdbeOp)(unsafe.Pointer(aOp + 1*32)).Fopcode = OP_OpenWrite + (*VdbeOp)(unsafe.Pointer(aOp + 1*32)).Fopcode = U8(OP_OpenWrite) __35: ; (*VdbeOp)(unsafe.Pointer(aOp + 1*32)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum) @@ -87944,13 +87944,13 @@ __38: var iLn int32 = 0 /* sqlite3.c:93635:24 */ var openBlob = [6]VdbeOpList{ - {Fopcode: OP_TableLock}, // 0: Acquire a read or write lock - {Fopcode: OP_OpenRead}, // 1: Open a cursor + {Fopcode: U8(OP_TableLock)}, // 0: Acquire a read or write lock + {Fopcode: U8(OP_OpenRead)}, // 1: Open a cursor // blobSeekToRow() will initialize r[1] to the desired rowid - {Fopcode: OP_NotExists, Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] - {Fopcode: OP_Column, Fp3: int8(1)}, // 3 - {Fopcode: OP_ResultRow, Fp1: int8(1)}, // 4 - {Fopcode: OP_Halt}, // 5 + {Fopcode: U8(OP_NotExists), Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] + {Fopcode: U8(OP_Column), Fp3: int8(1)}, // 3 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1)}, // 4 + {Fopcode: U8(OP_Halt)}, // 5 } /* sqlite3.c:93636:31 */ // Close a blob handle that was previously created using @@ -89112,7 +89112,7 @@ func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:949 var rc int32 = SQLITE_OK if (*SortSubtask)(unsafe.Pointer(pTask)).FpThread != 0 { - *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(SQLITE_ERROR) + *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(int64(SQLITE_ERROR)) Xsqlite3ThreadJoin(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpThread, bp /* &pRet */) @@ -89290,7 +89290,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd, ((((SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE), bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK { - *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = SQLITE_MAX_MMAP_SIZE + *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = int64(SQLITE_MAX_MMAP_SIZE) Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), SQLITE_FCNTL_MMAP_SIZE, bp+8 /* &max */) if nExtend > int64(0) { vdbeSorterExtendFile(tls, db, *(*uintptr)(unsafe.Pointer(ppFd)), nExtend) @@ -90242,9 +90242,9 @@ func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset ui // nPMA<=65536 -> TreeDepth() == 2 func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:12: */ var nDepth int32 = 0 - var nDiv I64 = SORTER_MAX_MERGE_COUNT + var nDiv I64 = int64(SORTER_MAX_MERGE_COUNT) for nDiv < I64(nPMA) { - nDiv = (nDiv * SORTER_MAX_MERGE_COUNT) + nDiv = (nDiv * int64(SORTER_MAX_MERGE_COUNT)) nDepth++ } return nDepth @@ -91501,7 +91501,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpRight continue - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { return WRC_Abort @@ -91512,7 +91512,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. return WRC_Abort } } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) != 0 { return WRC_Abort } @@ -91801,15 +91801,15 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx // The pExpr->u.zToken might point into memory that will be freed by the // sqlite3DbFree(db, pDup) on the last line of this block, so be sure to // make a copy of the token before doing the sqlite3DbFree(). - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, db, pExpr) libc.X__builtin___memcpy_chk(tls, pExpr, pDup, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, pExpr, 0)) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_MemToken) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_MemToken)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { if *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) != uintptr(0) { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpOwner = pExpr } else { @@ -91818,7 +91818,7 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx } Xsqlite3DbFree(tls, db, pDup) } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Alias)) } // Return TRUE if the name zCol occurs anywhere in the USING clause. @@ -91874,13 +91874,13 @@ func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) in } // Always support for legacy schemas if ((*NameContext)(unsafe.Pointer(pTopNC)).FncFlags & NC_IsDDL) != 0 { // Currently parsing a DDL statement - if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0)) { + if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0)) { return 1 } - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDDL) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDDL)) != uint64(0))) } else { // Currently parsing a DML statement - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0))) } return int32(0) } @@ -91894,7 +91894,7 @@ func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97 n = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) - if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { @@ -92048,7 +92048,7 @@ __13: } pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab - if !(((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_NestedFrom) != U32(0))) { + if !(((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_NestedFrom)) != U32(0))) { goto __16 } hit = 0 @@ -92186,7 +92186,7 @@ __15: if !((int32((*SrcList_item)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) { goto __35 } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) __35: ; pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpSchema @@ -92271,7 +92271,7 @@ __45: goto __46 __46: ; - if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { + if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { goto __49 } // IMP: R-51414-32910 @@ -92296,7 +92296,7 @@ __49: __53: (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) eNewExprOp = TK_REGISTER - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Alias)) __54: ; goto __52 @@ -92305,7 +92305,7 @@ __51: if !(iCol < 0) { goto __55 } - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) goto __56 __55: if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) { @@ -92350,12 +92350,12 @@ __36: (pMatch != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_IdxExpr | NC_GenCol)) == 0)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && - (((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { + (((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { goto __59 } cnt = 1 (*Expr)(unsafe.Pointer(pExpr)).FiColumn = int16(-1) - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) __59: ; @@ -92394,14 +92394,14 @@ __61: } pOrig = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*32)).FpExpr - if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Agg)) != U32(0))) { + if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Agg))) != U32(0))) { goto __65 } Xsqlite3ErrorMsg(tls, pParse, ts+9535 /* "misuse of aliase..." */, libc.VaList(bp, zAs)) return WRC_Abort __65: ; - if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Win)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Win))) != U32(0)) && ((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0) || (pNC != pTopNC))) { goto __66 } @@ -92470,7 +92470,7 @@ __11: goto __70 } - if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_DblQuoted)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_DblQuoted))) != U32(0)) && (areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0)) { goto __71 } @@ -92489,7 +92489,7 @@ __11: // issue a warning. Xsqlite3_log(tls, SQLITE_WARNING, ts+9621 /* "double-quoted st..." */, libc.VaList(bp+16, zCol)) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) return WRC_Prune __71: @@ -92561,13 +92561,13 @@ __78: Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpRight) (*Expr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0) (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(eNewExprOp) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Leaf) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Leaf)) lookupname_end: if !(cnt == 1) { goto __79 } - if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Alias)) != U32(0))) { + if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Alias))) != U32(0))) { goto __81 } Xsqlite3AuthRead(tls, pParse, pExpr, pSchema, (*NameContext)(unsafe.Pointer(pNC)).FpSrcList) @@ -92612,7 +92612,7 @@ func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 (*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1) } else { (*Expr)(unsafe.Pointer(p)).FiColumn = YnVar(iCol) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { (*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 { @@ -92663,7 +92663,7 @@ func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExp } Xsqlite3ErrorMsg(tls, pParse, ts+9805 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn)) if pExpr != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } @@ -92678,7 +92678,7 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_FLOAT { return -1 } - Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), SQLITE_UTF8) + Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), uint8(SQLITE_UTF8)) if *(*float64)(unsafe.Pointer(bp /* r */)) > 1.0 { return -1 @@ -92718,11 +92718,11 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var pItem uintptr pItem = pSrcList + 8 /* &.a */ - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor (*Expr)(unsafe.Pointer(pExpr)).FiColumn-- - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) break } @@ -92793,7 +92793,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc // The database encoding var savedAllowFlags int32 = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin)) var pWin uintptr = func() uintptr { - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { return *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) } return uintptr(0) @@ -92811,8 +92811,8 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } } else { is_agg = (libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_UNLIKELY) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Unlikely) + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_UNLIKELY)) != 0 { + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Unlikely)) if n == 2 { (*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+1*32)).FpExpr) if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 { @@ -92847,7 +92847,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) return WRC_Prune } @@ -92857,9 +92857,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // 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. - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_ConstFunc) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_ConstFunc)) } - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CONSTANT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CONSTANT)) == U32(0) { // Clearly non-deterministic functions like random(), but also // date/time functions that use 'now', and other functions like // sqlite_version() that might change over time cannot be used @@ -92874,12 +92874,12 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // Must fit in 8 bits (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef)) if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_FromDDL) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } } - if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_InternalFunc) == U32(0)) { + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_InternalFunc)) == U32(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 @@ -92899,10 +92899,10 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s ts+9976 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } else if (((is_agg != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0)) || - (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0)) && !(pWin != 0))) || + (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0)) && !(pWin != 0))) || (((is_agg != 0) && (pWin != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0)) { var zType uintptr - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0) || (pWin != 0) { + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0) || (pWin != 0) { zType = ts + 10020 /* "window" */ } else { zType = ts + 10027 /* "aggregate" */ @@ -92917,7 +92917,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s Xsqlite3ErrorMsg(tls, pParse, ts+10089, /* "wrong number of ..." */ libc.VaList(bp+64, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ - } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { Xsqlite3ErrorMsg(tls, pParse, ts+10134, /* "FILTER may not b..." */ libc.VaList(bp+80, nId, zId)) @@ -92934,7 +92934,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s return 0 }()))) } - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { is_agg = 1 } Xsqlite3WalkExprList(tls, pWalker, pList) @@ -92957,9 +92957,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_HasWin) } else { var pNC2 uintptr = pNC - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_FUNCTION + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_FUNCTION) (*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(0) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } for (pNC2 != 0) && !(Xsqlite3FunctionUsesThisSrc(tls, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) != 0) { @@ -92969,7 +92969,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s if (pNC2 != 0) && (pDef != 0) { - *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((NC_HasAgg | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_MINMAX))) + *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((U32(NC_HasAgg) | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)))) } } @@ -92987,7 +92987,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s case TK_IN: { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 { @@ -92997,7 +92997,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) if nRef != (*NameContext)(unsafe.Pointer(pNC)).FnRef { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_VarSelect) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_VarSelect)) *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_VarSelect) } } @@ -93029,7 +93029,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE { (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUTH + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUTH) return WRC_Continue } } @@ -93280,7 +93280,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 if pNew == uintptr(0) { return 1 } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) if (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr == pE { (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew @@ -93379,7 +93379,7 @@ __3: // Walker callback for windowRemoveExprFromSelect(). func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99159:12: */ _ = pWalker - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) Xsqlite3WindowUnlinkFromSelect(tls, pWin) } @@ -93512,7 +93512,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql var pLeftmost uintptr // Left-most of SELECT of a compound var db uintptr // Database connection - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Resolved) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Resolved)) != 0 { return WRC_Prune } pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) @@ -93526,7 +93526,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // sqlite3SelectPrep() do all of the processing for this SELECT. // sqlite3SelectPrep() will invoke both sqlite3SelectExpand() and // this routine in the correct order. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Expanded) == U32(0) { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Expanded)) == U32(0) { Xsqlite3SelectPrep(tls, pParse, p, pOuterNC) if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort @@ -93539,7 +93539,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql pLeftmost = p for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Resolved) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(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. @@ -93556,7 +93556,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // as if it were part of the sub-query, not the parent. This block // moves the pOrderBy down to the sub-query. It will be moved back // after the names have been resolved. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(pSub)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy @@ -93566,7 +93566,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // Recursively resolve names in all subqueries for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ { var pItem uintptr = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) - if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_Resolved) == U32(0)) { + if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_Resolved)) == U32(0)) { var pNC uintptr // Used to iterate name contexts var nRef int32 = 0 // Refcount for pOuterNC and outer contexts var zSavedContext uintptr = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext @@ -93662,7 +93662,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // within the ORDER BY clause has been transformed to an integer value. // These integers will be replaced by copies of the corresponding result // set expressions by the call to resolveOrderGroupBy() below. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(p)).FpOrderBy = (*Select)(unsafe.Pointer(pSub)).FpOrderBy (*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) @@ -93701,7 +93701,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql goto __3 } { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (EP_Agg)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (U32(EP_Agg))) != U32(0) { Xsqlite3ErrorMsg(tls, pParse, ts+10443 /* "aggregate functi..." */, 0) return WRC_Abort @@ -93962,7 +93962,7 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { if iCol >= 0 { return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).Faffinity } - return SQLITE_AFF_INTEGER + return int8(SQLITE_AFF_INTEGER) } // Return the 'affinity' of the expression pExpr if any. @@ -93981,7 +93981,7 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { // SELECT * FROM t1 WHERE (select a from t1); func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99759:21: */ var op int32 - for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0) { + for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft @@ -94042,7 +94042,7 @@ func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, // Skip over any TK_COLLATE operators. func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99830:21: */ - for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0)) { + for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0)) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft } @@ -94054,7 +94054,7 @@ func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3. // expression. func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99843:21: */ for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_Unlikely))) != U32(0)) { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Unlikely)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Unlikely))) != U32(0) { pExpr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr } else { @@ -94109,8 +94109,8 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) break } - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_Collate) != 0 { - if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & EP_Collate) != U32(0)) { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Collate)) != 0 { + if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & U32(EP_Collate)) != U32(0)) { p = (*Expr)(unsafe.Pointer(p)).FpLeft } else { var pNext uintptr = (*Expr)(unsafe.Pointer(p)).FpRight @@ -94118,10 +94118,10 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { if ((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != uintptr(0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) && - (!(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0))) { + (!(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0))) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (EP_Collate)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (U32(EP_Collate))) != U32(0) { pNext = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr break } @@ -94172,9 +94172,9 @@ func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* // Both sides of the comparison are columns. If one has numeric // affinity, use that. Otherwise use no affinity. if ((int32(aff1)) >= SQLITE_AFF_NUMERIC) || ((int32(aff2)) >= SQLITE_AFF_NUMERIC) { - return SQLITE_AFF_NUMERIC + return int8(SQLITE_AFF_NUMERIC) } else { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } else { // One side is a column, the other is not. Use the columns affinity. @@ -94197,10 +94197,10 @@ func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987: aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 { aff = Xsqlite3CompareAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight, aff) - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList + 8 /* &.a */))).FpExpr, aff) } else if int32(aff) == 0 { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } return aff } @@ -94241,9 +94241,9 @@ func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull i func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100047:24: */ var pColl uintptr - if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) - } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & EP_Collate) != U32(0)) { + } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & U32(EP_Collate)) != U32(0)) { pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight) } else { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) @@ -94262,7 +94262,7 @@ func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, // is reversed in the sqlite3BinaryCompareCollSeq() call so that the // correct collating sequence is found. func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100075:24: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Commuted)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Commuted))) != U32(0) { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft) } else { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, (*Expr)(unsafe.Pointer(p)).FpRight) @@ -94468,7 +94468,7 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, var regRight int32 = 0 var opx U8 = op var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse) - var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0))) + var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return @@ -94480,10 +94480,10 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, p5 = U8(int32(p5) | (SQLITE_STOREP2)) if int32(opx) == TK_LE { - opx = TK_LT + opx = U8(TK_LT) } if int32(opx) == TK_GE { - opx = TK_GT + opx = U8(TK_GT) } regLeft = exprCodeSubselect(tls, pParse, pLeft) @@ -94595,7 +94595,7 @@ func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */ *(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0 heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &nHeight */) heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpRight, bp /* &nHeight */) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) } else if *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0 { heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) @@ -94774,7 +94774,7 @@ func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pRight } else if pRight == uintptr(0) { return pLeft - } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse)) && + } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { Xsqlite3ExprDelete(tls, db, pLeft) Xsqlite3ExprDelete(tls, db, pRight) @@ -94803,11 +94803,11 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u Xsqlite3ErrorMsg(tls, pParse, ts+10552 /* "too many argumen..." */, libc.VaList(bp, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = pList - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_HasFunc) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_HasFunc)) Xsqlite3ExprSetHeightAndFlags(tls, pParse, pNew) if eDistinct == SF_Distinct { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_Distinct) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_Distinct)) } return pNew } @@ -94825,9 +94825,9 @@ func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD bp := tls.Alloc(8) defer tls.Free(8) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromDDL)) != U32(0) { - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_DIRECT) != U32(0)) || - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_TrustedSchema) == uint64(0)) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromDDL))) != U32(0) { + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_DIRECT)) != U32(0)) || + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_TrustedSchema)) == uint64(0)) { // Functions prohibited in triggers and views if: // (1) tagged with SQLITE_DIRECTONLY // (2) not tagged with SQLITE_INNOCUOUS (which means it @@ -94883,7 +94883,7 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n *(*I64)(unsafe.Pointer(bp + 8 /* i */)) = (I64(int32(*(*int8)(unsafe.Pointer(z + 1))) - '0')) // The common case of ?N for a single digit N bOk = 1 } else { - bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), SQLITE_UTF8))) + bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), uint8(SQLITE_UTF8)))) } if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)))) { @@ -94932,20 +94932,20 @@ func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:10 if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) } else { Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } } } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_MemToken)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_MemToken))) != U32(0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Static)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Static))) != U32(0)) { Xsqlite3DbFreeNN(tls, db, p) } } @@ -94971,10 +94971,10 @@ func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* s // passed as the first argument. This is always one of EXPR_FULLSIZE, // EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_TokenOnly)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly))) != U32(0) { return int32((uintptr(0) + 16 /* &.pLeft */)) } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Reduced)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Reduced))) != U32(0) { return int32((uintptr(0) + 44 /* &.iTable */)) } return int32(unsafe.Sizeof(Expr{})) @@ -95017,15 +95017,15 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit // Only one flag value allowed if ((0 == flags) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN)) || - (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0)) { + (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0)) { nSize = int32(unsafe.Sizeof(Expr{})) } else { if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) || (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { - nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | EP_Reduced)) + nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | uint64(EP_Reduced))) } else { - nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | EP_TokenOnly)) + nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | uint64(EP_TokenOnly))) } } return nSize @@ -95036,7 +95036,7 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit // string is defined.) func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100947:12: */ var nByte int32 = (dupedExprStructSize(tls, p, flags) & 0xfff) - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nByte = int32(Size_t(nByte) + ((libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & uint64(0x3fffffff)) + uint64(1))) } return (((nByte) + 7) & libc.CplInt32(7)) @@ -95082,7 +95082,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint // Figure out where to write the new Expr structure. if pzBuffer != 0 { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = *(*uintptr)(unsafe.Pointer(pzBuffer)) - staticFlag = EP_Static + staticFlag = U32(EP_Static) } else { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = Xsqlite3DbMallocRawNN(tls, db, uint64(dupedExprSize(tls, p, dupFlags))) staticFlag = U32(0) @@ -95097,7 +95097,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint var nStructSize uint32 = uint32(dupedExprStructSize(tls, p, dupFlags)) var nNewSize int32 = (int32(nStructSize & uint32(0xfff))) var nToken int32 - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nToken = (Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) + 1) } else { nToken = 0 @@ -95130,7 +95130,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint if U32(0) == (((*Expr)(unsafe.Pointer(p)).Fflags | (*Expr)(unsafe.Pointer(pNew)).Fflags) & (U32(EP_TokenOnly | EP_Leaf))) { // Fill in the pNew->x.pSelect or pNew->x.pList member. - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) } else { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) @@ -95154,7 +95154,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint return uintptr(0) }() } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 64 /* &.y */)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } @@ -95202,7 +95202,7 @@ func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096 // an a newly duplicated SELECT statement and gather all of the Window // objects found there, assembling them onto the linked list at Select->pWin. func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101124:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) @@ -95675,7 +95675,7 @@ func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStar if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) { (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) - libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, ENAME_SPAN, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(ENAME_SPAN), 0, 0x3) } } } @@ -95745,10 +95745,10 @@ func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int // anything else 0 func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625:20: */ if Xsqlite3StrICmp(tls, zIn, ts+10724 /* "true" */) == 0 { - return EP_IsTrue + return U32(EP_IsTrue) } if Xsqlite3StrICmp(tls, zIn, ts+10729 /* "false" */) == 0 { - return EP_IsFalse + return U32(EP_IsFalse) } return U32(0) } @@ -95759,9 +95759,9 @@ func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625 func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101637:20: */ var v U32 - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Quoted)) != U32(0)) && + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Quoted))) != U32(0)) && ((libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUEFALSE + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (v) return 1 } @@ -95792,13 +95792,13 @@ func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqli if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR) { var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var pLeft uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) - if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pRight } else { pExpr = pLeft } - } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pLeft } else { @@ -95838,7 +95838,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // If pWalker->eCode is 2 then any term of the expression that comes from // the ON or USING clauses of a left join disqualifies the expression // from being considered constant. - if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -95848,10 +95848,10 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // and either pWalker->eCode==4 or 5 or the function has the // SQLITE_FUNC_CONST flag. case TK_FUNCTION: - if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } return WRC_Continue } else { @@ -95872,7 +95872,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / fallthrough case TK_AGG_COLUMN: - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { return WRC_Continue } if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */))) { @@ -95892,7 +95892,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // 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 - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 4 { // A bound parameter in a CREATE statement that originates from // sqlite3_prepare() causes an error @@ -95977,7 +95977,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) } // Check if pExpr is a sub-select. If so, consider it variable. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -96059,7 +96059,7 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* // 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 - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_IntValue)) != 0 { *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8 /* &.u */)) return 1 } @@ -96119,7 +96119,7 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995 case TK_BLOB: return 0 case TK_COLUMN: - return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (EP_CanBeNull)) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && + return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_CanBeNull))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol != uintptr(0))) && // Defense against OOM problems (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol+uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*32)).FnotNull) == 0)))) default: @@ -96213,10 +96213,10 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10208 var pEList uintptr var pTab uintptr var i int32 - if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return uintptr(0) } // Not a subquery - if ((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_VarSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_VarSelect))) != U32(0) { return uintptr(0) } // Correlated subq p = *(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)) @@ -96273,7 +96273,7 @@ func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int3 Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regHasNull) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur) Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, 0, regHasNull) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) Xsqlite3VdbeComment(tls, v, ts+10753 /* "first_entry_in(%..." */, libc.VaList(bp, iCur)) Xsqlite3VdbeJumpHere(tls, v, addr1) } @@ -96379,14 +96379,14 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var mustBeUnique int32 // True if RHS must be unique var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded - mustBeUnique = (libc.Bool32((inFlags & IN_INDEX_LOOP) != U32(0))) + mustBeUnique = (libc.Bool32((inFlags & U32(IN_INDEX_LOOP)) != U32(0))) // If the RHS of this IN(...) operator is a SELECT, and if it matters // whether or not the SELECT result contains NULL values, check whether // or not NULL is actually possible (it may not be, for example, due // to NOT NULL constraints in the schema). If no NULL values are possible, // set prRhsHasNull to 0 before continuing. - if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) != 0) { + if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) != 0) { var i int32 var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { @@ -96545,8 +96545,8 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // then it is not worth creating an ephemeral table to evaluate // the IN operator so return IN_INDEX_NOOP. if (((eType == 0) && - ((inFlags & IN_INDEX_NOOP_OK) != 0)) && - !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0))) && + ((inFlags & U32(IN_INDEX_NOOP_OK)) != 0)) && + !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0))) && (!(sqlite3InRhsIsConstant(tls, pX) != 0) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FnExpr <= 2)) { eType = IN_INDEX_NOOP } @@ -96557,7 +96557,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var savedNQueryLoop U32 = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop var rMayHaveNull int32 = 0 eType = IN_INDEX_EPH - if (inFlags & IN_INDEX_LOOP) != 0 { + if (inFlags & U32(IN_INDEX_LOOP)) != 0 { (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0) } else if prRhsHasNull != 0 { *(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)) @@ -96592,7 +96592,7 @@ func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* s var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft) var pSelect uintptr - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) } else { pSelect = uintptr(0) @@ -96640,7 +96640,7 @@ func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpec // // "row value misused" func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102509:21: */ - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr, 1) } else { Xsqlite3ErrorMsg(tls, pParse, ts+9603 /* "row value misuse..." */, 0) @@ -96689,13 +96689,13 @@ func Xsqlite3CodeRhsOfIN(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 !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) && ((*Parse)(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 ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+10894 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) } Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), @@ -96706,7 +96706,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) @@ -96723,14 +96723,14 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 // RHS of the IN operator. (*Expr)(unsafe.Pointer(pExpr)).FiTable = iTab addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3VdbeComment(tls, v, ts+10932 /* "Result of SELECT..." */, libc.VaList(bp+8, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) } else { Xsqlite3VdbeComment(tls, v, ts+10952 /* "RHS of IN operat..." */, 0) } pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // Case 1: expr IN (SELECT ...) // // Generate code to write the results of the select into the temporary @@ -96785,9 +96785,9 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 var r2 int32 *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft) if int32(*(*int8)(unsafe.Pointer(bp + 72 /* affinity */))) <= SQLITE_AFF_NONE { - *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = int8(SQLITE_AFF_BLOB) } else if int32(*(*int8)(unsafe.Pointer(bp + 72 /* affinity */))) == SQLITE_AFF_REAL { - *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = SQLITE_AFF_NUMERIC + *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = int8(SQLITE_AFF_NUMERIC) } if pKeyInfo != 0 { @@ -96882,10 +96882,10 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // // 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 !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) { // If this routine has already been coded, then invoke it as a // subroutine. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+11002 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */))) @@ -96893,7 +96893,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) Xsqlite3VdbeComment(tls, v, ts+10917 /* "return address" */, 0) @@ -96924,13 +96924,13 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 0, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nReg) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Mem + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Mem) (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSDParm (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FnSdst = nReg Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (((*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm + nReg) - 1)) Xsqlite3VdbeComment(tls, v, ts+11041 /* "Init subquery re..." */, 0) } else { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Exists + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Exists) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm) Xsqlite3VdbeComment(tls, v, ts+11062 /* "Init EXISTS resu..." */, 0) } @@ -96940,7 +96940,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+10550 /* "0" */) if pLimit != 0 { - (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = SQLITE_AFF_NUMERIC + (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = Xsqlite3PExpr(tls, pParse, TK_NE, Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) } @@ -96975,7 +96975,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // a sub-query, that the LHS is a vector of size 1. func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:102846:20: */ var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft) - if ((*Expr)(unsafe.Pointer(pIn)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pIn)).Fflags & U32(EP_xIsSelect)) != 0 { if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr, nVector) return 1 @@ -97398,7 +97398,7 @@ func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) if z != uintptr(0) { // var value float64 at bp, 8 - Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) // The new AtoF never returns NaN if negateFlag != 0 { *(*float64)(unsafe.Pointer(bp /* value */)) = -*(*float64)(unsafe.Pointer(bp /* value */)) @@ -97416,7 +97416,7 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM defer tls.Free(24) var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_IntValue)) != 0 { var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */)) if negFlag != 0 { @@ -97521,7 +97521,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_BUSY))) } return - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { x = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab), int16(iCol))) op = OP_Column @@ -97564,7 +97564,7 @@ func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103335:13: */ var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) (*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop - (*Expr)(unsafe.Pointer(p)).Fop = TK_REGISTER + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_REGISTER) (*Expr)(unsafe.Pointer(p)).FiTable = iReg *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Skip))) } @@ -97642,7 +97642,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI // var caseExpr Expr at bp, 72 libc.X__builtin___memset_chk(tls, bp /* &caseExpr */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp /* &caseExpr */, 0)) - (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = TK_CASE + (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = U8(TK_CASE) *(*uintptr)(unsafe.Pointer(bp /* &caseExpr */ + 32 /* &.x */)) = pFarg return Xsqlite3ExprCodeTarget(tls, pParse, bp /* &caseExpr */, target) @@ -98019,7 +98019,7 @@ __57: __5: iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { goto __62 } iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target) @@ -98211,7 +98211,7 @@ __79: r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+92 /* ®Free2 */) codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, inReg, (SQLITE_STOREP2 | p5), - (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) __80: ; @@ -98255,7 +98255,7 @@ __81: return target goto __84 __83: - (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fop = TK_INTEGER + (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fop = U8(TK_INTEGER) (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fflags = (U32(EP_IntValue | EP_TokenOnly)) *(*int32)(unsafe.Pointer(bp + 96 /* &tempX */ + 8 /* &.u */)) = 0 @@ -98322,7 +98322,7 @@ __42: // The function name enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc // The text encoding used by this database pColl = uintptr(0) // A collating sequence - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __87 } return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FregResult @@ -98354,7 +98354,7 @@ __88: goto __3 __89: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INLINE) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INLINE)) != 0) { goto __90 } @@ -98383,7 +98383,7 @@ __93: constMask = constMask | (uint32((uint32(1))) << (i)) __96: ; - if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != U32(0)) && !(pColl != 0)) { + if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != U32(0)) && !(pColl != 0)) { goto __97 } pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*32)).FpExpr) @@ -98447,7 +98447,7 @@ __99: // function. The expression "A glob B" is equivalent to // "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 >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_InfixFunc)) != U32(0))) { + if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_InfixFunc))) != U32(0))) { goto __104 } pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*32)).FpExpr) @@ -98461,7 +98461,7 @@ __106: ; __105: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { goto __107 } if !(!(pColl != 0)) { @@ -98473,7 +98473,7 @@ __108: Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2) __107: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_OFFSET) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_OFFSET)) != 0) { goto __109 } pArg = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr @@ -98702,7 +98702,7 @@ __124: exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+88 /* ®Free1 */)) libc.X__builtin___memset_chk(tls, bp+168 /* &opCompare */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp+168 /* &opCompare */, 0)) - (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).Fop = TK_EQ + (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).Fop = U8(TK_EQ) (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).FpLeft = pDel pTest = bp + 168 /* &opCompare */ // Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001: @@ -98845,7 +98845,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r __3: } pExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) - if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_HasFunc)) != U32(0)) { + if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_HasFunc))) != U32(0)) { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var addr int32 @@ -98919,10 +98919,10 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target) if inReg != target { var op U8 - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subquery)) != U32(0) { - op = OP_Copy + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subquery))) != U32(0) { + op = U8(OP_Copy) } else { - op = OP_SCopy + op = U8(OP_SCopy) } Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target) } @@ -98977,9 +98977,9 @@ func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ var n int32 var copyOp U8 if (int32(flags) & SQLITE_ECEL_DUP) != 0 { - copyOp = OP_Copy + copyOp = uint8(OP_Copy) } else { - copyOp = OP_SCopy + copyOp = uint8(OP_SCopy) } var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -99072,13 +99072,13 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x pDel = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { - (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = TK_AND + (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = U8(TK_AND) (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpLeft = bp /* &compLeft */ (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpRight = bp + 72 /* &compRight */ - (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = TK_GE + (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = U8(TK_GE) (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr - (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = TK_LE + (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = U8(TK_LE) (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */) + 1*32)).FpExpr exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+216 /* ®Free1 */)) @@ -99090,7 +99090,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x // it into the Parse.pConstExpr list. We should use a new bit for this, // for clarity, but we are out of bits in the Expr.flags field so we // have to reuse the EP_FromJoin bit. Bummer. - *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (U32(EP_FromJoin)) Xsqlite3ExprCodeTarget(tls, pParse, bp+144 /* &exprAnd */, dest) } Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 216 /* regFree1 */))) @@ -99275,7 +99275,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -99309,13 +99309,13 @@ __19: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __28 } Xsqlite3VdbeGoto(tls, v, dest) goto __29 __28: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } // No-op @@ -99527,7 +99527,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -99561,13 +99561,13 @@ __29: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } Xsqlite3VdbeGoto(tls, v, dest) goto __31 __30: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __32 } // no-op @@ -99620,11 +99620,11 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint var pL uintptr *(*uintptr)(unsafe.Pointer(bp /* pR */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, SQLITE_UTF8, SQLITE_AFF_BLOB, bp /* &pR */) + Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp /* &pR */) if *(*uintptr)(unsafe.Pointer(bp /* pR */)) != 0 { iVar = int32((*Expr)(unsafe.Pointer(pVar)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iVar) - pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, SQLITE_AFF_BLOB) + pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, uint8(SQLITE_AFF_BLOB)) if pL != 0 { if Xsqlite3_value_type(tls, pL) == SQLITE_TEXT { Xsqlite3_value_text(tls, pL) // Make sure the encoding is UTF-8 @@ -99677,8 +99677,8 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 0 } combinedFlags = ((*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags) - if (combinedFlags & EP_IntValue) != 0 { - if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & EP_IntValue) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { + if (combinedFlags & U32(EP_IntValue)) != 0 { + if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & U32(EP_IntValue)) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { return 0 } return 2 @@ -99698,10 +99698,10 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 2 } - if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (EP_WinFunc)) != U32(0))) { + if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(EP_WinFunc))) != U32(0))) { return 2 } - if ((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0) { if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 64 /* &.y */)), *(*uintptr)(unsafe.Pointer(pB + 64 /* &.y */)), 1) != 0 { return 2 } @@ -99720,11 +99720,11 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, ((*Expr)(unsafe.Pointer(pB)).Fflags & (U32(EP_Distinct | EP_Commuted))) { return 2 } - if (combinedFlags & EP_TokenOnly) == U32(0) { - if (combinedFlags & EP_xIsSelect) != 0 { + if (combinedFlags & U32(EP_TokenOnly)) == U32(0) { + if (combinedFlags & U32(EP_xIsSelect)) != 0 { return 2 } - if ((combinedFlags & EP_FixedCol) == U32(0)) && + if ((combinedFlags & U32(EP_FixedCol)) == U32(0)) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0) { return 2 } @@ -99736,7 +99736,7 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE)) && - ((combinedFlags & EP_Reduced) == U32(0)) { + ((combinedFlags & U32(EP_Reduced)) == U32(0)) { if int32((*Expr)(unsafe.Pointer(pA)).FiColumn) != int32((*Expr)(unsafe.Pointer(pB)).FiColumn) { return 2 } @@ -99811,7 +99811,7 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i switch int32((*Expr)(unsafe.Pointer(p)).Fop) { case TK_IN: { - if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0)) { + if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return 0 } @@ -99952,7 +99952,7 @@ func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin // (never setting pWalker->eCode) is a harmless missed optimization. func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105186:12: */ - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return WRC_Prune } switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { @@ -100204,7 +100204,7 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnThis = 0 (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnOther = 0 Xsqlite3WalkExprList(tls, bp /* &w */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } return (libc.Bool32(((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnOther == 0))) @@ -100400,7 +100400,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // pAggInfo->aCol[] entry. (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiAgg = I16(k) goto __3 } // endif pExpr->iTable==pItem->iCursor @@ -100461,7 +100461,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* } return 0 }(), enc, uint8(0)) - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Distinct) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Distinct)) != 0 { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) } else { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1 @@ -100634,7 +100634,7 @@ func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sq defer tls.Free(8) if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+11308 /* "sqlite_" */, 7)) || - ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && + ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0)) { Xsqlite3ErrorMsg(tls, pParse, ts+11316 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 @@ -100716,7 +100716,7 @@ __2: ; iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema) zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) // Get a NULL terminated version of the new table name. zName = Xsqlite3NameFromToken(tls, db, pName) @@ -100938,7 +100938,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if (pDflt != 0) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL) { pDflt = uintptr(0) } - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+12677 /* "Cannot add a REF..." */) } @@ -100952,7 +100952,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if pDflt != 0 { *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) = uintptr(0) var rc int32 - rc = Xsqlite3ValueFromExpr(tls, db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, bp+40 /* &pVal */) + rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+40 /* &pVal */) if rc != SQLITE_OK { @@ -100976,7 +100976,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr for (zEnd > zCol) && ((int32(*(*int8)(unsafe.Pointer(zEnd))) == ';') || ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))]) & 0x01) != 0)) { *(*int8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = int8(0) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) Xsqlite3NestedParse(tls, pParse, ts+12862, /* "UPDATE \"%w\".sqli..." */ @@ -101370,7 +101370,7 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return WRC_Abort } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if (*Select)(unsafe.Pointer(p)).FpEList != 0 { @@ -101412,7 +101412,7 @@ func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameUnmapSelectCb})) - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_UNMAP + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_UNMAP) Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr) (*Parse)(unsafe.Pointer(pParse)).FeParseMode = eMode } @@ -101474,7 +101474,7 @@ func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) // because without a dummy callback, sqlite3WalkExpr() and similar do not // descend into sub-select statements. func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106692:12: */ - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } renameWalkWith(tls, pWalker, p) @@ -101604,7 +101604,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint // occurs and the parse does not result in a new table, index or // trigger object, the database must be corrupt. libc.X__builtin___memset_chk(tls, p, 0, uint64(unsafe.Sizeof(Parse{})), libc.X__builtin_object_size(tls, p, 0)) - (*Parse)(unsafe.Pointer(p)).FeParseMode = PARSE_MODE_RENAME + (*Parse)(unsafe.Pointer(p)).FeParseMode = U8(PARSE_MODE_RENAME) (*Parse)(unsafe.Pointer(p)).Fdb = db (*Parse)(unsafe.Pointer(p)).FnQueryLoop = U32(1) rc = Xsqlite3RunParser(tls, p, zSql, bp /* &zErr */) @@ -102189,7 +102189,7 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 var i int32 var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if pSrc == uintptr(0) { @@ -102265,7 +102265,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr rc = renameParseSql(tls, bp+80 /* &sParse */, zDb, db, zInput, bTemp) if rc == SQLITE_OK { - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FpNewTable != 0 { var pTab uintptr = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).FpNewTable @@ -102287,7 +102287,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } } else { // Modify any FK definitions to point to the new table. - if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { var pFKey uintptr for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom { if Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { @@ -102379,7 +102379,7 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))) - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) @@ -102630,7 +102630,7 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh Xsqlite3NestedParse(tls, pParse, ts+13566 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols)) *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot) - *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = OPFLAG_P2ISREG + *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(OPFLAG_P2ISREG) } } else { // The table already exists. If zWhere is not NULL, delete all entries @@ -102895,7 +102895,7 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statInitFuncdef = FuncDef{ FnArg: int8(4), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 13717 /* "stat_init" */} /* sqlite3.c:108036:22 */ @@ -103213,7 +103213,7 @@ func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statPushFuncdef = FuncDef{ FnArg: (int8(2 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 13727 /* "stat_push" */} /* sqlite3.c:108326:22 */ @@ -103347,7 +103347,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli var statGetFuncdef = FuncDef{ FnArg: (int8(1 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 13754 /* "stat_get" */} /* sqlite3.c:108478:22 */ @@ -103470,7 +103470,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { needTableCnt = U8(0) } - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) zIdxName = (*Table)(unsafe.Pointer(pTab)).FzName nColTest = (nCol - 1) @@ -103599,7 +103599,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regTemp) analyzeVdbeCommentIndexWithColumnName(tls, v, pIdx, i) *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, (regPrev + i), pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nColTest, regChng) @@ -103627,7 +103627,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // if !eof(csr) goto next_row; if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, regRowid) } else { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable) @@ -103674,7 +103674,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) // Add the entries to the stat4 table. if ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) { @@ -103687,10 +103687,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp var addrNext int32 var addrIsNull int32 var seekOp U8 - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - seekOp = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + seekOp = uint8(OP_NotExists) } else { - seekOp = OP_NotFound + seekOp = uint8(OP_NotFound) } (*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 { @@ -103735,7 +103735,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+13804 /* "BBB" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) Xsqlite3VdbeJumpHere(tls, v, jZeroRows) } @@ -103980,7 +103980,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.hasStat1 */, uint32(1), 7, 0x80) if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) { (*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst)) - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } } else { // var fakeIdx Index at bp, 152 @@ -103988,7 +103988,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow decodeIntArray(tls, z, 1, uintptr(0), (pTable + 74 /* &.nRowLogEst */), bp /* &fakeIdx */) (*Table)(unsafe.Pointer(pTable)).FszTabRow = (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } return 0 @@ -104075,7 +104075,7 @@ func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb) if pIdx == uintptr(0) { var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb) - if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab) } } @@ -104133,7 +104133,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui continue } - if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) } else { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) @@ -104368,7 +104368,7 @@ func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* s if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_ID { rc = Xsqlite3ResolveExprNames(tls, pName, pExpr) } else { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) } } return rc @@ -104548,7 +104548,7 @@ __17: __16: ; - *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= SQLITE_OPEN_MAIN_DB + *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= uint32(SQLITE_OPEN_MAIN_DB) rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), *(*uintptr)(unsafe.Pointer(bp + 40 /* zPath */)), db, (pNew + 8 /* &.pBt */), 0, int32(*(*uint32)(unsafe.Pointer(bp + 24 /* flags */)))) (*Sqlite3)(unsafe.Pointer(db)).FnDb++ (*Db)(unsafe.Pointer(pNew)).FzDbSName = Xsqlite3DbStrDup(tls, db, zName) @@ -104588,7 +104588,7 @@ __22: Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt, -1)) Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, - (uint32(PAGER_SYNCHRONOUS_FULL | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(uint64(PAGER_SYNCHRONOUS_FULL) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pNew)).FpBt) __20: ; @@ -104875,7 +104875,7 @@ func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3 var detach_func = FuncDef{ FnArg: int8(1), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 14260 /* "sqlite_detach" */} /* sqlite3.c:109893:24 */ @@ -104888,7 +104888,7 @@ func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var attach_func = FuncDef{ FnArg: int8(3), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse FzName: ts + 14274 /* "sqlite_attach" */} /* sqlite3.c:109913:24 */ @@ -105015,11 +105015,11 @@ func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqli for pExpr != 0 { if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE { if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else { Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+14334 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType)) return 1 @@ -105028,7 +105028,7 @@ func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqli if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { break } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { if Xsqlite3FixSelect(tls, pFix, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { return 1 } @@ -105268,7 +105268,7 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint } if SQLITE_IGNORE == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } @@ -105649,7 +105649,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // Read the database schema. If an error occurs, leave an error message // and code in pParse and return NULL. - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaKnownOk) == U32(0)) && + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaKnownOk)) == U32(0)) && (SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) { return uintptr(0) } @@ -105668,7 +105668,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr return (*Module)(unsafe.Pointer(pMod)).FpEpoTab } } - if (flags & LOCATE_NOERR) != 0 { + if (flags & U32(LOCATE_NOERR)) != 0 { return uintptr(0) } (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) @@ -105678,7 +105678,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr if p == uintptr(0) { var zMsg uintptr - if (flags & LOCATE_VIEW) != 0 { + if (flags & U32(LOCATE_VIEW)) != 0 { zMsg = ts + 14508 /* "no such view" */ } else { zMsg = ts + 14521 /* "no such table" */ @@ -105788,7 +105788,7 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName } Xsqlite3FreeIndex(tls, db, pIndex) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Look through the list of open database files in db->aDb[] and if @@ -105968,7 +105968,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) p = Xsqlite3HashInsert(tls, ((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */), zTabName, uintptr(0)) Xsqlite3DeleteTable(tls, db, p) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Given a token, return a string that consists of the text of that @@ -105997,7 +105997,7 @@ func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { / // writing. The table is opened using cursor 0. func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:111163:21: */ var v uintptr = Xsqlite3GetVdbe(tls, p) - Xsqlite3TableLock(tls, p, iDb, SCHEMA_ROOT, uint8(1), ts+8721 /* "sqlite_master" */) + Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+8721 /* "sqlite_master" */) Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, 0, SCHEMA_ROOT, iDb, 5) if (*Parse)(unsafe.Pointer(p)).FnTab == 0 { (*Parse)(unsafe.Pointer(p)).FnTab = 1 @@ -106097,7 +106097,7 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u // True if PRAGMA writable_schema is ON func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:111256:20: */ - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == SQLITE_WriteSchema)) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == uint64(SQLITE_WriteSchema))) } // This routine is used to check if the UTF-8 string zName is a legal @@ -106172,7 +106172,7 @@ func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* // // If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro. func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111348:20: */ - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) != 0 { var i int32 for i = 0; i <= int32(iCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0 { @@ -106222,7 +106222,7 @@ func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { / var i int32 var n I16 - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) == U32(0)) || (int32(iCol) < 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) == U32(0)) || (int32(iCol) < 0) { return iCol } i = 0 @@ -106467,7 +106467,7 @@ __21: Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT) Xsqlite3VdbeUsesBtree(tls, v, iDb) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_If, reg3) - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyFileFmt) != uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyFileFmt)) != uint64(0) { fileFormat = 1 } else { fileFormat = SQLITE_MAX_FILE_FORMAT @@ -106498,7 +106498,7 @@ __23: Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 0, reg1) Xsqlite3VdbeAddOp4(tls, v, OP_Blob, 6, reg3, 0, uintptr(unsafe.Pointer(&nullRow)), -1) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 0, reg3, reg1) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeAddOp0(tls, v, OP_Close) __20: ; @@ -106513,10 +106513,10 @@ begin_table_error: } var aCode = [4]U8{ - SQLITE_CREATE_TABLE, - SQLITE_CREATE_TEMP_TABLE, - SQLITE_CREATE_VIEW, - SQLITE_CREATE_TEMP_VIEW, + U8(SQLITE_CREATE_TABLE), + U8(SQLITE_CREATE_TEMP_TABLE), + U8(SQLITE_CREATE_VIEW), + U8(SQLITE_CREATE_TEMP_VIEW), } /* sqlite3.c:111477:21 */ var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:111565:23 */ @@ -106580,7 +106580,7 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp if (*Token)(unsafe.Pointer(pType)).Fn == uint32(0) { // If there is no type specified, columns have the default affinity // 'BLOB' with a default size of 4 bytes. - (*Column)(unsafe.Pointer(pCol)).Faffinity = SQLITE_AFF_BLOB + (*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB) (*Column)(unsafe.Pointer(pCol)).FszEst = U8(1) } else { zType = ((z + uintptr(Xsqlite3Strlen30(tls, z))) + uintptr(1)) @@ -106608,7 +106608,7 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit } pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32) (*Column)(unsafe.Pointer(pCol)).FnotNull = U8(onError) - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) // Set the uniqNotNull flag on any UNIQUE or PK indexes already created // on this column. @@ -106651,36 +106651,36 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sq defer tls.Free(4) var h U32 = U32(0) - var aff int8 = SQLITE_AFF_NUMERIC + var aff int8 = int8(SQLITE_AFF_NUMERIC) var zChar uintptr = uintptr(0) for *(*int8)(unsafe.Pointer(zIn)) != 0 { h = ((h << 8) + U32(Xsqlite3UpperToLower[((int32(*(*int8)(unsafe.Pointer(zIn))))&0xff)])) zIn++ if h == (U32((((int32('c') << 24) + (int32('h') << 16)) + (int32('a') << 8)) + 'r')) { // CHAR - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) zChar = zIn } else if h == (U32((((int32('c') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b')) { // CLOB - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if h == (U32((((int32('t') << 24) + (int32('e') << 16)) + (int32('x') << 8)) + 't')) { // TEXT - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if (h == (U32((((int32('b') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b'))) && // BLOB ((int32(aff) == SQLITE_AFF_NUMERIC) || (int32(aff) == SQLITE_AFF_REAL)) { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) if int32(*(*int8)(unsafe.Pointer(zIn))) == '(' { zChar = zIn } } else if (h == (U32((((int32('r') << 24) + (int32('e') << 16)) + (int32('a') << 8)) + 'l'))) && // REAL (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('f') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'a'))) && // FLOA (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('d') << 24) + (int32('o') << 16)) + (int32('u') << 8)) + 'b'))) && // DOUB (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h & U32(0x00FFFFFF)) == (U32(((int32('i') << 16) + (int32('n') << 8)) + 't')) { // INT - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) break } } @@ -106744,10 +106744,10 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt) libc.X__builtin___memset_chk(tls, bp+8 /* &x */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp+8 /* &x */, 0)) - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = TK_SPAN + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = U8(TK_SPAN) *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).FpLeft = pExpr - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = U32(EP_Skip) (*Column)(unsafe.Pointer(pCol)).FpDflt = Xsqlite3ExprDup(tls, db, bp+8 /* &x */, EXPRDUP_REDUCE) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */))) } @@ -106774,9 +106774,9 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar // unchanged. func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:111898:13: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_STRING { - (*Expr)(unsafe.Pointer(p)).Fop = TK_ID + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_ID) } else if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING) { - (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = TK_ID + (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = U8(TK_ID) } } @@ -106827,7 +106827,7 @@ func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit __1: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasPrimaryKey) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasPrimaryKey)) != 0) { goto __2 } Xsqlite3ErrorMsg(tls, pParse, @@ -106835,7 +106835,7 @@ __1: goto primary_key_exit __2: ; - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasPrimaryKey) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasPrimaryKey)) if !(pList == uintptr(0)) { goto __3 } @@ -106923,7 +106923,7 @@ __13: goto __18 __17: Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), - uintptr(0), sortOrder, 0, SQLITE_IDXTYPE_PRIMARYKEY) + uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) __18: ; @@ -106996,7 +106996,7 @@ func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui var eType U8 var pTab uintptr var pCol uintptr - eType = COLFLAG_VIRTUAL + eType = U8(COLFLAG_VIRTUAL) pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable if !(pTab == uintptr(0)) { goto __1 @@ -107031,7 +107031,7 @@ __5: if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+15057 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) { goto __7 } - eType = COLFLAG_STORED + eType = U8(COLFLAG_STORED) goto __8 __7: goto generated_error @@ -107450,10 +107450,10 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / if !((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { - (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = OE_Abort + (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = U8(OE_Abort) } } - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) } // Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY @@ -107482,7 +107482,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*Table)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_PRIMARYKEY) + uint8(SQLITE_IDXTYPE_PRIMARYKEY)) if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { return } @@ -107519,7 +107519,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / // a database schema). if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0)) { - Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), OP_Goto) + Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto)) } // The root page of the PRIMARY KEY is the table root page @@ -107679,7 +107679,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } if (pSelect == uintptr(0)) && (Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Shadow) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Shadow)) } // If the db->init.busy is 1 it means we are reading the SQL off the @@ -107697,18 +107697,18 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } (*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Readonly) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Readonly)) } } // Special processing for WITHOUT ROWID Tables if (int32(tabOpts) & TF_WithoutRowid) != 0 { - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3ErrorMsg(tls, pParse, ts+15145 /* "AUTOINCREMENT no..." */, 0) return } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasPrimaryKey) == U32(0) { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasPrimaryKey)) == U32(0) { Xsqlite3ErrorMsg(tls, pParse, ts+15195 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) return } @@ -107729,13 +107729,13 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasGenerated) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasGenerated)) != 0 { var ii int32 var nNG int32 = 0 for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ { var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FcolFlags) - if (colFlags & COLFLAG_GENERATED) != U32(0) { + if (colFlags & U32(COLFLAG_GENERATED)) != U32(0) { var pX uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FpDflt if Xsqlite3ResolveSelfReference(tls, pParse, p, NC_GenCol, pX, uintptr(0)) != 0 { @@ -107822,14 +107822,14 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr Xsqlite3MayAbort(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_P2ISREG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) (*Parse)(unsafe.Pointer(pParse)).FnTab = 2 addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, SQLITE_AFF_BLOB) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, int8(SQLITE_AFF_BLOB)) if pSelTab == uintptr(0) { return } @@ -107893,7 +107893,7 @@ func Xsqlite3EndTable(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 ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != U32(0) { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != U32(0) { var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { @@ -107920,7 +107920,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr return } (*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) if !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) { var zName uintptr = (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz @@ -107983,7 +107983,7 @@ __3: // This will force all the Expr.token.z values to be dynamically // allocated rather than point to the input string - which means that // they will persist after the current sqlite3_exec() call returns. - *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (SF_View) + *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (U32(SF_View)) if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { goto __4 } @@ -108102,7 +108102,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i pSel = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSelect, 0) if pSel != 0 { var eParseMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_NORMAL) n = (*Parse)(unsafe.Pointer(pParse)).FnTab Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpSrc) (*Table)(unsafe.Pointer(pTable)).FnCol = int16(-1) @@ -108110,7 +108110,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, SQLITE_AFF_NONE) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, int8(SQLITE_AFF_NONE)) (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth (*Parse)(unsafe.Pointer(pParse)).FnTab = n if pSelTab == uintptr(0) { @@ -108128,7 +108128,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0)) && (int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr) { Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTable, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } else { // CREATE VIEW name AS... without an argument list. Construct @@ -108348,7 +108348,7 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // the table being dropped. This is done before the table is dropped // at the btree level, in case the sqlite_sequence table needs to // move as a result of the drop (can happen in auto-vacuum mode). - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3NestedParse(tls, pParse, ts+15633, /* "DELETE FROM %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName)) @@ -108382,7 +108382,7 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // Return TRUE if shadow tables should be read-only in the current // context. func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:113409:20: */ - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0)) && + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0))) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) { return 1 @@ -108401,7 +108401,7 @@ func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sq } return 1 } - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { return 1 } return 0 @@ -108933,7 +108933,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iIdx) } Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iIdx, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, regRecord) Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iSorter, addr2) Xsqlite3VdbeJumpHere(tls, v, addr1) @@ -109167,7 +109167,7 @@ __11: goto exit_create_index __12: ; - if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __13 } pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -109784,10 +109784,10 @@ __100: goto exit_create_index __102: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) goto __99 __98: - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || (pTblName != uintptr(0))) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || (pTblName != uintptr(0))) { goto __103 } iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -110250,8 +110250,8 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra libc.VaList(bp, SQLITE_MAX_SRCLIST)) return uintptr(0) } - if nAlloc > SQLITE_MAX_SRCLIST { - nAlloc = SQLITE_MAX_SRCLIST + if nAlloc > int64(SQLITE_MAX_SRCLIST) { + nAlloc = int64(SQLITE_MAX_SRCLIST) } pNew = Xsqlite3DbRealloc(tls, db, pSrc, (uint64(unsafe.Sizeof(SrcList{})) + ((uint64(nAlloc - int64(1))) * uint64(unsafe.Sizeof(SrcList_item{}))))) @@ -110811,7 +110811,7 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx } return (SQLITE_CONSTRAINT | (int32(8) << 8)) }(), - onError, zErr, int8(-7), P5_ConstraintUnique) + onError, zErr, int8(-7), uint8(P5_ConstraintUnique)) } // Code an OP_Halt due to non-unique rowid. @@ -110830,7 +110830,7 @@ func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab rc = (SQLITE_CONSTRAINT | (int32(10) << 8)) } Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-7), - P5_ConstraintUnique) + uint8(P5_ConstraintUnique)) } // Check to see if pIndex uses the collating sequence pColl. Return @@ -111113,8 +111113,8 @@ func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sq if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 != 0 { var zExternal uintptr var pTmp uintptr = Xsqlite3ValueNew(tls, db) - Xsqlite3ValueSetStr(tls, pTmp, -1, zName, SQLITE_UTF8, uintptr(0)) - zExternal = Xsqlite3ValueText(tls, pTmp, SQLITE_UTF16LE) + Xsqlite3ValueSetStr(tls, pTmp, -1, zName, uint8(SQLITE_UTF8), uintptr(0)) + zExternal = Xsqlite3ValueText(tls, pTmp, uint8(SQLITE_UTF16LE)) if zExternal != 0 { (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal) } @@ -111142,7 +111142,7 @@ func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c return SQLITE_ERROR } -var aEnc = [3]U8{SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8} /* sqlite3.c:115598:19 */ +var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sqlite3.c:115598:19 */ // This routine is called on a collation sequence before it is used to // check that it is defined. An undefined collation sequence exists when @@ -111187,11 +111187,11 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui if pColl != 0 { var pDel uintptr = uintptr(0) (*CollSeq)(unsafe.Pointer(pColl)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl)).Fenc = SQLITE_UTF8 + (*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(SQLITE_UTF8) (*CollSeq)(unsafe.Pointer(pColl + 1*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = SQLITE_UTF16LE + (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = U8(SQLITE_UTF16LE) (*CollSeq)(unsafe.Pointer(pColl + 2*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = SQLITE_UTF16BE + (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = U8(SQLITE_UTF16BE) libc.X__builtin___memcpy_chk(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zName, uint64(nName), libc.X__builtin_object_size(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, 0)) pDel = Xsqlite3HashInsert(tls, (db + 600 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl) @@ -111370,7 +111370,7 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit } // Bonus points if the text encoding matches - if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) { + if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) { match = match + (2) // Exact encoding match } else if ((U32(enc) & (*FuncDef)(unsafe.Pointer(p)).FfuncFlags) & U32(2)) != U32(0) { match = match + (1) // Both are UTF16, but with different byte orders @@ -111461,7 +111461,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, // have fields overwritten with new information appropriate for the // new function. But the FuncDefs for built-in functions are read-only. // So we must not search for built-ins when creating a new function. - if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_PreferBuiltin) != U32(0))) { + if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_PreferBuiltin)) != U32(0))) { bestScore = 0 h = (((int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(zName)))])) + (nName)) % SQLITE_FUNC_HASH_SZ) p = Xsqlite3FunctionSearch(tls, h, zName) @@ -111559,7 +111559,7 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli Xsqlite3HashInit(tls, (p + 32 /* &.idxHash */)) Xsqlite3HashInit(tls, (p + 56 /* &.trigHash */)) Xsqlite3HashInit(tls, (p + 80 /* &.fkeyHash */)) - (*Schema)(unsafe.Pointer(p)).Fenc = SQLITE_UTF8 + (*Schema)(unsafe.Pointer(p)).Fenc = U8(SQLITE_UTF8) } return p } @@ -111631,7 +111631,7 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit return 0 } db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Readonly) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Readonly)) != U32(0) { return (libc.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0))) } @@ -111678,7 +111678,7 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher } pSel = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy, - SF_IncludeHidden, pLimit) + uint32(SF_IncludeHidden), pLimit) Xsqlite3SelectDestInit(tls, bp /* &dest */, SRT_EphemTab, iCur) Xsqlite3Select(tls, pParse, pSel, bp /* &dest */) Xsqlite3SelectDelete(tls, db, pSel) @@ -111905,7 +111905,7 @@ __14: } Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __17 } Xsqlite3VdbeAddOp4(tls, v, OP_Clear, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 { @@ -111947,7 +111947,7 @@ __21: } return WHERE_ONEPASS_MULTIROW }())) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __22 } // For a rowid table, initialize the RowSet to an empty set @@ -112111,7 +112111,7 @@ __41: __43: ; - Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, OPFLAG_FORDELETE, + Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(OPFLAG_FORDELETE), iTabCur, aToOpen, bp+80 /* &iDataCur */, bp+84 /* &iIdxCur */) if !(eOnePass == ONEPASS_MULTI) { @@ -112183,13 +112183,13 @@ __55: __54: ; Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, 1, iKey, pVTab, -12) - Xsqlite3VdbeChangeP5(tls, v, OE_Abort) + Xsqlite3VdbeChangeP5(tls, v, uint16(OE_Abort)) goto __53 __52: count = (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 84 /* iIdxCur */)), - iKey, nKey, uint8(count), OE_Default, uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) + iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) __53: ; @@ -112302,10 +112302,10 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri // (this can happen if a trigger program has already deleted it), do // not attempt to delete it or fire any DELETE triggers. iLabel = Xsqlite3VdbeMakeLabel(tls, pParse) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - opSeek = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + opSeek = uint8(OP_NotExists) } else { - opSeek = OP_NotFound + opSeek = uint8(OP_NotFound) } if int32(eMode) == ONEPASS_OFF { Xsqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) @@ -112384,7 +112384,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri Xsqlite3VdbeAppendP4(tls, v, pTab, -6) } if int32(eMode) != ONEPASS_OFF { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_AUXDELETE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE)) } if (iIdxNoSeek >= 0) && (iIdxNoSeek != iDataCur) { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iIdxNoSeek) @@ -112441,7 +112441,7 @@ func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, var pPk uintptr // PRIMARY KEY index, or NULL for rowid tables v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -112558,7 +112558,7 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData // But we are getting ready to store this value back into an index, where // it should be converted by to INTEGER again. So omit the OP_RealAffinity // opcode if it is present - Xsqlite3VdbeDeletePriorOpcode(tls, v, OP_RealAffinity) + Xsqlite3VdbeDeletePriorOpcode(tls, v, uint8(OP_RealAffinity)) } if regOut != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regOut) @@ -112898,7 +112898,7 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnUsed = 0 (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FapArg = (argv + uintptr(1)*8) Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = SQLITE_PRINTF_SQLFUNC + (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = U8(SQLITE_PRINTF_SQLFUNC) Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, libc.VaList(bp, bp+40 /* &x */)) n = int32((*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FnChar) Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp+8 /* &str */), n, @@ -113011,7 +113011,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } Xsqlite3_result_text64(tls, context, z, (uint64((int64(z2) - int64(z)) / 1)), libc.UintptrFromInt32(-1), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) } else { if (p1 + p2) > I64(len) { p2 = (I64(len) - p1) @@ -113067,7 +113067,7 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq Xsqlite3_result_error_nomem(tls, context) return } - Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), SQLITE_UTF8) + Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), uint8(SQLITE_UTF8)) Xsqlite3_free(tls, zBuf) } Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 16 /* r */))) @@ -113650,7 +113650,7 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq r1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+7758 /* "%!.15g" */, libc.VaList(bp, r1)) - Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, SQLITE_UTF8) + Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp + 72 /* r2 */)) { Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+17173 /* "%!.20e" */, libc.VaList(bp+8, r1)) } @@ -113782,7 +113782,7 @@ func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F)))))) } } - Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), SQLITE_UTF8) + Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8)) } // The hex() function. Interpret the argument as a blob. Return @@ -114110,7 +114110,7 @@ func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // Disallow the load_extension() SQL function unless the SQLITE_LoadExtFunc // flag is set. See the sqlite3_enable_load_extension() API. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtFunc) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtFunc)) == uint64(0) { Xsqlite3_result_error(tls, context, ts+14414 /* "not authorized" */, -1) return } @@ -114457,8 +114457,8 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 Xsqlite3CreateFunc(tls, db, ts+17193 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+17193 /* "like" */, 2, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+17193 /* "like" */, 3, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+17193 /* "like" */, 2, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+17193 /* "like" */, 3, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) } // pExpr points to an expression which implements a function. If @@ -114484,8 +114484,8 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase } nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FnExpr - pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, SQLITE_UTF8, uint8(0)) - if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_LIKE) == U32(0)) { + pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, uint8(SQLITE_UTF8), uint8(0)) + if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_LIKE)) == U32(0)) { return 0 } @@ -114515,7 +114515,7 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase *(*int8)(unsafe.Pointer(aWc + 3)) = *(*int8)(unsafe.Pointer(zEscape)) } - *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CASE) == U32(0))) + *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CASE)) == U32(0))) return 1 } @@ -114534,18 +114534,18 @@ func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: * var aBuiltinFunc = [65]FuncDef{ //**** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS **** - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_implies_nonnull_row), FxSFunc: 0, FzName: ts + 17198 /* "implies_nonnull_..." */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_compare), FxSFunc: 0, FzName: ts + 17218 /* "expr_compare" */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_implies_expr), FxSFunc: 0, FzName: ts + 17231 /* "expr_implies_exp..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_implies_nonnull_row)), FxSFunc: 0, FzName: ts + 17198 /* "implies_nonnull_..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_compare)), FxSFunc: 0, FzName: ts + 17218 /* "expr_compare" */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_implies_expr)), FxSFunc: 0, FzName: ts + 17231 /* "expr_implies_exp..." */}, //**** Regular functions **** {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 17249 /* "soundex" */}, {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 17257 /* "load_extension" */}, {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 17257 /* "load_extension" */}, {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 17272 /* "sqlite_compileop..." */}, {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 17298 /* "sqlite_compileop..." */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 17323 /* "unlikely" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 17332 /* "likelihood" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 17343 /* "likely" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 17323 /* "unlikely" */}, + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 17332 /* "likelihood" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 17343 /* "likely" */}, {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 17350 /* "sqlite_offset" */}, {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 17364 /* "ltrim" */}, {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 17364 /* "ltrim" */}, @@ -114600,7 +114600,7 @@ var aBuiltinFunc = [65]FuncDef{ {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 17638 /* "coalesce" */}, {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 17638 /* "coalesce" */}, {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 17638 /* "coalesce" */}, - {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_iif), FxSFunc: 0, FzName: ts + 17647 /* "iif" */}} /* sqlite3.c:118975:18 */ + {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_iif)), FxSFunc: 0, FzName: ts + 17647 /* "iif" */}} /* sqlite3.c:118975:18 */ //************* End of func.c *********************************************** //************* Begin file fkey.c ******************************************* @@ -114965,7 +114965,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // increment the constraint-counter. if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr == 1) { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regData, iOk, regTemp) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenRead) @@ -115010,7 +115010,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx iParent = regData } Xsqlite3VdbeAddOp3(tls, v, OP_Ne, iChild, iJump, iParent) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_JUMPIFNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_JUMPIFNULL)) } Xsqlite3VdbeGoto(tls, v, iOk) } @@ -115024,7 +115024,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx } } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Special case: If this is an INSERT statement that will insert exactly @@ -115033,7 +115033,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // generated for will not open a statement transaction. Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } else { if (nIncr > 0) && (int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0) { Xsqlite3MayAbort(tls, pParse) @@ -115070,7 +115070,7 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3 pExpr = Xsqlite3ExprAddCollateString(tls, pParse, pExpr, zColl) } else { (*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) } } return pExpr @@ -115185,7 +115185,7 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p var pNe uintptr // Expression (pLeft != pRight) var pLeft uintptr // Value from parent table row var pRight uintptr // Column ref to child table - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pLeft = exprTableRegister(tls, pParse, pTab, regData, int16(-1)) pRight = exprTableColumn(tls, db, pTab, (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1)) pNe = Xsqlite3PExpr(tls, pParse, TK_NE, pLeft, pRight) @@ -115280,7 +115280,7 @@ func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119 // DELETE, but foreign key actions are not. func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:119820:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { var iSkip int32 = 0 var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -115294,7 +115294,7 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // when this statement is run. var p uintptr for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { - if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { break } } @@ -115317,12 +115317,12 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // If the SQLITE_DeferFKs flag is set, then this is not required, as // the statement transaction will not be rolled back even if FK // constraints are violated. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) == uint64(0) { Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2)) Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } if iSkip != 0 { @@ -115437,7 +115437,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, // Exactly one of regOld and regNew should be non-zero. // If foreign-keys are disabled, this function is a no-op. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) == uint64(0) { return } @@ -115562,7 +115562,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, continue } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Inserting a single row into a parent table cannot cause (or fix) @@ -115628,7 +115628,7 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql defer tls.Free(8) var mask U32 = U32(0) - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var p uintptr var i int32 for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { @@ -115682,7 +115682,7 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql // Or, assuming some other foreign key processing is required, 1. func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:120222:20: */ var eRet int32 = 0 - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { 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 @@ -115754,7 +115754,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, var iAction int32 = (libc.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE action = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr(iAction)))) - if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { return uintptr(0) } pTrigger = *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) @@ -115867,7 +115867,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, (*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fn = uint32(nFrom) pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+8032 /* "FOREIGN KEY cons..." */) if pRaise != 0 { - (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = OE_Abort + (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) } pSelect = Xsqlite3SelectNew(tls, pParse, Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRaise), @@ -115917,17 +115917,17 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, switch action { case OE_Restrict: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_SELECT) break fallthrough case OE_Cascade: if !(pChanges != 0) { - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_DELETE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_DELETE) break } fallthrough default: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_UPDATE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_UPDATE) } (*TriggerStep)(unsafe.Pointer(pStep)).FpTrig = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema @@ -115935,9 +115935,9 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).Fop = func() uint8 { if pChanges != 0 { - return TK_UPDATE + return uint8(TK_UPDATE) } - return TK_DELETE + return uint8(TK_DELETE) }() } @@ -115951,7 +115951,7 @@ func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uin // refer to table pTab. If there is an action associated with the FK // for this operation (either update or delete), invoke the associated // trigger sub-program. - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var pFKey uintptr // Iterator variable for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo { if (aChange == uintptr(0)) || (fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0) { @@ -116042,7 +116042,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa } return uint8(0) }(), (*Table)(unsafe.Pointer(pTab)).FzName) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol)) Xsqlite3VdbeComment(tls, v, ts+834 /* "%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) } else { @@ -116094,16 +116094,16 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { if int32(x) >= 0 { aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*32)).Faffinity } else if int32(x) == (-1) { - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) } else { aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(n)*32)).FpExpr) } if int32(aff) < SQLITE_AFF_BLOB { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } if int32(aff) > SQLITE_AFF_NUMERIC { - aff = SQLITE_AFF_NUMERIC + aff = int8(SQLITE_AFF_NUMERIC) } *(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = aff } @@ -116232,7 +116232,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in // Before computing generated columns, first go through and make sure // that appropriate affinity has been applied to the regular columns Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasStored) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStored)) != U32(0)) && (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == OP_Affinity) { // Change the OP_Affinity argument to '@' (NONE) for all stored // columns. '@' is the no-op affinity and those columns have not @@ -116246,7 +116246,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in continue } if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*32)).FcolFlags) & COLFLAG_STORED) != 0 { - *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = SQLITE_AFF_NONE + *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = int8(SQLITE_AFF_NONE) } jj++ } @@ -116327,8 +116327,8 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120894:12: */ var memId int32 = 0 // Register holding maximum rowid - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)) && + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) { var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -116342,7 +116342,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 // rowid table with exactly two columns. // Ticket d8dc2b3a58cd5dc2918a1d4acb 2018-05-23 if (((pSeqTab == uintptr(0)) || - !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Table)(unsafe.Pointer(pSeqTab)).FnModuleArg != 0)) || (int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2) { (*Parse)(unsafe.Pointer(pParse)).FnErr++ @@ -116401,7 +116401,7 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 (*VdbeOp)(unsafe.Pointer(aOp + 2*32)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp1 = (memId - 1) (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp3 = memId - (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = SQLITE_JUMPIFNULL + (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = U16(SQLITE_JUMPIFNULL) (*VdbeOp)(unsafe.Pointer(aOp + 4*32)).Fp2 = (memId + 1) (*VdbeOp)(unsafe.Pointer(aOp + 5*32)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 6*32)).Fp1 = memId @@ -116416,18 +116416,18 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 var iLn1 int32 = 0 /* sqlite3.c:120957:22 */ var autoInc = [12]VdbeOpList{ - /* 0 */ {Fopcode: OP_Null}, - /* 1 */ {Fopcode: OP_Rewind, Fp2: int8(10)}, - /* 2 */ {Fopcode: OP_Column}, - /* 3 */ {Fopcode: OP_Ne, Fp2: int8(9)}, - /* 4 */ {Fopcode: OP_Rowid}, - /* 5 */ {Fopcode: OP_Column, Fp2: int8(1)}, - /* 6 */ {Fopcode: OP_AddImm}, - /* 7 */ {Fopcode: OP_Copy}, - /* 8 */ {Fopcode: OP_Goto, Fp2: int8(11)}, - /* 9 */ {Fopcode: OP_Next, Fp2: int8(2)}, - /* 10 */ {Fopcode: OP_Integer}, - /* 11 */ {Fopcode: OP_Close}, + /* 0 */ {Fopcode: U8(OP_Null)}, + /* 1 */ {Fopcode: U8(OP_Rewind), Fp2: int8(10)}, + /* 2 */ {Fopcode: U8(OP_Column)}, + /* 3 */ {Fopcode: U8(OP_Ne), Fp2: int8(9)}, + /* 4 */ {Fopcode: U8(OP_Rowid)}, + /* 5 */ {Fopcode: U8(OP_Column), Fp2: int8(1)}, + /* 6 */ {Fopcode: U8(OP_AddImm)}, + /* 7 */ {Fopcode: U8(OP_Copy)}, + /* 8 */ {Fopcode: U8(OP_Goto), Fp2: int8(11)}, + /* 9 */ {Fopcode: U8(OP_Next), Fp2: int8(2)}, + /* 10 */ {Fopcode: U8(OP_Integer)}, + /* 11 */ {Fopcode: U8(OP_Close)}, } /* sqlite3.c:120958:29 */ // Update the maximum rowid for an autoincrement calculation. @@ -116473,18 +116473,18 @@ func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: * (*VdbeOp)(unsafe.Pointer(aOp + 2*32)).Fp3 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp2 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp3 = (memId + 1) - (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = OPFLAG_APPEND + (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = U16(OPFLAG_APPEND) Xsqlite3ReleaseTempReg(tls, pParse, iRec) } } var iLn2 int32 = 0 /* sqlite3.c:121024:22 */ var autoIncEnd = [5]VdbeOpList{ - /* 0 */ {Fopcode: OP_NotNull, Fp2: int8(2)}, - /* 1 */ {Fopcode: OP_NewRowid}, - /* 2 */ {Fopcode: OP_MakeRecord, Fp2: int8(2)}, - /* 3 */ {Fopcode: OP_Insert}, - /* 4 */ {Fopcode: OP_Close}, + /* 0 */ {Fopcode: U8(OP_NotNull), Fp2: int8(2)}, + /* 1 */ {Fopcode: U8(OP_NewRowid)}, + /* 2 */ {Fopcode: U8(OP_MakeRecord), Fp2: int8(2)}, + /* 3 */ {Fopcode: U8(OP_Insert)}, + /* 4 */ {Fopcode: U8(OP_Close)}, } /* sqlite3.c:121025:29 */ func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121054:21: */ @@ -116691,7 +116691,7 @@ __1: // 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 // and discard the other (unused) parts of the pSelect object - if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Values) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { + if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Values)) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { goto __2 } pList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -116719,7 +116719,7 @@ __3: goto insert_cleanup __4: ; - withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) + withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) // Figure out if we have any triggers and if the table being // inserted into is a view @@ -116996,7 +116996,7 @@ __29: goto __36 } ipkColumn = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) - if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0))) { + if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0))) { goto __37 } @@ -117211,11 +117211,11 @@ __63: goto __64 __66: ; - if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & COLFLAG_NOINSERT) != U32(0)) { + if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & U32(COLFLAG_NOINSERT)) != U32(0)) { goto __67 } nHidden++ - if !((colFlags & COLFLAG_VIRTUAL) != U32(0)) { + if !((colFlags & U32(COLFLAG_VIRTUAL)) != U32(0)) { goto __68 } // Virtual columns do not participate in OP_MakeRecord. So back up @@ -117225,7 +117225,7 @@ __66: goto __64 goto __69 __68: - if !((colFlags & COLFLAG_STORED) != U32(0)) { + if !((colFlags & U32(COLFLAG_STORED)) != U32(0)) { goto __70 } // Stored columns are computed later. But if there are BEFORE @@ -117375,7 +117375,7 @@ __89: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // refers to the ROWID. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __92 } @@ -117483,7 +117483,7 @@ __97: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // is derived from the INTEGER PRIMARY KEY. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __109 } Xsqlite3ComputeGeneratedColumns(tls, pParse, (regRowid + 1), pTab) @@ -117500,7 +117500,7 @@ __109: Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 2), regIns, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) @@ -117786,7 +117786,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // normal rowid tables. nPkField is the number of key fields in the // pPk index or 1 for a rowid table. In other words, nPkField is the // number of fields in the true primary key of the table. - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) nPkField = 1 } else { @@ -117797,7 +117797,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // Record that this module has started // Test all NOT NULL constraints. - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasNotNull) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasNotNull)) != 0 { var b2ndPass int32 = 0 // True if currently running 2nd pass var nSeenReplace int32 = 0 // Number of ON CONFLICT REPLACE operations var nGenerated int32 = 0 // Number of generated columns with NOT NULL @@ -117864,7 +117864,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, (SQLITE_CONSTRAINT | (int32(5) << 8)), onError, iReg) Xsqlite3VdbeAppendP4(tls, v, zMsg, -7) - Xsqlite3VdbeChangeP5(tls, v, P5_ConstraintNotNull) + Xsqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull)) break @@ -117890,7 +117890,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt break } // Never need more than 2 passes b2ndPass = 1 - if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) { + if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) { // If any NOT NULL ON CONFLICT REPLACE constraints fired on the // first pass, recomputed values for all generated columns, as // those values might depend on columns affected by the REPLACE. @@ -117900,7 +117900,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } // end if( has-not-null-constraints ) // Test all CHECK constraints - if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0)) { var pCheck uintptr = (*Table)(unsafe.Pointer(pTab)).FpCheck (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) if int32(overrideError) != OE_Default { @@ -117940,8 +117940,8 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt onError = OE_Abort } // IMP: R-26383-51744 Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(1) << 8)), - onError, zName, P4_TRANSIENT, - P5_ConstraintCheck) + onError, zName, int8(P4_TRANSIENT), + uint8(P5_ConstraintCheck)) } Xsqlite3VdbeResolveLabel(tls, v, allOk) } @@ -117981,7 +117981,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // An ON CONFLICT DO NOTHING clause, without a constraint-target. // Make all unique constraint resolution be OE_Ignore - overrideError = OE_Ignore + overrideError = U8(OE_Ignore) pUpsert = uintptr(0) } else if (libc.AssignUintptr(&pUpIdx, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx)) != uintptr(0) { // If the constraint-target uniqueness check must be run first. @@ -118016,7 +118016,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt pTrigger = uintptr(0) regTrigCnt = 0 } else { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_RecTriggers) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_RecTriggers)) != 0 { pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0)) regTrigCnt = (libc.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0))) } else { @@ -118072,7 +118072,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // it might have changed. Skip the conflict logic below if the rowid // is unchanged. Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRowidOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } @@ -118127,7 +118127,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if regTrigCnt != 0 { Xsqlite3MultiWrite(tls, pParse) Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regNewData, int16(1), uint8(0), OE_Replace, uint8(1), -1) + regNewData, int16(1), uint8(0), uint8(OE_Replace), uint8(1), -1) Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1) // incr trigger cnt nReplaceTrig++ } else { @@ -118293,13 +118293,13 @@ __1: regR = Xsqlite3GetTempRange(tls, pParse, nPkField) } if (isUpdate != 0) || (onError == OE_Replace) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iThisCur, regR) // Conflict only if the rowid of the existing index entry // is different from old-rowid if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regR, addrUniqueOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } else { @@ -118342,7 +118342,7 @@ __1: x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x))) Xsqlite3VdbeAddOp4(tls, v, op, ((regOldData + 1) + x), addrJump, (regCmp + i), p4, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } @@ -118390,12 +118390,12 @@ __1: Xsqlite3VdbeAddOp1(tls, v, OP_CursorLock, iDataCur) } Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regR, int16(nPkField), uint8(0), OE_Replace, + regR, int16(nPkField), uint8(0), uint8(OE_Replace), func() uint8 { if pIdx == pPk { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_OFF + return uint8(ONEPASS_OFF) }(), iThisCur) if (pTrigger != 0) && (isUpdate != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_CursorUnlock, iDataCur) @@ -118493,7 +118493,7 @@ __3: if !(pPk != 0) { if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRecheck, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRecheck, regNewData) @@ -118506,7 +118506,7 @@ __3: } // Generate the table record - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regNewData + 1), int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec) @@ -118553,11 +118553,11 @@ __1: } pik_flags = func() uint8 { if useSeekResult != 0 { - return OPFLAG_USESEEKRESULT + return uint8(OPFLAG_USESEEKRESULT) } return uint8(0) }() - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pik_flags = U8(int32(pik_flags) | (OPFLAG_NCHANGE)) pik_flags = U8(int32(pik_flags) | (update_flags & OPFLAG_SAVEPOSITION)) @@ -118566,7 +118566,7 @@ __1: Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r) Xsqlite3VdbeAddOp4(tls, v, OP_Insert, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), r, pTab, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_ISNOOP) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_ISNOOP)) Xsqlite3ReleaseTempReg(tls, pParse, r) } } @@ -118589,13 +118589,13 @@ __2: goto __3 __3: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { return } if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 { pik_flags = U8(0) } else { - pik_flags = OPFLAG_NCHANGE + pik_flags = U8(OPFLAG_NCHANGE) pik_flags = U8(int32(pik_flags) | (func() int32 { if update_flags != 0 { return update_flags @@ -118661,7 +118661,7 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iDataCur } - if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { + if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op) } else { Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(libc.Bool32(op == OP_OpenWrite))), (*Table)(unsafe.Pointer(pTab)).FzName) @@ -118678,7 +118678,7 @@ __1: { var iIdxCur int32 = libc.PostIncInt32(&iBase, 1) - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur } @@ -118850,7 +118850,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint if (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 { return 0 // SELECT may not be a compound query } - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Distinct)) != 0 { return 0 // SELECT may not be DISTINCT } pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -118875,7 +118875,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // Possible due to bad sqlite_schema.rootpage return 0 // tab1 and tab2 may not be the same table } - if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & TF_WithoutRowid) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { return 0 // source and destination must both be WITHOUT ROWID or not } if (*Table)(unsafe.Pointer(pSrc)).FnModuleArg != 0 { @@ -118968,7 +118968,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // command, and the VACUUM command disables foreign key constraints. So // the extra complication to make this rule less restrictive is probably // not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { return 0 } if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0) { @@ -118989,7 +118989,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint regRowid = Xsqlite3GetTempReg(tls, pParse) Xsqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, OP_OpenWrite) - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) (destHasUniqueIdx != 0)) || // (2) ((onError != OE_Abort) && (onError != OE_Rollback))) { // In some circumstances, we are able to run the xfer optimization @@ -119012,7 +119012,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint emptyDestTest = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) Xsqlite3VdbeJumpHere(tls, v, addr1) } - if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var insFlags U8 Xsqlite3OpenTable(tls, pParse, iSrc, iDbSrc, pSrc, OP_OpenRead) emptySrcTest = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) @@ -119024,13 +119024,13 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint Xsqlite3RowidConstraint(tls, pParse, onError, pDest) Xsqlite3VdbeJumpHere(tls, v, addr2) autoIncStep(tls, pParse, regAutoinc, regRowid) - } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_VacuumInto) != 0) { + } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_VacuumInto)) != 0) { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iDest, regRowid) } else { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid) } - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) insFlags = (U8(OPFLAG_APPEND | OPFLAG_USESEEKRESULT)) } else { @@ -119060,10 +119060,10 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint Xsqlite3VdbeComment(tls, v, ts+834 /* "%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pSrcIdx)).FzName)) Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, iDest, int32((*Index)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_BULKCSR) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR)) Xsqlite3VdbeComment(tls, v, ts+834 /* "%s" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pDestIdx)).FzName)) addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { // This INSERT command is part of a VACUUM operation, which guarantees // that the destination table is empty. If all indexed columns use // collation sequence BINARY, then it can also be assumed that the @@ -119085,10 +119085,10 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint } } if i == int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn) { - idxInsFlags = OPFLAG_USESEEKRESULT + idxInsFlags = U8(OPFLAG_USESEEKRESULT) Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) } - } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { idxInsFlags = U8(int32(idxInsFlags) | (OPFLAG_NCHANGE)) } Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) @@ -119210,7 +119210,7 @@ __7: // Invoke the callback function if required if !((xCallback != 0) && ((SQLITE_ROW == rc) || (((SQLITE_DONE == rc) && !(callbackIsInit != 0)) && - (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NullCallback) != 0)))) { + (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NullCallback)) != 0)))) { goto __9 } if !(!(callbackIsInit != 0)) { @@ -119710,7 +119710,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt // must call either sqlite3_enable_load_extension(db) or // sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, 0) // to turn on extension loading. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtension) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtension)) == uint64(0) { if pzErrMsg != 0 { *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+14414 /* "not authorized" */, 0) } @@ -120109,241 +120109,241 @@ type PragmaName1 = struct { type PragmaName = PragmaName1 /* sqlite3.c:125259:3 */ var aPragmaName = [67]PragmaName{ { /* zName: */ FzName: ts + 18538, /* "analysis_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_ANALYSIS_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_ANALYSIS_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 18553, /* "application_id" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_APPLICATION_ID}, + /* iArg: */ FiArg: uint64(BTREE_APPLICATION_ID)}, { /* zName: */ FzName: ts + 18568, /* "auto_vacuum" */ - /* ePragTyp: */ FePragTyp: PragTyp_AUTO_VACUUM, + /* ePragTyp: */ FePragTyp: U8(PragTyp_AUTO_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 18580, /* "automatic_index" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_AutoIndex}, + /* iArg: */ FiArg: uint64(SQLITE_AutoIndex)}, { /* zName: */ FzName: ts + 18596, /* "busy_timeout" */ - /* ePragTyp: */ FePragTyp: PragTyp_BUSY_TIMEOUT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_BUSY_TIMEOUT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(50), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 18519, /* "cache_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 18609, /* "cache_spill" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SPILL, + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SPILL), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 18621, /* "case_sensitive_l..." */ - /* ePragTyp: */ FePragTyp: PragTyp_CASE_SENSITIVE_LIKE, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_CASE_SENSITIVE_LIKE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, { /* zName: */ FzName: ts + 18641, /* "cell_size_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CellSizeCk}, + /* iArg: */ FiArg: uint64(SQLITE_CellSizeCk)}, { /* zName: */ FzName: ts + 18657, /* "checkpoint_fullf..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CkptFullFSync}, + /* iArg: */ FiArg: uint64(SQLITE_CkptFullFSync)}, { /* zName: */ FzName: ts + 18678, /* "collation_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_COLLATION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_COLLATION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(2)}, { /* zName: */ FzName: ts + 18693, /* "compile_options" */ - /* ePragTyp: */ FePragTyp: PragTyp_COMPILE_OPTIONS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_COMPILE_OPTIONS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 18709, /* "count_changes" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (U64((uint64(0x00001))) << 32)}, { /* zName: */ FzName: ts + 18723, /* "data_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_DATA_VERSION}, + /* iArg: */ FiArg: uint64(BTREE_DATA_VERSION)}, { /* zName: */ FzName: ts + 18736, /* "database_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_DATABASE_LIST, + /* ePragTyp: */ FePragTyp: U8(PragTyp_DATABASE_LIST), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_Result0)), /* ColNames: */ FiPragCName: U8(41), FnPragCName: U8(3)}, { /* zName: */ FzName: ts + 18750, /* "default_cache_si..." */ - /* ePragTyp: */ FePragTyp: PragTyp_DEFAULT_CACHE_SIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_DEFAULT_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1)), /* ColNames: */ FiPragCName: U8(49), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 18769, /* "defer_foreign_ke..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_DeferFKs}, + /* iArg: */ FiArg: uint64(SQLITE_DeferFKs)}, { /* zName: */ FzName: ts + 18788, /* "empty_result_cal..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_NullCallback}, + /* iArg: */ FiArg: uint64(SQLITE_NullCallback)}, { /* zName: */ FzName: ts + 18811, /* "encoding" */ - /* ePragTyp: */ FePragTyp: PragTyp_ENCODING, + /* ePragTyp: */ FePragTyp: U8(PragTyp_ENCODING), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 18820, /* "foreign_key_chec..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_CHECK, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_CHECK), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(37), FnPragCName: U8(4)}, { /* zName: */ FzName: ts + 18838, /* "foreign_key_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_LIST, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), FnPragCName: U8(8)}, { /* zName: */ FzName: ts + 18855, /* "foreign_keys" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ForeignKeys}, + /* iArg: */ FiArg: uint64(SQLITE_ForeignKeys)}, { /* zName: */ FzName: ts + 18868, /* "freelist_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0))}, { /* zName: */ FzName: ts + 18883, /* "full_column_name..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullColNames}, + /* iArg: */ FiArg: uint64(SQLITE_FullColNames)}, { /* zName: */ FzName: ts + 18901, /* "fullfsync" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullFSync}, + /* iArg: */ FiArg: uint64(SQLITE_FullFSync)}, { /* zName: */ FzName: ts + 18911, /* "function_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FUNCTION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FUNCTION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(6)}, { /* zName: */ FzName: ts + 18925, /* "hard_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_HARD_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HARD_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 18941, /* "ignore_check_con..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_IgnoreChecks}, + /* iArg: */ FiArg: uint64(SQLITE_IgnoreChecks)}, { /* zName: */ FzName: ts + 18966, /* "incremental_vacu..." */ - /* ePragTyp: */ FePragTyp: PragTyp_INCREMENTAL_VACUUM, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INCREMENTAL_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_NoColumns))}, { /* zName: */ FzName: ts + 18985, /* "index_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(3)}, { /* zName: */ FzName: ts + 18996, /* "index_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_LIST, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(5)}, { /* zName: */ FzName: ts + 19007, /* "index_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(6), /* iArg: */ FiArg: uint64(1)}, { /* zName: */ FzName: ts + 19019, /* "integrity_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, { /* zName: */ FzName: ts + 19035, /* "journal_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_MODE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_MODE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 19048, /* "journal_size_lim..." */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_SIZE_LIMIT, + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_SIZE_LIMIT), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 19067, /* "legacy_alter_tab..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_LegacyAlter}, + /* iArg: */ FiArg: uint64(SQLITE_LegacyAlter)}, { /* zName: */ FzName: ts + 19086, /* "lock_proxy_file" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCK_PROXY_FILE, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns1}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCK_PROXY_FILE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)}, { /* zName: */ FzName: ts + 19102, /* "lock_status" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCK_STATUS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCK_STATUS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(47), FnPragCName: U8(2)}, { /* zName: */ FzName: ts + 19114, /* "locking_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCKING_MODE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCKING_MODE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 19127, /* "max_page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 19142, /* "mmap_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_MMAP_SIZE}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_MMAP_SIZE)}, { /* zName: */ FzName: ts + 19152, /* "module_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_MODULE_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_MODULE_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 19164, /* "optimize" */ - /* ePragTyp: */ FePragTyp: PragTyp_OPTIMIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_OPTIMIZE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result1 | PragFlg_NeedSchema))}, { /* zName: */ FzName: ts + 19173, /* "page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, { /* zName: */ FzName: ts + 19184, /* "page_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_SIZE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_SIZE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 19194, /* "pragma_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_PRAGMA_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* ePragTyp: */ FePragTyp: U8(PragTyp_PRAGMA_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, { /* zName: */ FzName: ts + 19206, /* "query_only" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_QueryOnly}, + /* iArg: */ FiArg: uint64(SQLITE_QueryOnly)}, { /* zName: */ FzName: ts + 19217, /* "quick_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, { /* zName: */ FzName: ts + 19229, /* "read_uncommitted" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReadUncommit}, + /* iArg: */ FiArg: uint64(SQLITE_ReadUncommit)}, { /* zName: */ FzName: ts + 19246, /* "recursive_trigge..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_RecTriggers}, + /* iArg: */ FiArg: uint64(SQLITE_RecTriggers)}, { /* zName: */ FzName: ts + 19265, /* "reverse_unordere..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReverseOrder}, + /* iArg: */ FiArg: uint64(SQLITE_ReverseOrder)}, { /* zName: */ FzName: ts + 19291, /* "schema_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_SCHEMA_VERSION}, + /* iArg: */ FiArg: uint64(BTREE_SCHEMA_VERSION)}, { /* zName: */ FzName: ts + 19306, /* "secure_delete" */ - /* ePragTyp: */ FePragTyp: PragTyp_SECURE_DELETE, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SECURE_DELETE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 19320, /* "short_column_nam..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ShortColNames}, + /* iArg: */ FiArg: uint64(SQLITE_ShortColNames)}, { /* zName: */ FzName: ts + 19339, /* "shrink_memory" */ - /* ePragTyp: */ FePragTyp: PragTyp_SHRINK_MEMORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SHRINK_MEMORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, { /* zName: */ FzName: ts + 19353, /* "soft_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_SOFT_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SOFT_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 19369, /* "synchronous" */ - /* ePragTyp: */ FePragTyp: PragTyp_SYNCHRONOUS, + /* ePragTyp: */ FePragTyp: U8(PragTyp_SYNCHRONOUS), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 19381, /* "table_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(6)}, { /* zName: */ FzName: ts + 19392, /* "table_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(7), /* iArg: */ FiArg: uint64(1)}, { /* zName: */ FzName: ts + 19404, /* "temp_store" */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, { /* zName: */ FzName: ts + 19415, /* "temp_store_direc..." */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE_DIRECTORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns1}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE_DIRECTORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)}, { /* zName: */ FzName: ts + 19436, /* "threads" */ - /* ePragTyp: */ FePragTyp: PragTyp_THREADS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_THREADS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, { /* zName: */ FzName: ts + 19444, /* "trusted_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_TrustedSchema}, + /* iArg: */ FiArg: uint64(SQLITE_TrustedSchema)}, { /* zName: */ FzName: ts + 19459, /* "user_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_USER_VERSION}, + /* iArg: */ FiArg: uint64(BTREE_USER_VERSION)}, { /* zName: */ FzName: ts + 19472, /* "wal_autocheckpoi..." */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_AUTOCHECKPOINT}, + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_AUTOCHECKPOINT)}, { /* zName: */ FzName: ts + 19491, /* "wal_checkpoint" */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_CHECKPOINT, - /* ePragFlg: */ FmPragFlg: PragFlg_NeedSchema, + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_CHECKPOINT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema), /* ColNames: */ FiPragCName: U8(44), FnPragCName: U8(3)}, { /* zName: */ FzName: ts + 19506, /* "writable_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, } /* sqlite3.c:125260:25 */ @@ -120541,7 +120541,7 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ for (libc.PostDecInt32(&n, 1)) > 0 { if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 { Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, - (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) } pDb += 32 } @@ -120624,7 +120624,7 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) { continue } - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (showInternFuncs == 0) { continue } @@ -120637,9 +120637,9 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh } Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19741, /* "sissii" */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, - zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&SQLITE_FUNC_ENCMASK)], + zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK))], int32((*FuncDef)(unsafe.Pointer(p)).FnArg), - (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^SQLITE_INNOCUOUS))) + (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^U32(SQLITE_INNOCUOUS)))) } } @@ -121735,7 +121735,7 @@ __89: eMode1 = -1 __91: ; - if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0))) { + if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0))) { goto __92 } // Do not allow journal-mode "OFF" in defensive since the database @@ -121914,7 +121914,7 @@ __26: } returnSingleInt(tls, v, func() int64 { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_CacheSpill) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_CacheSpill)) == uint64(0) { return int64(0) } return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0)) @@ -121931,10 +121931,10 @@ __109: if !(Xsqlite3GetBoolean(tls, zRight, (uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 436 /* size3 */)) != 0)))) != 0) { goto __110 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_CacheSpill) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_CacheSpill)) goto __111 __110: - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CacheSpill)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CacheSpill))) __111: ; setAllPagerFlags(tls, db) @@ -122191,7 +122191,7 @@ __144: goto __146 __145: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^mask) - if !(mask == SQLITE_DeferFKs) { + if !(mask == uint64(SQLITE_DeferFKs)) { goto __147 } (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) @@ -122225,7 +122225,7 @@ __33: goto __148 } Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb) - pTab = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) + pTab = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) if !(pTab != 0) { goto __149 } @@ -122347,8 +122347,8 @@ __34: // If there is no index named zRight, check to see if there is a // WITHOUT ROWID table named zRight, and if there is, show the // structure of the PRIMARY KEY index for that table. - pTab1 = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) - if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + pTab1 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) + if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __168 } pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab1) @@ -122499,7 +122499,7 @@ __187: goto __15 __38: - showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_InternalFunc) != U32(0))) + showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_InternalFunc)) != U32(0))) (*Parse)(unsafe.Pointer(pParse)).FnMem = 6 i5 = 0 __188: @@ -122796,7 +122796,7 @@ __235: ; // Generate code to report an FK violation to the caller. - if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __237 } Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, (regResult + 1)) @@ -122957,7 +122957,7 @@ __250: goto __251 __253: ; - if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __254 } cnt++ @@ -123029,7 +123029,7 @@ __263: goto __264 __266: ; - if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __267 } *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab6)).Ftnum) @@ -123099,7 +123099,7 @@ __274: goto __272 __275: ; - if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk1 = uintptr(0) } else { pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab7) @@ -123132,7 +123132,7 @@ __278: } // Sanity check on record header decoding Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 508 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __279: ; // Verify that all NOT NULL columns really are NOT NULL @@ -123157,7 +123157,7 @@ __284: if !(int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Column) { goto __285 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __285: ; jmp2 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, 3) @@ -123174,7 +123174,7 @@ __281: __282: ; // Verify CHECK constraints - if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0))) { + if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0))) { goto __286 } pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab7)).FpCheck, 0) @@ -123314,7 +123314,7 @@ __305: ; Xsqlite3VdbeAddOp2(tls, v, OP_Count, (*(*int32)(unsafe.Pointer(bp + 512 /* iIdxCur */)) + j4), 3) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, (8 + j4), 0, 3) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 2, 3) integrityCheckResultRow(tls, v) @@ -123397,7 +123397,7 @@ __307: // "PRAGMA encoding = XXX" // initialized. If the main database exists, the new sqlite.enc value // will be overwritten when the schema is next loaded. If it does not // already exists, it will be created to use the new encoding value. - if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0)) { goto __310 } pEnc = (uintptr(unsafe.Pointer(&encnames1))) @@ -123411,7 +123411,7 @@ __311: if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 { enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc } else { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc) = enc Xsqlite3SetTextEncoding(tls, db, enc) @@ -123702,7 +123702,7 @@ __336: // If table pTab has not been used in a way that would benefit from // having analysis statistics during the current session, then skip it. // This also has the effect of skipping virtual tables and views - if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & TF_StatsUsed) == U32(0)) { + if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & U32(TF_StatsUsed)) == U32(0)) { goto __339 } goto __337 @@ -123940,53 +123940,53 @@ type EncName = struct { var iLn3 int32 = 0 /* sqlite3.c:126248:22 */ var getCacheSize = [9]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_DEFAULT_CACHE_SIZE}, // 1 - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(2)}, - {Fopcode: OP_Subtract, Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(1)}, // 6 - {Fopcode: OP_Noop}, - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_DEFAULT_CACHE_SIZE)}, // 1 + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(2)}, + {Fopcode: U8(OP_Subtract), Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(1)}, // 6 + {Fopcode: U8(OP_Noop)}, + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, } /* sqlite3.c:126249:29 */ var iLn4 int32 = 0 /* sqlite3.c:126517:26 */ var setMeta6 = [5]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_LARGEST_ROOT_PAGE}, - {Fopcode: OP_If, Fp1: int8(1)}, // 2 - {Fopcode: OP_Halt, Fp2: OE_Abort}, // 3 - {Fopcode: OP_SetCookie, Fp2: BTREE_INCR_VACUUM}, // 4 + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_LARGEST_ROOT_PAGE)}, + {Fopcode: U8(OP_If), Fp1: int8(1)}, // 2 + {Fopcode: U8(OP_Halt), Fp2: int8(OE_Abort)}, // 3 + {Fopcode: U8(OP_SetCookie), Fp2: int8(BTREE_INCR_VACUUM)}, // 4 } /* sqlite3.c:126518:33 */ var iLn5 int32 = 0 /* sqlite3.c:127522:24 */ var endCode = [7]VdbeOpList{ - {Fopcode: OP_AddImm, Fp1: int8(1)}, // 0 - {Fopcode: OP_IfNotZero, Fp1: int8(1), Fp2: int8(4)}, // 1 - {Fopcode: OP_String8, Fp2: int8(3)}, // 2 - {Fopcode: OP_ResultRow, Fp1: int8(3), Fp2: int8(1)}, // 3 - {Fopcode: OP_Halt}, // 4 - {Fopcode: OP_String8, Fp2: int8(3)}, // 5 - {Fopcode: OP_Goto, Fp2: int8(3)}, // 6 + {Fopcode: U8(OP_AddImm), Fp1: int8(1)}, // 0 + {Fopcode: U8(OP_IfNotZero), Fp1: int8(1), Fp2: int8(4)}, // 1 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 2 + {Fopcode: U8(OP_ResultRow), Fp1: int8(3), Fp2: int8(1)}, // 3 + {Fopcode: U8(OP_Halt)}, // 4 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 5 + {Fopcode: U8(OP_Goto), Fp2: int8(3)}, // 6 } /* sqlite3.c:127523:31 */ var encnames1 = [9]EncName{ - {FzName: ts + 20166 /* "UTF8" */, Fenc: SQLITE_UTF8}, - {FzName: ts + 20171 /* "UTF-8" */, Fenc: SQLITE_UTF8}, // Must be element [1] - {FzName: ts + 20177 /* "UTF-16le" */, Fenc: SQLITE_UTF16LE}, // Must be element [2] - {FzName: ts + 20186 /* "UTF-16be" */, Fenc: SQLITE_UTF16BE}, // Must be element [3] - {FzName: ts + 20195 /* "UTF16le" */, Fenc: SQLITE_UTF16LE}, - {FzName: ts + 20203 /* "UTF16be" */, Fenc: SQLITE_UTF16BE}, + {FzName: ts + 20166 /* "UTF8" */, Fenc: U8(SQLITE_UTF8)}, + {FzName: ts + 20171 /* "UTF-8" */, Fenc: U8(SQLITE_UTF8)}, // Must be element [1] + {FzName: ts + 20177 /* "UTF-16le" */, Fenc: U8(SQLITE_UTF16LE)}, // Must be element [2] + {FzName: ts + 20186 /* "UTF-16be" */, Fenc: U8(SQLITE_UTF16BE)}, // Must be element [3] + {FzName: ts + 20195 /* "UTF16le" */, Fenc: U8(SQLITE_UTF16LE)}, + {FzName: ts + 20203 /* "UTF16be" */, Fenc: U8(SQLITE_UTF16BE)}, {FzName: ts + 20211 /* "UTF-16" */}, // SQLITE_UTF16NATIVE {FzName: ts + 20218 /* "UTF16" */}, // SQLITE_UTF16NATIVE {}, } /* sqlite3.c:127575:7 */ var setCookie = [2]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_SetCookie}, // 1 + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_SetCookie)}, // 1 } /* sqlite3.c:127655:31 */ var readCookie = [3]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1)}, // 1 - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1)}, // 1 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, } /* sqlite3.c:127670:31 */ var azLockName = [5]uintptr{ ts + 20224 /* "unlocked" */, ts + 20233 /* "shared" */, ts + 20240 /* "reserved" */, ts + 20249 /* "pending" */, ts + 19547, /* "exclusive" */ @@ -124370,10 +124370,10 @@ func corruptSchema(tls *libc.TLS, pData uintptr, zObj uintptr, zExtra uintptr) { (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_NOMEM } else if *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) { // A error message has already been generated. Do not overwrite it - } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & INITFLAG_AlterTable) != 0 { + } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & U32(INITFLAG_AlterTable)) != 0 { *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3DbStrDup(tls, db, zExtra) (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_ERROR - } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_WriteSchema) != 0 { + } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_WriteSchema)) != 0 { (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128375) } else { var z uintptr @@ -124425,7 +124425,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr _ = NotUsed _ = argc - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_EncodingFixed) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_EncodingFixed)) (*InitData)(unsafe.Pointer(pData)).FnInitRow++ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) @@ -124529,7 +124529,7 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl var xAuth Sqlite3_xauth var zSql uintptr openedTransaction = 0 - mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) + mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1) @@ -124626,7 +124626,7 @@ __6: goto __7 __7: ; - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __8 } libc.X__builtin___memset_chk(tls, bp+104 /* &meta[0] */, 0, uint64(unsafe.Sizeof([5]int32{})), libc.X__builtin_object_size(tls, bp+104 /* &meta[0] */, 0)) @@ -124641,7 +124641,7 @@ __8: if !(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 4*4)) != 0) { goto __9 } // text encoding - if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0))) { + if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0))) { goto __10 } // If opening the main database, set ENC(db). @@ -124649,7 +124649,7 @@ __8: if !(int32(encoding) == 0) { goto __12 } - encoding = SQLITE_UTF8 + encoding = U8(SQLITE_UTF8) __12: ; Xsqlite3SetTextEncoding(tls, db, encoding) @@ -124713,7 +124713,7 @@ __17: if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 1*4)) >= 4)) { goto __18 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyFileFmt)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyFileFmt))) __18: ; @@ -124753,7 +124753,7 @@ __20: Xsqlite3ResetAllSchemasOfConnection(tls, db) __21: ; - if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoSchemaError) != 0)) { + if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoSchemaError)) != 0)) { goto __22 } // Black magic: If the SQLITE_NoSchemaError flag is set, then consider @@ -124807,7 +124807,7 @@ __24: func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128755:20: */ var i int32 var rc int32 - var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != 0)) + var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != 0)) ((*Sqlite3)(unsafe.Pointer(db)).Fenc) = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc @@ -124846,7 +124846,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1287 (*Parse)(unsafe.Pointer(pParse)).Frc = rc (*Parse)(unsafe.Pointer(pParse)).FnErr++ } else if (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache != 0 { - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaKnownOk) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaKnownOk)) } } return rc @@ -124991,7 +124991,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF // For a long-term use prepared statement avoid the use of // lookaside memory. - if !((prepFlags & SQLITE_PREPARE_PERSISTENT) != 0) { + if !((prepFlags & U32(SQLITE_PREPARE_PERSISTENT)) != 0) { goto __1 } (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FdisableLookaside++ @@ -124999,7 +124999,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) __1: ; - (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & SQLITE_PREPARE_NO_VTAB) != U32(0)))) + (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & U32(SQLITE_PREPARE_NO_VTAB)) != U32(0)))) // Check to verify that it is possible to get a read lock on all // database schemas. The inability to get a read lock indicates that @@ -125253,7 +125253,7 @@ func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, // parameter. // // Proof in that the 5th parameter to sqlite3LockAndPrepare is 0 - rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, uintptr(0), + rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), uintptr(0), ppStmt, pzTail) return rc @@ -125269,7 +125269,7 @@ 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, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), uintptr(0), ppStmt, pzTail) return rc @@ -125299,7 +125299,7 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre nBytes = sz } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, SQLITE_UTF16LE) + zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, uint8(SQLITE_UTF16LE)) if zSql8 != 0 { rc = sqlite3LockAndPrepare(tls, db, zSql8, -1, prepFlags, uintptr(0), ppStmt, bp /* &zTail8 */) } @@ -125333,7 +125333,7 @@ func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, p func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129268:16: */ var rc int32 - rc = sqlite3Prepare16(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, ppStmt, pzTail) + rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail) // VERIFY: F13021 return rc } @@ -125341,7 +125341,7 @@ func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129280:16: */ var rc int32 rc = sqlite3Prepare16(tls, db, zSql, nBytes, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), ppStmt, pzTail) // VERIFY: F13021 return rc @@ -125507,7 +125507,7 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0))) } (*Select)(unsafe.Pointer(pNew)).FpEList = pEList - (*Select)(unsafe.Pointer(pNew)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(pNew)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(pNew)).FselFlags = selFlags (*Select)(unsafe.Pointer(pNew)).FiLimit = 0 (*Select)(unsafe.Pointer(pNew)).FiOffset = 0 @@ -125628,12 +125628,12 @@ var aKeyword = [7]struct { FnChar U8 Fcode U8 }{ - /* natural */ {FnChar: U8(7), Fcode: JT_NATURAL}, + /* natural */ {FnChar: U8(7), Fcode: U8(JT_NATURAL)}, /* left */ {Fi: U8(6), FnChar: U8(4), Fcode: (U8(JT_LEFT | JT_OUTER))}, - /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: JT_OUTER}, + /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: U8(JT_OUTER)}, /* right */ {Fi: U8(14), FnChar: U8(5), Fcode: (U8(JT_RIGHT | JT_OUTER))}, /* full */ {Fi: U8(19), FnChar: U8(4), Fcode: (U8((JT_LEFT | JT_RIGHT) | JT_OUTER))}, - /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: JT_INNER}, + /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: U8(JT_INNER)}, /* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: (U8(JT_INNER | JT_CROSS))}, } /* sqlite3.c:129513:5 */ @@ -125712,7 +125712,7 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pE1, pE2) if (pEq != 0) && (isOuterJoin != 0) { - *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = I16((*Expr)(unsafe.Pointer(pE2)).FiTable) } @@ -125745,7 +125745,7 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol // the output, which is incorrect. func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129680:21: */ for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(p)).FiRightJoinTable = I16(iTable) if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { @@ -125766,7 +125766,7 @@ func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c: // This happens when a LEFT JOIN is simplified into an ordinary JOIN. func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703:13: */ for p != 0 { - if (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FromJoin)) != U32(0)) && + if (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FromJoin))) != U32(0)) && ((iTable < 0) || (int32((*Expr)(unsafe.Pointer(p)).FiRightJoinTable) == iTable)) { *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_FromJoin))) } @@ -126099,7 +126099,7 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iTab, addrRepeat, iMem, N) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, iMem, N, r1) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iTab, r1, iMem, N) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, r1) } @@ -126179,7 +126179,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var ecelFlags U8 // "ecel" is an abbreviation of "ExprCodeExprList" var pEList uintptr if ((eDest == SRT_Mem) || (eDest == SRT_Output)) || (eDest == SRT_Coroutine) { - ecelFlags = SQLITE_ECEL_DUP + ecelFlags = U8(SQLITE_ECEL_DUP) } else { ecelFlags = U8(0) } @@ -126245,7 +126245,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo // row is all NULLs. Xsqlite3VdbeChangeToNoop(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) pOp = Xsqlite3VdbeGetOp(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 1 (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = regPrev pOp = uintptr(0) // Ensure pOp is not used after sqlite3VdbeAddOp() @@ -126261,7 +126261,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo } Xsqlite3VdbeChangeP4(tls, v, -1, pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regResult, regPrev, (nResultCol - 1)) @@ -126347,7 +126347,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var r2 int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) } Xsqlite3ReleaseTempRange(tls, pParse, r1, (nPrefixReg + 1)) @@ -126480,7 +126480,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r3) if eDest == SRT_DistQueue { Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (iParm + 1), r3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } for i = 0; i < nKey; i++ { Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, @@ -126741,7 +126741,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, (nKey + bSeq), regRow) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, regRow, regRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) break } @@ -127036,8 +127036,8 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1) - fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_FullColNames) != uint64(0))) - srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ShortColNames) != uint64(0)) || (fullName != 0))) + fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_FullColNames)) != uint64(0))) + srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ShortColNames)) != uint64(0)) || (fullName != 0))) Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -127303,8 +127303,8 @@ func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a var savedFlags U64 savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_FullColNames)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_ShortColNames) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_FullColNames))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_ShortColNames)) Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0)) (*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -127395,7 +127395,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 Xsqlite3VdbeGoto(tls, v, iBreak) } else if (*(*int32)(unsafe.Pointer(bp /* n */)) >= 0) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))))) { (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_FixedLimit) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_FixedLimit)) } } else { Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit) @@ -127457,7 +127457,7 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra var pTerm uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr var pColl uintptr - if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pTerm) } else { pColl = multiSelectCollSeq(tls, pParse, p, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1)) @@ -127634,7 +127634,7 @@ __10: goto __11 } *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) __11: ; @@ -127685,7 +127685,7 @@ __15: // Execute the recursive SELECT taking the single row in Current as // the value for the recursive-table. Store the results in the Queue. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != 0) { goto __16 } Xsqlite3ErrorMsg(tls, pParse, ts+21058 /* "recursive aggreg..." */, 0) @@ -127864,12 +127864,12 @@ __1: } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) - (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FeDest = SRT_Table + (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FeDest = U8(SRT_Table) __2: ; // Special handling for a compound-select that originates as a VALUES clause. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) != 0) { goto __3 } rc = multiSelectValues(tls, pParse, p, bp+32 /* &dest */) @@ -127886,7 +127886,7 @@ __3: // Make sure all SELECTs in the statement have the same number of elements // in their result sets. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Recursive) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != 0) { goto __5 } generateWithRecursiveQuery(tls, pParse, p, bp+32 /* &dest */) @@ -127995,7 +127995,7 @@ __20: addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, unionTab, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr1 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) __21: ; @@ -128015,11 +128015,11 @@ __22: if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_EXCEPT) { goto __23 } - op = SRT_Except + op = U8(SRT_Except) goto __24 __23: ; - op = SRT_Union + op = U8(SRT_Union) __24: ; (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) @@ -128076,7 +128076,7 @@ __14: addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab1, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr2 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) // Code the SELECTs to our left into temporary table "tab1". Xsqlite3SelectDestInit(tls, bp+120 /* &intersectdest */, SRT_Union, tab1) @@ -128165,7 +128165,7 @@ __31: // SELECT statements to the left always skip this part. The right-most // SELECT might also skip this part if it has no ORDER BY clause and // no temp tables are required. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UsesEphemeral) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UsesEphemeral)) != 0) { goto __32 } // Number of columns in result set @@ -128255,7 +128255,7 @@ func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(8) defer tls.Free(8) - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Values) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Values)) != 0 { Xsqlite3ErrorMsg(tls, pParse, ts+21278 /* "all VALUES must ..." */, 0) } else { Xsqlite3ErrorMsg(tls, pParse, @@ -128317,7 +128317,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst, r1) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) Xsqlite3ReleaseTempReg(tls, pParse, r1) break @@ -128568,7 +128568,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if pNew == uintptr(0) { return SQLITE_NOMEM } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = i (*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew)) if pOrderBy != 0 { @@ -128780,7 +128780,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) Xsqlite3VdbeAddOp4(tls, v, OP_Permutation, 0, 0, 0, aPermute, -15) Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(bp+8 /* &destA */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+48 /* &destB */)).FiSdst, nOrderBy, pKeyMerge, -9) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_PERMUTE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_PERMUTE)) Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrAltB, addrAeqB, addrAgtB) // Jump to the this point in order to terminate the query. @@ -128839,15 +128839,15 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite if pExpr == uintptr(0) { return uintptr(0) } - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) { (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = I16((*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable) } if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else { var pNew uintptr var pCopy uintptr = (*ExprList_item)(unsafe.Pointer(((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 /* &.a */) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FpExpr @@ -128859,20 +128859,20 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb if ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) && (int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN) { libc.X__builtin___memset_chk(tls, bp /* &ifNullRow */, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, bp /* &ifNullRow */, 0)) - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = TK_IF_NULL_ROW + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = U8(TK_IF_NULL_ROW) (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FpLeft = pCopy (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = U32(EP_Skip) pCopy = bp /* &ifNullRow */ } pNew = Xsqlite3ExprDup(tls, db, pCopy, 0) if (pNew != 0) && ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) } - if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { (*Expr)(unsafe.Pointer(pNew)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_FromJoin)) } Xsqlite3ExprDelete(tls, db, pExpr) pExpr = pNew @@ -128900,12 +128900,12 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite } (*Expr)(unsafe.Pointer(pExpr)).FpLeft = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) (*Expr)(unsafe.Pointer(pExpr)).FpRight = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpRight) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)), 1) } else { substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) (*Window)(unsafe.Pointer(pWin)).FpFilter = substExpr(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpFilter) substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpPartition) @@ -129206,13 +129206,13 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0) { return 0 } // Restriction (14) - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Compound) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Compound)) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { return 0 // Restriction (15) } if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc == 0 { return 0 } // Restriction (7) - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Distinct)) != 0 { return 0 } // Restriction (4) if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1) || (isAgg != 0)) { @@ -129227,10 +129227,10 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Select)(unsafe.Pointer(p)).FpWhere != 0) { return 0 } // Restriction (19) - if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 // Restriction (21) } - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (SF_Recursive)) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (U32(SF_Recursive))) != 0 { return 0 // Restrictions (22) } @@ -129257,7 +129257,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((((*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1) || // (3a) (isAgg != 0)) || // (3b) ((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c) - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 } } @@ -129270,7 +129270,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 { return 0 // Restriction (20) } - if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0))) || ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1) { + if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0))) || ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1) { return 0 // (17d1), (17d2), or (17d3) } for pSub1 = pSub; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior { @@ -129354,7 +129354,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg (*Select)(unsafe.Pointer(p)).FpLimit = pLimit (*Select)(unsafe.Pointer(p)).FpOrderBy = pOrderBy (*Select)(unsafe.Pointer(p)).FpSrc = pSrc - (*Select)(unsafe.Pointer(p)).Fop = TK_ALL + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_ALL) if pNew == uintptr(0) { (*Select)(unsafe.Pointer(p)).FpPrior = pPrior } else { @@ -129489,7 +129489,7 @@ __1: // // We look at every expression in the outer query and every place we see // "a" we substitute "x*3" and every place we see "b" we substitute "y+10". - if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & SF_NoopOrderBy) == U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & U32(SF_NoopOrderBy)) == U32(0)) { // At this point, any non-zero iOrderByCol values indicate that the // ORDER BY column expression is identical to the iOrderByCol'th // expression returned by SELECT statement pSub. Since these values @@ -129533,7 +129533,7 @@ __1: // The flattened query is a compound if either the inner or the // outer query is a compound. - *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Compound) + *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound)) // restriction (17b) // SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; @@ -129583,7 +129583,7 @@ type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:133518:13: */ var i int32 - if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (EP_FixedCol)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (U32(EP_FixedCol))) != U32(0) { return } if int32(Xsqlite3ExprAffinity(tls, pValue)) != 0 { @@ -129625,7 +129625,7 @@ func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3 if pExpr == uintptr(0) { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { @@ -129676,7 +129676,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // A match is found. Add the EP_FixedCol property (*WhereConst)(unsafe.Pointer(pConst)).FnChng++ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FixedCol) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FixedCol)) (*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(((i*2)+1))*8)), 0) break @@ -129814,7 +129814,7 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin if pWhere == uintptr(0) { return 0 } - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Recursive) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Recursive)) != 0 { return 0 } // restriction (2) @@ -129833,11 +129833,11 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft } if (isLeftJoin != 0) && - (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0))) == 0) || + (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0))) == 0) || (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor)) { return 0 // restriction (4) } - if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor) { + if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor) { return 0 // restriction (5) } if Xsqlite3ExprIsTableConstant(tls, pWhere, iCursor) != 0 { @@ -129853,7 +129853,7 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin (*SubstContext)(unsafe.Pointer(bp /* &x */)).FisLeftJoin = 0 (*SubstContext)(unsafe.Pointer(bp /* &x */)).FpEList = (*Select)(unsafe.Pointer(pSubq)).FpEList pNew = substExpr(tls, bp /* &x */, pNew) - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Aggregate) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Aggregate)) != 0 { (*Select)(unsafe.Pointer(pSubq)).FpHaving = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpHaving, pNew) } else { (*Select)(unsafe.Pointer(pSubq)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpWhere, pNew) @@ -129885,18 +129885,18 @@ func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 var pOrderBy uintptr var sortFlags U8 = U8(0) - if ((pEList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (EP_WinFunc)) != U32(0)) { + if ((pEList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (U32(EP_WinFunc))) != U32(0)) { return U8(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8 /* &.u */)) if Xsqlite3StrICmp(tls, zFunc, ts+17381 /* "min" */) == 0 { eRet = WHERE_ORDERBY_MIN if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */))).FpExpr) != 0 { - sortFlags = KEYINFO_ORDER_BIGNULL + sortFlags = U8(KEYINFO_ORDER_BIGNULL) } } else if Xsqlite3StrICmp(tls, zFunc, ts+17385 /* "max" */) == 0 { eRet = WHERE_ORDERBY_MAX - sortFlags = KEYINFO_ORDER_DESC + sortFlags = U8(KEYINFO_ORDER_DESC) } else { return U8(eRet) } @@ -129937,7 +129937,7 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 0 { return uintptr(0) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & SQLITE_FUNC_COUNT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_COUNT)) == U32(0) { return uintptr(0) } if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Distinct | EP_WinFunc))) != U32(0) { @@ -130025,7 +130025,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) return WRC_Continue } for i = ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1); i >= 0; i-- { - if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & U32(EP_Collate)) != 0 { break } } @@ -130049,7 +130049,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) *(*Select)(unsafe.Pointer(pNew)) = *(*Select)(unsafe.Pointer(p)) (*Select)(unsafe.Pointer(p)).FpSrc = pNewSrc (*Select)(unsafe.Pointer(p)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3Expr(tls, db, TK_ASTERISK, uintptr(0))) - (*Select)(unsafe.Pointer(p)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpHaving = uintptr(0) @@ -130060,7 +130060,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Compound))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Converted) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Converted)) (*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*Select)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -130203,7 +130203,7 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20) (*Table)(unsafe.Pointer(pTab)).FnTabRef++ - *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (SF_Recursive) + *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (U32(SF_Recursive)) } } } @@ -130244,7 +130244,7 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite Xsqlite3ColumnsFromExprList(tls, pParse, pEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) if bMayRecursive != 0 { - if ((*Select)(unsafe.Pointer(pSel)).FselFlags & SF_Recursive) != 0 { + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 { (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 21728 /* "multiple recursi..." */ } else { (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 21762 /* "recursive refere..." */ @@ -130303,7 +130303,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) (*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return SQLITE_ERROR @@ -130351,7 +130351,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite var selFlags U16 = U16((*Select)(unsafe.Pointer(p)).FselFlags) var elistFlags U32 = U32(0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Expanded) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return WRC_Abort } @@ -130425,14 +130425,14 @@ __1: return WRC_Abort } - if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableView) == uint64(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableView)) == uint64(0)) { Xsqlite3ErrorMsg(tls, pParse, ts+21851, /* "access to view \"..." */ libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) } if ((((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.fromDDL */)) & 0x40 >> 6))) != 0)) && ((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0))) && - (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TrustedSchema) != uint64(0)))) { + (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TrustedSchema)) != uint64(0)))) { Xsqlite3ErrorMsg(tls, pParse, ts+21882, /* "unsafe use of vi..." */ libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) } @@ -130539,7 +130539,7 @@ __3: if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto __6 } - if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_NestedFrom) == U32(0)) { + if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_NestedFrom)) == U32(0)) { pSub = uintptr(0) if (zTName != 0) && (Xsqlite3StrICmp(tls, zTName, zTabName) != 0) { goto __5 @@ -130566,7 +130566,7 @@ __3: // If a column is marked as 'hidden', omit it from the expanded // result-set list unless the SELECT has the SF_IncludeHidden // bit set. - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_IncludeHidden) == U32(0)) && + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_IncludeHidden)) == U32(0)) && ((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0) { continue } @@ -130606,7 +130606,7 @@ __3: pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pExpr) Xsqlite3TokenInit(tls, bp+72 /* &sColname */, zColname) Xsqlite3ExprListSetName(tls, pParse, pNew, bp+72 /* &sColname */, 0) - if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_NestedFrom) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { + if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_NestedFrom)) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { var pX uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pX)).FzEName) if pSub != 0 { @@ -130617,7 +130617,7 @@ __3: libc.VaList(bp+40, zSchemaName, zTabName, zColname)) } - libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, ENAME_TAB, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, uint32(ENAME_TAB), 0, 0x3) } Xsqlite3DbFree(tls, db, zToFree) } @@ -130649,7 +130649,7 @@ __3: return WRC_Abort } if (elistFlags & (U32(EP_HasFunc | EP_Subquery))) != U32(0) { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_ComplexResult) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_ComplexResult)) } } return WRC_Continue @@ -130710,10 +130710,10 @@ func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* s var pTabList uintptr var pFrom uintptr - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_HasTypeInfo) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_HasTypeInfo)) pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse pTabList = (*Select)(unsafe.Pointer(p)).FpSrc i = 0 @@ -130725,7 +130725,7 @@ __1: { var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0) { // A sub-query in the FROM clause of a SELECT var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect if pSel != 0 { @@ -130733,7 +130733,7 @@ __1: pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior } Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTab, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } @@ -130786,7 +130786,7 @@ func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintp if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } sqlite3SelectExpand(tls, pParse, p) @@ -130910,10 +130910,10 @@ __1: var regAgg int32 var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32 /* &.x */)) - if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 64 /* &.y */)))).FpFilter if (((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) && - (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) && + (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) && (regAcc != 0) { // If regAcc==0, there there exists some min() or max() function // without a FILTER clause that will ensure the magnet registers @@ -130936,7 +130936,7 @@ __1: if pList != 0 { nArg = (*ExprList)(unsafe.Pointer(pList)).FnExpr regAgg = Xsqlite3GetTempRange(tls, pParse, nArg) - Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, SQLITE_ECEL_DUP) + Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, uint8(SQLITE_ECEL_DUP)) } else { nArg = 0 regAgg = 0 @@ -130949,7 +130949,7 @@ __1: // Also an error codeDistinct(tls, pParse, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, addrNext, 1, regAgg) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr = uintptr(0) var pItem uintptr var j int32 @@ -131035,7 +131035,7 @@ func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintpt defer tls.Free(24) if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 { - var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) + var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+22046, /* "SCAN TABLE %s%s%..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, func() uintptr { @@ -131308,7 +131308,7 @@ __2: Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy) (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_NoopOrderBy) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_NoopOrderBy)) __3: ; Xsqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -131323,7 +131323,7 @@ __4: // 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 // or alias is duplicated within FROM clause (pSrc->a[1..n]). - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UpdateFrom) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UpdateFrom)) != 0) { goto __5 } p0 = ((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) @@ -131373,7 +131373,7 @@ __10: __11: ; pTabList = (*Select)(unsafe.Pointer(p)).FpSrc - isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != U32(0))) + isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != U32(0))) libc.X__builtin___memset_chk(tls, bp+80 /* &sSort */, 0, uint64(unsafe.Sizeof(SortCtx{})), libc.X__builtin_object_size(tls, bp+80 /* &sSort */, 0)) (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy @@ -131430,7 +131430,7 @@ __17: // is not a join. But if the outer query is not a join, then the subquery // will be implemented as a co-routine and there is no advantage to // flattening in that case. - if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Aggregate) != U32(0)) { + if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Aggregate)) != U32(0)) { goto __18 } goto __13 @@ -131456,7 +131456,7 @@ __18: // SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10); if !(((((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0)) && (i == 0)) && - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_ComplexResult) != U32(0))) && + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_ComplexResult)) != U32(0))) && (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) || ((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { goto __19 @@ -131707,7 +131707,7 @@ __30: pWhere = (*Select)(unsafe.Pointer(p)).FpWhere pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy pHaving = (*Select)(unsafe.Pointer(p)).FpHaving - (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)))) + (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)))) // If the query is DISTINCT with an ORDER BY but is not an aggregate, and // if the select-list is the same as the ORDER BY list, then this query @@ -131723,14 +131723,14 @@ __30: // used for both the ORDER BY and DISTINCT processing. As originally // 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 !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == SF_Distinct) && + if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == U32(SF_Distinct)) && (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) && ((*Select)(unsafe.Pointer(p)).FpWin == uintptr(0))) { goto __43 } *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) pGroupBy = libc.AssignPtrUintptr(p+56 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0)) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Aggregate) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Aggregate)) // 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 @@ -131770,7 +131770,7 @@ __46: // Set the limiter. iEnd = Xsqlite3VdbeMakeLabel(tls, pParse) - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit) == U32(0)) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)) == U32(0)) { goto __47 } (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320) // 4 billion rows @@ -131780,13 +131780,13 @@ __47: if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex >= 0)) { goto __48 } - Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex, OP_SorterOpen) + Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex, uint8(OP_SorterOpen)) *(*U8)(unsafe.Pointer(bp + 80 /* &sSort */ + 36 /* &.sortFlags */)) |= U8((SORTFLAG_UseSorter)) __48: ; // Open an ephemeral index to use for the distinct set. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != 0) { goto __49 } (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) @@ -131794,11 +131794,11 @@ __48: (*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FtabTnct, 0, 0, Xsqlite3KeyInfoFromExprList(tls, pParse, (*Select)(unsafe.Pointer(p)).FpEList, 0, 0), -9) - Xsqlite3VdbeChangeP5(tls, v, BTREE_UNORDERED) - (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_UNORDERED + Xsqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED)) + (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_UNORDERED) goto __50 __49: - (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_NOOP + (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_NOOP) __50: ; @@ -131808,11 +131808,11 @@ __50: // No aggregate functions and no GROUP BY clause wctrlFlags = (U16((func() uint32 { if (*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0 { - return WHERE_WANT_DISTINCT + return uint32(WHERE_WANT_DISTINCT) } return uint32(0) }()) | - ((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit))) + ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)))) pWin = (*Select)(unsafe.Pointer(p)).FpWin // Main window object (or NULL) if !(pWin != 0) { goto __53 @@ -132045,7 +132045,7 @@ __77: minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr, bp+240 /* &pMinMaxOrderBy */) goto __80 __79: - minMaxFlag = WHERE_ORDERBY_NORMAL + minMaxFlag = U8(WHERE_ORDERBY_NORMAL) __80: ; i = 0 @@ -132058,7 +132058,7 @@ __81: *(*int32)(unsafe.Pointer(bp + 184 /* &sNC */ + 40 /* &.ncFlags */)) |= (NC_InAggFunc) Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __84 } Xsqlite3ExprAnalyzeAggregates(tls, bp+184 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) @@ -132143,7 +132143,7 @@ __89: explainTempTable(tls, pParse, func() uintptr { - if ((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) == U32(0)) { + if ((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) == U32(0)) { return ts + 22299 /* "DISTINCT" */ } return ts + 22308 /* "GROUP BY" */ @@ -132375,7 +132375,7 @@ __86: // // In practice the KeyInfo structure will not be used. It is only // passed to keep OP_OpenRead happy. - if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __110 } pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1) @@ -132447,13 +132447,13 @@ __119: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { goto __121 } - if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __122 } goto __120 __122: ; - if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { + if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { goto __123 } goto __121 @@ -133191,9 +133191,9 @@ __27: (*Trigger)(unsafe.Pointer(pTrigger)).Fop = U8(op) (*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm = func() uint8 { if tr_tm == TK_BEFORE { - return TRIGGER_BEFORE + return uint8(TRIGGER_BEFORE) } - return TRIGGER_AFTER + return uint8(TRIGGER_AFTER) }() if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { goto __28 @@ -133376,9 +133376,9 @@ func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStar Xsqlite3SelectDelete(tls, db, pSelect) return uintptr(0) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = U8(TK_SELECT) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = triggerSpanDup(tls, db, zStart, zEnd) return pTriggerStep } @@ -133415,7 +133415,7 @@ func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_INSERT, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_INSERT), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect @@ -133447,7 +133447,7 @@ func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_UPDATE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_UPDATE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList @@ -133476,7 +133476,7 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_DELETE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_DELETE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere @@ -133484,7 +133484,7 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr } else { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) } Xsqlite3ExprDelete(tls, db, pWhere) return pTriggerStep @@ -133661,7 +133661,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName } } Xsqlite3DeleteTrigger(tls, db, pTrigger) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } } @@ -133694,7 +133694,7 @@ func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32 var pList uintptr = uintptr(0) var p uintptr - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableTrigger) != uint64(0) { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableTrigger)) != uint64(0) { pList = Xsqlite3TriggerList(tls, pParse, pTab) } @@ -134033,7 +134033,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab // 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 { - var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_RecTriggers)))) + var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_RecTriggers))))) Xsqlite3VdbeAddOp4(tls, v, OP_Program, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1), (*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4) @@ -134515,7 +134515,7 @@ __4: // allocate enough space, just in case. iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) iIdxCur = (iDataCur + 1) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -134721,7 +134721,7 @@ __17: // is non-negative, so the value of aXRef[] for generated columns can be // set to any non-negative number. We use 99999 so that the value is // obvious when looking at aXRef[] in a symbolic debugger. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __34 } @@ -134953,7 +134953,7 @@ __64: __65: ; - if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __66 } Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regRowSet, regOldRowid) @@ -135095,7 +135095,7 @@ __80: __77: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __83 } // Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF @@ -135337,7 +135337,7 @@ __118: k = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld) if !(((oldmask == 0xffffffff) || ((i < 32) && ((oldmask & (uint32((uint32(1))) << (i))) != U32(0)))) || - ((colFlags & COLFLAG_PRIMKEY) != U32(0))) { + ((colFlags & U32(COLFLAG_PRIMKEY)) != U32(0))) { goto __121 } @@ -135451,7 +135451,7 @@ __125: goto __126 __126: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __138 } @@ -135529,7 +135529,7 @@ __144: goto __145 __145: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __150 } @@ -135613,7 +135613,7 @@ __156: goto __157 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) __157: ; if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) { @@ -135803,7 +135803,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Start scanning the virtual table - pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), WHERE_ONEPASS_DESIRED, 0) + pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uint16(WHERE_ONEPASS_DESIRED), 0) if pWInfo == uintptr(0) { return } @@ -135815,10 +135815,10 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, ((regArg + 2) + i)) } else { Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, ((regArg + 2) + i)) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_NOCHNG) // For sqlite3_vtab_nochange() + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_NOCHNG)) // For sqlite3_vtab_nochange() } } - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg) if pRowid != 0 { Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1)) @@ -135873,7 +135873,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, nArg, regArg, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) @@ -135988,7 +135988,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget iCursor = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && + if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) && (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) && (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) { @@ -136003,9 +136003,9 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr // will populate the specific collation and column number values // prior to comparing against the conflict-target expression. libc.X__builtin___memset_chk(tls, bp+56 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{})), libc.X__builtin_object_size(tls, bp+56 /* &sCol[0] */, 0)) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).Fop = TK_COLLATE + (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).Fop = U8(TK_COLLATE) (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = (bp + 56 /* &sCol */ + 1*72) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).FiTable = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor // Check for matches against other indexes @@ -136087,7 +136087,7 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab Xsqlite3VdbeNoopComment(tls, v, ts+23336 /* "Begin DO UPDATE ..." */, 0) iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur if (pIdx != 0) && (iCur != iDataCur) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var regRowid int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iCur, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iDataCur, 0, regRowid) @@ -136417,7 +136417,7 @@ __6: goto end_of_vacuum __8: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_VacuumInto) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_VacuumInto)) __7: ; nRes = Xsqlite3BtreeGetRequestedReserve(tls, pMain) @@ -136630,11 +136630,11 @@ __26: } var aCopy = [10]uint8{ - BTREE_SCHEMA_VERSION, uint8(1), // Add one to the old schema cookie - BTREE_DEFAULT_CACHE_SIZE, uint8(0), // Preserve the default page cache size - BTREE_TEXT_ENCODING, uint8(0), // Preserve the text encoding - BTREE_USER_VERSION, uint8(0), // Preserve the user version - BTREE_APPLICATION_ID, uint8(0), // Preserve the application id + uint8(BTREE_SCHEMA_VERSION), uint8(1), // Add one to the old schema cookie + uint8(BTREE_DEFAULT_CACHE_SIZE), uint8(0), // Preserve the default page cache size + uint8(BTREE_TEXT_ENCODING), uint8(0), // Preserve the text encoding + uint8(BTREE_USER_VERSION), uint8(0), // Preserve the user version + uint8(BTREE_APPLICATION_ID), uint8(0), // Preserve the application id } /* sqlite3.c:139504:32 */ // Construct and install a Module object for a virtual table. When this @@ -137101,7 +137101,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } (*VTable)(unsafe.Pointer(pVTable)).Fdb = db (*VTable)(unsafe.Pointer(pVTable)).FpMod = pMod - (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = SQLITE_VTABRISK_Normal + (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Normal) iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + 1*8)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName @@ -137178,7 +137178,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, *(*int8)(unsafe.Pointer(zType + uintptr((i - 1)))) = int8(0) } *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32 + 28 /* &.colFlags */)) |= U16((COLFLAG_HIDDEN)) - oooHidden = TF_OOOHidden + oooHidden = U16(TF_OOOHidden) } else { *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(oooHidden)) } @@ -137323,7 +137323,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab libc.X__builtin___memset_chk(tls, bp+8 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})), libc.X__builtin_object_size(tls, bp+8 /* &sParse */, 0)) - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_DECLARE_VTAB + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_DECLARE_VTAB) (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).Fdb = db (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FnQueryLoop = U32(1) if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+432 /* &zErr */)) && @@ -137340,7 +137340,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 (*Table)(unsafe.Pointer(pNew)).FnCol = int16(0) (*Table)(unsafe.Pointer(pNew)).FaCol = uintptr(0) - if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & TF_WithoutRowid) == U32(0)) && + if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0))) && (int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1) { // WITHOUT ROWID virtual tables must either be read-only (xUpdate==0) @@ -137366,7 +137366,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */))) rc = SQLITE_ERROR } - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_NORMAL) if (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe != 0 { Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe) @@ -137650,7 +137650,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg libc.X__builtin___memcpy_chk(tls, (pNew + 1*72), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1)), libc.X__builtin_object_size(tls, (pNew+1*72), 0)) (*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp /* xSFunc */)) (*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 8 /* pArg */)) - *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (SQLITE_FUNC_EPHEM) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (U32(SQLITE_FUNC_EPHEM)) return pNew } @@ -137746,7 +137746,7 @@ func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { // Mark the table as Ephemeral prior to deleting it, so that the // sqlite3DeleteTable() routine will know that it is not stored in // the schema. - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) Xsqlite3DeleteTable(tls, db, pTab) (*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) } @@ -137763,7 +137763,7 @@ func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1 } var aMap1 = [5]uint8{ - SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE, + uint8(SQLITE_ROLLBACK), uint8(SQLITE_ABORT), uint8(SQLITE_FAIL), uint8(SQLITE_IGNORE), uint8(SQLITE_REPLACE), } /* sqlite3.c:140837:30 */ // Call from within the xCreate() or xConnect() methods to provide @@ -137792,14 +137792,14 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 fallthrough case SQLITE_VTAB_INNOCUOUS: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_Low + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Low) break } fallthrough case SQLITE_VTAB_DIRECTONLY: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_High + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_High) break } @@ -138177,11 +138177,11 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3. } j = i - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+24298 /* ">" */) i = 1 } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+24300 /* "<" */) } Xsqlite3_str_append(tls, pStr, ts+7851 /* ")" */, 1) @@ -138219,12 +138219,12 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if ((flags & WHERE_MULTI_OR) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { + if ((flags & U32(WHERE_MULTI_OR)) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { return 0 } isSearch = (libc.Bool32((((flags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) != U32(0)) || - (((flags & WHERE_VIRTUALTABLE) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || + (((flags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || ((int32(wctrlFlags) & (WHERE_ORDERBY_MIN | WHERE_ORDERBY_MAX)) != 0))) Xsqlite3StrAccumInit(tls, bp+56 /* &str */, db, bp+88 /* &zBuf[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) @@ -138249,15 +138249,15 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { zFmt = ts + 24344 /* "PRIMARY KEY" */ } - } else if (flags & WHERE_PARTIALIDX) != 0 { + } else if (flags & U32(WHERE_PARTIALIDX)) != 0 { zFmt = ts + 24356 /* "AUTOMATIC PARTIA..." */ - } else if (flags & WHERE_AUTO_INDEX) != 0 { + } else if (flags & U32(WHERE_AUTO_INDEX)) != 0 { zFmt = ts + 24389 /* "AUTOMATIC COVERI..." */ - } else if (flags & WHERE_IDX_ONLY) != 0 { + } else if (flags & U32(WHERE_IDX_ONLY)) != 0 { zFmt = ts + 24414 /* "COVERING INDEX %..." */ } else { zFmt = ts + 24432 /* "INDEX %s" */ @@ -138267,13 +138267,13 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr Xsqlite3_str_appendf(tls, bp+56 /* &str */, zFmt, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName)) explainIndexRange(tls, bp+56 /* &str */, pLoop) } - } else if ((flags & WHERE_IPK) != U32(0)) && ((flags & WHERE_CONSTRAINT) != U32(0)) { + } else if ((flags & U32(WHERE_IPK)) != U32(0)) && ((flags & U32(WHERE_CONSTRAINT)) != U32(0)) { var zRangeOp uintptr if (flags & (U32(WHERE_COLUMN_EQ | WHERE_COLUMN_IN))) != 0 { zRangeOp = ts + 24449 /* "=" */ - } else if (flags & WHERE_BOTH_LIMIT) == WHERE_BOTH_LIMIT { + } else if (flags & U32(WHERE_BOTH_LIMIT)) == U32(WHERE_BOTH_LIMIT) { zRangeOp = ts + 24451 /* ">? AND rowid<" */ - } else if (flags & WHERE_BTM_LIMIT) != 0 { + } else if (flags & U32(WHERE_BTM_LIMIT)) != 0 { zRangeOp = ts + 24298 /* ">" */ } else { @@ -138281,7 +138281,7 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } Xsqlite3_str_appendf(tls, bp+56, /* &str */ ts+24465 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp)) - } else if (flags & WHERE_VIRTUALTABLE) != U32(0) { + } else if (flags & U32(WHERE_VIRTUALTABLE)) != U32(0) { Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+24503, /* " VIRTUAL TABLE I..." */ libc.VaList(bp+40, *(*int32)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)), *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)))) } @@ -138337,7 +138337,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14 var nLoop int32 = 0 for (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_CODED) == 0) && - (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (((*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady & (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll) == uint64(0)) { if (nLoop != 0) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKE) != 0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_LIKECOND)) @@ -138405,7 +138405,7 @@ func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i) if (int32(Xsqlite3CompareAffinity(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB) || (Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i)))) != 0) { - *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = int8(SQLITE_AFF_BLOB) } } } @@ -138530,7 +138530,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp var nEq int32 = 0 var aiMap uintptr = uintptr(0) - if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0))) && (*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)))).FaSortOrder + uintptr(iEq))) != 0) { @@ -138553,15 +138553,15 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp } *(*int32)(unsafe.Pointer(bp /* iTab */)) = 0 - if (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), uintptr(0), bp /* &iTab */) + if (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp /* &iTab */) } else { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pX = removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint64(unsafe.Sizeof(int32(0))) * uint64(nEq)))) - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), aiMap, bp /* &iTab */) + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp /* &iTab */) (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiTable = *(*int32)(unsafe.Pointer(bp /* iTab */)) } Xsqlite3ExprDelete(tls, db, pX) @@ -138579,7 +138579,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp return OP_Rewind }(), *(*int32)(unsafe.Pointer(bp /* iTab */)), 0) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_ABLE) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_ABLE)) if *(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) == 0 { (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = Xsqlite3VdbeMakeLabel(tls, pParse) } @@ -138611,19 +138611,19 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp *(*int32)(unsafe.Pointer(pIn /* &.iCur */)) = *(*int32)(unsafe.Pointer(bp /* iTab */)) *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() if iEq > 0 { *(*int32)(unsafe.Pointer(pIn + 8 /* &.iBase */)) = (iReg - i) *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = i - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_EARLYOUT) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_EARLYOUT)) } else { *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = 0 } } else { - *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = OP_Noop + *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = U8(OP_Noop) } pIn += 20 } @@ -138755,13 +138755,13 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } } if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 { - if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & U32(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 // sqlite3FindInIndex() routine has already ensured that the // affinity of the comparison has been applied to the value. if zAff != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ISNULL) == 0 { @@ -138772,10 +138772,10 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } if zAff != 0 { if int32(Xsqlite3CompareAffinity(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j))))) == SQLITE_AFF_BLOB { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } if Xsqlite3ExprNeedsNoAffinityChange(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j)))) != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } @@ -138844,7 +138844,7 @@ func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, i func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:142602:13: */ if (p != 0) && (Xsqlite3ExprIsVector(tls, p) != 0) { - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_xIsSelect)) != 0 { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var iSelect int32 @@ -138892,7 +138892,7 @@ func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FpIdxExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) == 0 { preserveExpr(tls, pX, pExpr) (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3ExprAffinity(tls, pExpr) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCur (*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) @@ -139093,8 +139093,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regYield, addrBrk) Xsqlite3VdbeComment(tls, v, ts+24581 /* "next row of %s" */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FzName)) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Goto - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Goto) + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0) { // Case 1: The table is a virtual-table. Use the VFilter and VNext // to access the data. var iReg int32 // P3 Value for OP_VFilter @@ -139133,9 +139133,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass != 0 { - return OP_Noop + return uint8(OP_Noop) } - return OP_VNext + return uint8(OP_VNext) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v) iIn = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) @@ -139188,7 +139188,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // simpler and safer to simply not reuse the registers. // // sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_IN | WHERE_COLUMN_EQ))) != U32(0)) { // Case 2: We can directly reference a single row using an // equality comparison against the ROWID field. Or @@ -139205,12 +139205,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI addrNxt = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iCur, addrNxt, iRowidReg) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) == uint64(0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED)) } - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_COLUMN_RANGE) != U32(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != U32(0)) { // Case 3: We have an inequality comparison against the ROWID field. var testOp int32 = OP_Noop var start int32 @@ -139220,10 +139220,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI j = 0 pStart = libc.AssignUintptr(&pEnd, uintptr(0)) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } @@ -139243,10 +139243,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // The following constant maps TK_xx codes into corresponding // seek opcodes. It depends on a particular ordering of TK_xx *(*[4]U8)(unsafe.Pointer(bp + 16 /* aMoveOp */)) = [4]U8{ - /* TK_GT */ OP_SeekGT, - /* TK_LE */ OP_SeekLE, - /* TK_LT */ OP_SeekLT, - /* TK_GE */ OP_SeekGE, + /* TK_GT */ U8(OP_SeekGT), + /* TK_LE */ U8(OP_SeekLE), + /* TK_LT */ U8(OP_SeekLT), + /* TK_GE */ U8(OP_SeekGE), } // Make sure the ordering.. // ... of the TK_xx values... @@ -139308,9 +139308,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI start = Xsqlite3VdbeCurrentAddr(tls, v) (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start @@ -139322,7 +139322,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeChangeP5(tls, v, (uint16(SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL))) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0 { var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) // Number of == or IN terms var nBtm U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) // Length of BTM vector var nTop U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) // Length of TOP vector @@ -139350,7 +139350,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Find any inequality constraint terms for the start and end // of the range. j = int32(nEq) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))) { @@ -139361,7 +139361,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Like optimization range constraints always occur in pairs } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))) { @@ -139384,7 +139384,7 @@ func Xsqlite3WhereCodeOneLoopStart(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 (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_TOP_LIMIT | WHERE_BTM_LIMIT))) == U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) != U32(0)) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) != U32(0)) { nExtraReg = 1 bSeekPastNull = U8(1) @@ -139478,7 +139478,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // above has already left the cursor sitting on the correct row, // so no further seeking is needed } else { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_SeekHit, iIdxCur) } if regBignull != 0 { @@ -139563,16 +139563,16 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != 0 { Xsqlite3VdbeAddOp2(tls, v, OP_SeekHit, iIdxCur, 1) } // Seek the table cursor, if required - omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && + omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0))) if omitTable != 0 { // pIdx is a covering index. No need to access the main table. - } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0) { + } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_TABLE) != 0) || (((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_UNIQ_TABLE) != 0) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_SINGLE) || (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) == 0))) { @@ -139633,29 +139633,29 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } // Record the instruction used to terminate the loop. - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) != 0 { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else if bRev != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Prev + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Prev) } else { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Next + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Next) } (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iIdxCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp3 = func() uint8 { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_UNQ_WANTED) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_UNQ_WANTED)) != U32(0) { return uint8(1) } return uint8(0) }() - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) == U32(0) { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) == U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } else { } if omitTable != 0 { pIdx = uintptr(0) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { // Case 5: Two or more separately indexed terms connected by OR // // Example: @@ -139717,7 +139717,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) /* &.wc */) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Return + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Return) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn // Set up a new SrcList in pOrTab containing the table being scanned @@ -139754,7 +139754,7 @@ func Xsqlite3WhereCodeOneLoopStart(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((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DUPLICATES_OK) == 0 { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowset) } else { @@ -139848,7 +139848,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } return ii }() - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, regRowid) jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_RowSetTest, regRowset, 0, regRowid, iSet) @@ -139886,7 +139886,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, regRowset, regRowid, r, nPk) if iSet != 0 { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } } @@ -139925,9 +139925,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // be available. pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 920 /* &.a */))).FpWLoop - if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & WHERE_INDEXED) != U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0)) && ((ii == 0) || (*(*uintptr)(unsafe.Pointer((pSubLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) == pCov))) && - ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { + ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) } else { @@ -139964,14 +139964,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0 { // Tables marked isRecursive have only a single row that is stored in // a pseudo-cursor. No need to Rewind or Next such cursors. - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else { (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = aStep[bRev] (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = (1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt)) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } } @@ -140016,7 +140016,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __2 } @@ -140101,7 +140101,7 @@ __4: goto __5 } if (((int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator) & WO_IN) != 0) && - (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & EP_xIsSelect) != 0)) && + (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0)) && ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 32 /* &.x */)))).FpEList)).FnExpr > 1) { goto __5 } @@ -140161,21 +140161,21 @@ __6: var aStartOp = [8]U8{ U8(0), U8(0), - OP_Rewind, // 2: (!start_constraints && startEq && !bRev) - OP_Last, // 3: (!start_constraints && startEq && bRev) - OP_SeekGT, // 4: (start_constraints && !startEq && !bRev) - OP_SeekLT, // 5: (start_constraints && !startEq && bRev) - OP_SeekGE, // 6: (start_constraints && startEq && !bRev) - OP_SeekLE, // 7: (start_constraints && startEq && bRev) + U8(OP_Rewind), // 2: (!start_constraints && startEq && !bRev) + U8(OP_Last), // 3: (!start_constraints && startEq && bRev) + U8(OP_SeekGT), // 4: (start_constraints && !startEq && !bRev) + U8(OP_SeekLT), // 5: (start_constraints && !startEq && bRev) + U8(OP_SeekGE), // 6: (start_constraints && startEq && !bRev) + U8(OP_SeekLE), // 7: (start_constraints && startEq && bRev) } /* sqlite3.c:143140:21 */ var aEndOp = [4]U8{ - OP_IdxGE, // 0: (end_constraints && !bRev && !endEq) - OP_IdxGT, // 1: (end_constraints && !bRev && endEq) - OP_IdxLE, // 2: (end_constraints && bRev && !endEq) - OP_IdxLT, // 3: (end_constraints && bRev && endEq) -} /* sqlite3.c:143150:21 */ -var aStep = [2]U8{OP_Next, OP_Prev} /* sqlite3.c:143816:21 */ -var aStart = [2]U8{OP_Rewind, OP_Last} /* sqlite3.c:143817:21 */ + U8(OP_IdxGE), // 0: (end_constraints && !bRev && !endEq) + U8(OP_IdxGT), // 1: (end_constraints && !bRev && endEq) + U8(OP_IdxLE), // 2: (end_constraints && bRev && !endEq) + U8(OP_IdxLT), // 3: (end_constraints && bRev && endEq) +} /* sqlite3.c:143150:21 */ +var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)} /* sqlite3.c:143816:21 */ +var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)} /* sqlite3.c:143817:21 */ // Deallocate all memory associated with a WhereOrInfo object. func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144024:13: */ @@ -140228,7 +140228,7 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint64(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint64(unsafe.Sizeof(WhereTerm{})))) } pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*64) - if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Unlikely)) != U32(0)) { + if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Unlikely))) != U32(0)) { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = (LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270)) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1) @@ -140255,7 +140255,7 @@ func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3. if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR) || (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR)) || (Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (EP_Commuted) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (U32(EP_Commuted)) } { var t uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight @@ -140275,11 +140275,11 @@ func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */ var c U16 if op == TK_IN { - c = WO_IN + c = U16(WO_IN) } else if op == TK_ISNULL { - c = WO_ISNULL + c = U16(WO_ISNULL) } else if op == TK_IS { - c = WO_IS + c = U16(WO_IS) } else { c = (U16(int32(WO_EQ) << (op - TK_EQ))) @@ -140323,10 +140323,10 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr) op = int32((*Expr)(unsafe.Pointer(pRight)).Fop) - if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var pReprepare uintptr = (*Parse)(unsafe.Pointer(pParse)).FpReprepare var iCol int32 = int32((*Expr)(unsafe.Pointer(pRight)).FiColumn) - pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, SQLITE_AFF_BLOB) + pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, uint8(SQLITE_AFF_BLOB)) if (pVal != 0) && (Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT) { z = Xsqlite3_value_text(tls, pVal) } @@ -140393,13 +140393,13 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr var isNum int32 // var rDummy float64 at bp+8, 8 - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) if isNum <= 0 { if (iTo == 1) && (int32(*(*int8)(unsafe.Pointer(zNew))) == '-') { isNum = +1 } else { *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))++ - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))-- } } @@ -140548,13 +140548,13 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft *(*uintptr)(unsafe.Pointer(ppRight)) = pRight if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_NE + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOT + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOTNULL + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) } return res } @@ -140568,17 +140568,17 @@ type Op2 = struct { } /* sqlite3.c:144350:18 */ var aOp = [4]Op2{ - {FzOp: ts + 18342 /* "match" */, FeOp2: SQLITE_INDEX_CONSTRAINT_MATCH}, - {FzOp: ts + 17633 /* "glob" */, FeOp2: SQLITE_INDEX_CONSTRAINT_GLOB}, - {FzOp: ts + 17193 /* "like" */, FeOp2: SQLITE_INDEX_CONSTRAINT_LIKE}, - {FzOp: ts + 24704 /* "regexp" */, FeOp2: SQLITE_INDEX_CONSTRAINT_REGEXP}, + {FzOp: ts + 18342 /* "match" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)}, + {FzOp: ts + 17633 /* "glob" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)}, + {FzOp: ts + 17193 /* "like" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)}, + {FzOp: ts + 24704 /* "regexp" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)}, } /* sqlite3.c:144353:7 */ // If the pBase expression originated in the ON or USING clause of // a join, then transfer the appropriate markings over to derived. func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:144447:13: */ if pDerived != 0 { - *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & EP_FromJoin) + *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pDerived)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pBase)).FiRightJoinTable } } @@ -140779,7 +140779,7 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) pOrWc = (pOrInfo /* &.wc */) libc.X__builtin___memset_chk(tls, pOrWc+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})), libc.X__builtin_object_size(tls, pOrWc+40 /* &.aStatic */, 0)) Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo) - Xsqlite3WhereSplit(tls, pOrWc, pExpr, TK_OR) + Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(TK_OR)) Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return @@ -140807,11 +140807,11 @@ __1: var b Bitmask = uint64(0) *(*uintptr)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) = pAndInfo *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) |= U16((TERM_ANDINFO)) - (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = WO_AND + (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(WO_AND) pAndWC = (pAndInfo /* &.wc */) libc.X__builtin___memset_chk(tls, pAndWC+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})), libc.X__builtin_object_size(tls, pAndWC+40 /* &.aStatic */, 0)) Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo) - Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, TK_AND) + Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(TK_AND)) Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC) (*WhereClause)(unsafe.Pointer(pAndWC)).FpOuter = pWC if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { @@ -140871,10 +140871,10 @@ __3: // empty. (*WhereOrInfo)(unsafe.Pointer(pOrInfo)).Findexable = indexable if indexable != 0 { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) (*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(1) } else { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) } // For a two-way OR, attempt to implementation case 2. @@ -141082,7 +141082,7 @@ func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS) { return 0 } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return 0 } aff1 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) @@ -141247,7 +141247,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) @@ -141262,7 +141262,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect != 0 { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_VARSELECT)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)) prereqAll = prereqAll | (x) extraRight = (x - uint64(1)) // ON clause terms may not be used with an index @@ -141283,9 +141283,9 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pRight uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var opMask U16 if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & prereqLeft) == uint64(0) { - opMask = WO_ALL + opMask = uint16(WO_ALL) } else { - opMask = WO_EQUIV + opMask = uint16(WO_EQUIV) } if (*WhereTerm)(unsafe.Pointer(pTerm)).FiField > 0 { @@ -141328,7 +141328,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if termIsEquivalence(tls, pParse, pDup) != 0 { *(*U16)(unsafe.Pointer(pTerm + 20 /* &.eOperator */)) |= U16((WO_EQUIV)) - eExtraOp = WO_EQUIV + eExtraOp = U16(WO_EQUIV) } } else { pDup = pExpr @@ -141475,8 +141475,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pNewExpr uintptr pNewExpr = Xsqlite3PExpr(tls, pParse, TK_MATCH, uintptr(0), Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)), 0)) - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && (pNewExpr != 0) { - *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (EP_FromJoin) + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (pNewExpr != 0) { + *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pNewExpr)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable } idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) @@ -141485,7 +141485,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = prereqExpr (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiTable *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiColumn) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = WO_AUX + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(WO_AUX) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeMatchOp = *(*uint8)(unsafe.Pointer(bp + 24 /* eOp2 */)) markTermAsChild(tls, pWC, idxNew, idxTerm) pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) @@ -141512,8 +141512,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS))) && ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) && (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) && - ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & EP_xIsSelect) == U32(0)) || - (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & EP_xIsSelect) == U32(0))) { + ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & U32(EP_xIsSelect)) == U32(0)) || + (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & U32(EP_xIsSelect)) == U32(0))) { var i int32 for i = 0; i < nLeft; i++ { var idxNew int32 @@ -141523,7 +141523,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight) transferJoinMarkings(tls, pNew, pExpr) - idxNew = whereClauseInsert(tls, pWC, pNew, TERM_DYNAMIC) + idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC)) exprAnalyze(tls, pSrc, pWC, idxNew) } pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) @@ -141546,7 +141546,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var i int32 for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ { var idxNew int32 - idxNew = whereClauseInsert(tls, pWC, pExpr, TERM_VIRTUAL) + idxNew = whereClauseInsert(tls, pWC, pExpr, uint16(TERM_VIRTUAL)) (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64)).FiField = (i + 1) exprAnalyze(tls, pSrc, pWC, idxNew) markTermAsChild(tls, pWC, idxNew, idxTerm) @@ -141562,7 +141562,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if ((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN)) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { var pNewExpr uintptr var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft @@ -141595,7 +141595,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s *(*Bitmask)(unsafe.Pointer(pTerm + 48 /* &.prereqRight */)) |= (extraRight) } -var ops = [2]U8{TK_GE, TK_LE} /* sqlite3.c:145161:21 */ +var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:145161:21 */ // ************************************************************************** // @@ -141684,7 +141684,7 @@ __3: // tree. func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145504:24: */ var mask Bitmask - if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FixedCol)) != U32(0)) { + if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FixedCol))) != U32(0)) { return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable) } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { @@ -141701,8 +141701,8 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { mask = mask | (Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight)) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_VarSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_VarSelect))) != U32(0) { (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 1 } mask = mask | (exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))) @@ -141795,7 +141795,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 { Xsqlite3SetJoinExpr(tls, pTerm, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) } - whereClauseInsert(tls, pWC, pTerm, TERM_DYNAMIC) + whereClauseInsert(tls, pWC, pTerm, uint16(TERM_DYNAMIC)) } } @@ -142097,7 +142097,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 ((int32(iColumn) != (-2)) || (Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0))) && - ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) { + ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) { if (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) != 0) && (int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < (int32(uint64(unsafe.Sizeof([11]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) && (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight))))).Fop) == @@ -142362,7 +142362,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui continue } for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ { - if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), WO_EQ, pIdx) { + if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), uint32(WO_EQ), pIdx) { if findIndexCol(tls, pParse, pDistinct, iBase, pIdx, i) < 0 { break } @@ -142414,16 +142414,16 @@ __1: goto __2 } if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Copy + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Copy) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = ((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister) (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { if iAutoidxCur != 0 { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Sequence + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Sequence) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = iAutoidxCur } else { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 0 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } @@ -142456,7 +142456,7 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm return 0 } if (((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IS) != 0) { // Cannot use an IS term from the WHERE clause as an index driver for // the RHS of a LEFT JOIN. Such a term can only be used if it is from @@ -142542,7 +142542,7 @@ __1: // table of a LEFT JOIN if !(((((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq == uint64(0)) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VIRTUAL) == 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) != 0)) { goto __4 } @@ -142765,14 +142765,14 @@ __29: } iContinue = Xsqlite3VdbeMakeLabel(tls, pParse) Xsqlite3ExprIfFalse(tls, pParse, pPartial, iContinue, SQLITE_JUMPIFNULL) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_PARTIALIDX) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_PARTIALIDX)) __30: ; regRecord = Xsqlite3GetTempReg(tls, pParse) regBase = Xsqlite3GenerateIndexKey(tls, pParse, pIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0) Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) if !(pPartial != 0) { goto __31 } @@ -142791,7 +142791,7 @@ __31: goto __33 __32: Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (addrTop + 1)) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_STMTSTATUS_AUTOINDEX) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX)) __33: ; Xsqlite3VdbeJumpHere(tls, v, addrTop) @@ -142919,7 +142919,7 @@ __4: // right-hand table of a LEFT JOIN. See tag-20191211-001 for the // equivalent restriction for ordinary tables. if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __5 } @@ -142927,15 +142927,15 @@ __4: (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiTermOffset = i op = (U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL)) if int32(op) == WO_IN { - op = WO_EQ + op = U16(WO_EQ) } if int32(op) == WO_AUX { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp } else if (int32(op) & (WO_ISNULL | WO_IS)) != 0 { if int32(op) == WO_ISNULL { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_ISNULL + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) } else { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_IS + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) } } else { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = U8(op) @@ -143184,7 +143184,7 @@ func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol i if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) { if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } @@ -143634,11 +143634,11 @@ func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */ // Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147476:13: */ if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & (U32(WHERE_VIRTUALTABLE | WHERE_AUTO_INDEX))) != 0 { - if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { + if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */))) *(*U8)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0) - } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzColAff) Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -143692,9 +143692,9 @@ func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 } libc.X__builtin___memcpy_chk(tls, pTo, pFrom, uint64((uintptr(0) + 48 /* &.nLSlot */)), libc.X__builtin_object_size(tls, pTo, 0)) libc.X__builtin___memcpy_chk(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint64(unsafe.Sizeof(uintptr(0)))), libc.X__builtin_object_size(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, 0)) - if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { *(*U8)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) - } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_AUTO_INDEX) != U32(0) { + } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0) { *(*uintptr)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) } return SQLITE_OK @@ -143712,7 +143712,7 @@ func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147 for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ { var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(i)*88) - if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_IN_ABLE) != 0) { + if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 8 /* &.aInLoop */))) } } @@ -143772,8 +143772,8 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { return 0 } // X not a subset of Y since term X[i] not used by Y } - if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) { + if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) { return 0 // Constraint (5) } return 1 // All conditions meet @@ -143792,14 +143792,14 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { // WHERE clause terms than Y and that every WHERE clause term used by X is // also used by Y. func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:147623:13: */ - if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { return } for ; p != 0; p = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop { if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) { continue } - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_INDEXED) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { continue } if whereLoopCheaperProperSubset(tls, p, pTemplate) != 0 { @@ -143855,10 +143855,10 @@ __1: // Any loop using an appliation-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 ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && + if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && ((int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip)) == 0)) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) != U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_COLUMN_EQ) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_COLUMN_EQ)) != U32(0))) && (((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) { goto __3 } @@ -143990,7 +143990,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { } } rc = whereLoopXfer(tls, db, p, pTemplate) - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) { var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) if (pIndex != 0) && ((int32(*(*uint16)(unsafe.Pointer(pIndex + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK) { *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -144140,7 +144140,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr var pColl uintptr // Comparison collation sequence var pLhs uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr var pRhs uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight - if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & U32(EP_xIsSelect)) != 0 { pRhs = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr } else { pRhs = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -144218,7 +144218,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb return SQLITE_NOMEM } - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { opMask = ((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))) } else { @@ -144265,7 +144265,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // be used by the right table of a LEFT JOIN. Only constraints in the // ON clause are allowed. See tag-20191211-002 for the vtab equivalent. if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { continue } @@ -144287,7 +144287,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if (int32(eOp) & WO_IN) != 0 { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows var i int32 nIn = 46 @@ -144338,22 +144338,22 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb } } - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_IN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_IN)) } else if (int32(eOp) & (WO_EQ | WO_IS)) != 0 { var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_EQ) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_EQ)) if (iCol == (-1)) || (((iCol >= 0) && (int32(nInMul) == 0)) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1))) { if ((iCol == (-1)) || ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0)) || (((int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1) && ((*Index)(unsafe.Pointer(pProbe)).FonError != 0)) && (int32(eOp) == WO_EQ)) { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_UNQ_WANTED) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_UNQ_WANTED)) } } } else if (int32(eOp) & WO_ISNULL) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_NULL) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_NULL)) } else if (int32(eOp) & ((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0 { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT)) @@ -144370,7 +144370,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb break } // OOM *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_TOP_LIMIT) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_TOP_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(1) } } else { @@ -144379,7 +144379,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(whereRangeVectorLen(tls, pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) pTop = pTerm - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != U32(0) { pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2))*8)) } else { pBtm = uintptr(0) @@ -144392,7 +144392,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // "x IN(...)" terms are replaced with "x = ?". This block updates // the value of pNew->nOut to account for pTerm (but not nIn/nInMul). - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { // Adjust nOut using stat4 data. Or, if there is no stat4 // data, using some other estimate. whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew) @@ -144408,7 +144408,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if ((((int32(nInMul) == 0) && ((*Index)(unsafe.Pointer(pProbe)).FnSample != 0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol)) && - (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_xIsSelect)) != U32(0)))) && + (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0)))) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (int32(eOp) & ((WO_EQ | WO_ISNULL) | WO_IS)) != 0 { @@ -144473,13 +144473,13 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb whereLoopOutputAdjust(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize) rc = whereLoopInsert(tls, pBuilder, pNew) - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut } else { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted } - if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_TOP_LIMIT) == U32(0)) && + if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_TOP_LIMIT)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn)) { whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nInMul) + nIn))) } @@ -144518,7 +144518,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */))++ (*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_SKIPSCAN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_SKIPSCAN)) nIter = (LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))))) *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((int32(nIter))) // TUNING: Because uncertainties in the estimates for skip-scan queries, @@ -144589,7 +144589,7 @@ func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintpt } pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpRight } - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableQPSG) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableQPSG)) != 0 { pParse = uintptr(0) } i = 0 @@ -144601,8 +144601,8 @@ __1: { var pExpr uintptr pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == iTab)) && - ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == iTab)) && + ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0) { return 1 } @@ -144685,7 +144685,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { if (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex != 0 { // An INDEXED BY clause specifies a particular index to use pProbe = (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pProbe = (*Table)(unsafe.Pointer(pTab)).FpIndex } else { // There is no INDEXED BY clause. Create a fake Index object in local @@ -144698,10 +144698,10 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { (*Index)(unsafe.Pointer(bp /* &sPk */)).FnColumn = U16(1) (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiColumn = bp + 152 /* &aiColumnPk */ (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiRowLogEst = bp + 154 /* &aiRowEstPk[0] */ - (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = OE_Replace + (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = U8(OE_Replace) (*Index)(unsafe.Pointer(bp /* &sPk */)).FpTable = pTab (*Index)(unsafe.Pointer(bp /* &sPk */)).FszIdxRow = (*Table)(unsafe.Pointer(pTab)).FszTabRow - libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, SQLITE_IDXTYPE_IPK, 0, 0x3) + libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3) *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */ + 1*2)) = int16(0) pFirst = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FpIndex @@ -144718,10 +144718,10 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // Automatic indexes if ((((((!(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) && // Not part of an OR optimization ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & SQLITE_AutoIndex) != uint64(0))) && + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & uint64(SQLITE_AutoIndex)) != uint64(0))) && ((*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex == uintptr(0))) && // Has no INDEXED BY clause !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) && // Has no NOT INDEXED clause - (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) + (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isCorrelated */)) & 0x8 >> 3)) != 0)) && // Not a correlated subquery !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5)) != 0) { // Generate auto-index WhereLoops @@ -144746,7 +144746,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // those objects, since there is no opportunity to add schema // indexes on subqueries and views. (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = (LogEst(int32(rLogSize) + int32(rSize))) - if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) == U32(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) == U32(0)) { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) += int16((28)) } else { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) -= int16((10)) @@ -144761,7 +144761,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // not be unreasonable to make this value much larger. (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43) (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, (*WhereLoop)(unsafe.Pointer(pNew)).FnOut) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_AUTO_INDEX + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_AUTO_INDEX) (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) rc = whereLoopInsert(tls, pBuilder, pNew) } @@ -144802,7 +144802,7 @@ __1: if (int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK { // Integer primary key index - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_IPK + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IPK) // Full table scan (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 { @@ -144831,13 +144831,13 @@ __1: if m == uint64(0) { return (uint32(WHERE_IDX_ONLY | WHERE_INDEXED)) } - return WHERE_INDEXED + return uint32(WHERE_INDEXED) }() } // Full scan via index if ((((b != 0) || - !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0))) || ((uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0)) || ((((((m == uint64(0)) && @@ -144903,7 +144903,7 @@ __1: // unique index is used (making the index functionally non-unique) // then the sqlite_stat1 data becomes important for scoring the // plan - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_StatsUsed) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_StatsUsed)) } Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec) (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0 @@ -145105,7 +145105,7 @@ __6: // Set the WHERE_ONEROW flag if the xBestIndex() method indicated // that the scan will visit at most one row. Clear it otherwise. if ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags & SQLITE_INDEX_SCAN_UNIQUE) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW))) } @@ -145195,7 +145195,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus return SQLITE_NOMEM } (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_VIRTUALTABLE + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_VIRTUALTABLE) (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0) *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) nConstraint = (*Sqlite3_index_info)(unsafe.Pointer(p)).FnConstraint @@ -145224,7 +145224,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0 { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) mBestNoIn = ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq) if mBestNoIn == uint64(0) { @@ -145281,7 +145281,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if (rc == SQLITE_OK) && (seenZeroNoIN == 0) { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, mPrereq, WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) } } @@ -145343,7 +145343,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable } else if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur { (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpWInfo = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpOuter = pWC - (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = TK_AND + (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = U8(TK_AND) (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FnTerm = 1 (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fa = pOrTerm (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpWC = bp + 112 /* &tempWC */ @@ -145382,7 +145382,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable } (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1) *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_MULTI_OR + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_MULTI_OR) (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0) libc.X__builtin___memset_chk(tls, (pNew + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct { @@ -145434,7 +145434,7 @@ func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:14921 // Loop over the tables in the join, from left to right pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew whereLoopInit(tls, pNew) - (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = SQLITE_QUERY_PLANNER_LIMIT + (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = uint32(SQLITE_QUERY_PLANNER_LIMIT) iTab = 0 pItem = pTabList + 8 /* &.a */ __1: @@ -145444,7 +145444,7 @@ __1: { var mUnusable Bitmask = uint64(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab) - *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (SQLITE_QUERY_PLANNER_LIMIT_INCR) + *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR)) (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 { // This condition is true when pItem is the FROM clause term on the @@ -145583,7 +145583,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else { pLoop = pLast } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { if (*(*I8)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.vtab */) + 5 /* &.isOrdered */)) != 0) && ((int32(wctrlFlags) & WHERE_DISTINCTBY) == 0) { obSat = obDone } @@ -145637,8 +145637,8 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, obSat = obSat | (Bitmask((uint64(1))) << (i)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0) { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != 0 { pIndex = uintptr(0) nKeyCol = U16(0) nColumn = U16(1) @@ -145649,7 +145649,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, nColumn = (*Index)(unsafe.Pointer(pIndex)).FnColumn isOrderDistinct = (U8(libc.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != OE_None) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_SKIPSCAN) == U32(0))))) + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_SKIPSCAN)) == U32(0))))) } // Loop through all columns of the index and deal with the ones @@ -145774,7 +145774,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } if (isMatch != 0) && ((int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0) { if j == int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_BIGNULL_SORT) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_BIGNULL_SORT)) } else { isMatch = U8(0) } @@ -146053,7 +146053,7 @@ __3: if ((*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf & (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop) != uint64(0) { continue } - if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { + if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { // Do not use an automatic index if the this loop is expected // to run less than 1.25 times. It is tempting to also exclude // automatic index usage on an outer loop, but sometimes an automatic @@ -146245,16 +146245,16 @@ __3: // var notUsed Bitmask at bp+8, 8 var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom, - WHERE_DISTINCTBY, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) + uint16(WHERE_DISTINCTBY), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4) if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) != 0 { if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } else { (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = (*WherePath)(unsafe.Pointer(pFrom)).FisOrdered @@ -146263,11 +146263,11 @@ __3: (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0) if nLoop > 0 { var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)))).FwsFlags - if ((wsFlags & WHERE_ONEROW) == U32(0)) && + if ((wsFlags & U32(WHERE_ONEROW)) == U32(0)) && ((wsFlags & (U32(WHERE_IPK | WHERE_COLUMN_IN))) != (U32(WHERE_IPK | WHERE_COLUMN_IN))) { *(*Bitmask)(unsafe.Pointer(bp + 16 /* m */)) = uint64(0) var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, - WHERE_ORDERBY_LIMIT, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) + uint16(WHERE_ORDERBY_LIMIT), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4) @@ -146375,7 +146375,7 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32((WHERE_COLUMN_EQ | WHERE_ONEROW) | WHERE_INDEXED)) if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IDX_ONLY) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IDX_ONLY)) } (*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(j) *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(j) @@ -146396,7 +146396,7 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr) } if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) } return 1 } @@ -146405,7 +146405,7 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: // Helper function for exprIsDeterministic(). func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:150168:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) == 0) { + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) == 0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -146655,7 +146655,7 @@ __4: // subexpression is separated by an AND operator. (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0 Xsqlite3WhereClauseInit(tls, (pWInfo + 104 /* &.sWC */), pWInfo) - Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, TK_AND) + Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, uint8(TK_AND)) // Special case: No FROM clause if !(nTabList == 0) { @@ -146670,7 +146670,7 @@ __7: if !((int32(wctrlFlags) & WHERE_WANT_DISTINCT) != 0) { goto __8 } - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) __8: ; Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+24939 /* "SCAN CONSTANT RO..." */, 0) @@ -146757,7 +146757,7 @@ __15: goto __19 } // The DISTINCT marking is pointless. Ignore it. - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) goto __20 __19: if !(pOrderBy == uintptr(0)) { @@ -146836,7 +146836,7 @@ __29: ; __22: ; - if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReverseOrder) != uint64(0))) { + if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReverseOrder)) != uint64(0))) { goto __31 } (*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1)) @@ -146904,7 +146904,7 @@ __35: __38: ; if !(((int32(wctrlFlags) & WHERE_WANT_DISTINCT) == 0) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0))) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0))) { goto __39 } goto __36 @@ -146925,7 +146925,7 @@ __41: if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) { goto __44 } - if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) || + if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || (int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable) != (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)) { goto __45 } @@ -147019,17 +147019,17 @@ __33: } (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 { if bOnerow != 0 { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_MULTI + return uint8(ONEPASS_MULTI) }() - if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { + if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { goto __54 } if !((int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW) != 0) { goto __55 } - bFordelete = OPFLAG_FORDELETE + bFordelete = U8(OPFLAG_FORDELETE) __55: ; (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))) @@ -147053,13 +147053,13 @@ __56: pTab = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { + if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __59 } // Do nothing goto __60 __59: - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) { goto __61 } pVTab = Xsqlite3GetVTable(tls, db, pTab) @@ -147073,7 +147073,7 @@ __61: // noop goto __64 __63: - if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) && + if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) { goto __65 } @@ -147128,14 +147128,14 @@ __62: ; __60: ; - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0) { goto __72 } pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) op1 = OP_OpenRead // iAuxArg is always set to a positive value if ONEPASS is possible - if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && + if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0)) { goto __73 } @@ -147185,14 +147185,14 @@ __74: } Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx) - if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) != U32(0)) && + if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_RANGE | WHERE_SKIPSCAN))) == U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) == U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) == U32(0))) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ORDERBY_MIN) == 0)) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED)) { goto __82 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SEEKEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ)) __82: ; Xsqlite3VdbeComment(tls, v, ts+834 /* "%s" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIx)).FzName)) @@ -147232,7 +147232,7 @@ __85: } pLevel = ((pWInfo + 920 /* &.a */) + uintptr(ii)*88) wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) - if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) { + if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) { goto __88 } constructAutomaticIndex(tls, pParse, (pWInfo + 104 /* &.sWC */), @@ -147311,7 +147311,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * var n int32 if (((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED) && (i == (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1))) && // Ticket [ef9318757b152e3] 2017-10-21 - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && ((uint32(int32(*(*uint16)(unsafe.Pointer((libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))) + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0)) && ((libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */))))) > 0)) && (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36) { @@ -147347,7 +147347,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * } else { Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont) } - if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_ABLE) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { + if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { var pIn uintptr var j int32 Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt) @@ -147372,10 +147372,10 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * // jump over the OP_Next or OP_Prev instruction about to // be coded. Xsqlite3VdbeAddOp2(tls, v, OP_IfNotOpen, (*InLoop)(unsafe.Pointer(pIn)).FiCur, - ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0))))) + ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0))))) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) { Xsqlite3VdbeAddOp4Int(tls, v, OP_IfNoHope, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), (*InLoop)(unsafe.Pointer(pIn)).FiBase, (*InLoop)(unsafe.Pointer(pIn)).FnPrefix) @@ -147467,11 +147467,11 @@ __4: // reference the index. if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_INDEXED | WHERE_IDX_ONLY))) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */)) } if ((pIdx != 0) && - ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)))) && + ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)))) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { last = Xsqlite3VdbeCurrentAddr(tls, v) k = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody @@ -147488,7 +147488,7 @@ __4: (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset) { var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab) x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2))) @@ -147505,7 +147505,7 @@ __4: } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_IdxRowid + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_IdxRowid) } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNullRow { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -148175,7 +148175,7 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0)) || ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1)) { Xsqlite3ErrorMsg(tls, pParse, ts+25196 /* "RANGE with offse..." */, 0) - } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0 { + } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0 { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 { Xsqlite3ErrorMsg(tls, pParse, @@ -148256,7 +148256,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { case TK_FUNCTION: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { break } else { var pWin uintptr @@ -148286,19 +148286,19 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in if iCol < 0 { var pDup uintptr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) if (pDup != 0) && (int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION) { - (*Expr)(unsafe.Pointer(pDup)).Fop = TK_FUNCTION + (*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_FUNCTION) } (*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) } if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { - var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Collate)) + var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Static))) libc.X__builtin___memset_chk(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{})), libc.X__builtin_object_size(tls, pExpr, 0)) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 { if iCol < 0 { return (int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1)) @@ -148398,11 +148398,11 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui // var iDummy int32 at bp, 4 var pSub uintptr - for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (EP_Skip)) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { + for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (U32(EP_Skip))) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { } if Xsqlite3ExprIsInteger(tls, pSub, bp /* &iDummy */) != 0 { - (*Expr)(unsafe.Pointer(pSub)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pSub)).Fop = U8(TK_NULL) *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(((EP_IntValue | EP_IsTrue) | EP_IsFalse)))) *(*uintptr)(unsafe.Pointer(pSub + 8 /* &.u */)) = uintptr(0) } @@ -148440,7 +148440,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* defer tls.Free(56) var rc int32 = SQLITE_OK - if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_WinRewrite) == U32(0)) { + if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_WinRewrite)) == U32(0)) { var v uintptr = Xsqlite3GetVdbe(tls, pParse) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSub uintptr = uintptr(0) // The subquery @@ -148470,7 +148470,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* (*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_WinRewrite) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(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 @@ -148514,7 +148514,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // results. for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var pArgs uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) - if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_SUBTYPE) != 0 { + if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_SUBTYPE)) != 0 { selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp+48 /* &pSublist */) (*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 { if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) != 0 { @@ -148559,9 +148559,9 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* var pTab2 uintptr (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(p)).FpSrc) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (SF_Expanded) - pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, SQLITE_AFF_NONE) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & SF_Aggregate) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) + pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, int8(SQLITE_AFF_NONE)) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & U32(SF_Aggregate)) if pTab2 == uintptr(0) { // Might actually be some other kind of error, but in that case // pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get @@ -148569,7 +148569,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* rc = SQLITE_NOMEM } else { libc.X__builtin___memcpy_chk(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{})), libc.X__builtin_object_size(tls, pTab, 0)) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab pTab = pTab2 libc.X__builtin___memset_chk(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})), libc.X__builtin_object_size(tls, bp /* &w */, 0)) @@ -148706,7 +148706,7 @@ __3: if !((int32(eExclude) == 0) && ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_WindowFunc)) != 0)) { goto __4 } - eExclude = TK_NO + eExclude = U8(TK_NO) __4: ; (*Window)(unsafe.Pointer(pWin)).FeExclude = eExclude @@ -148781,9 +148781,9 @@ func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr if p != 0 { *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) = pWin - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_WinFunc) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_WinFunc)) (*Window)(unsafe.Pointer(pWin)).FpOwner = p - if (((*Expr)(unsafe.Pointer(p)).Fflags & EP_Distinct) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Distinct)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { Xsqlite3ErrorMsg(tls, pParse, ts+25448 /* "DISTINCT is not ..." */, 0) } @@ -148886,7 +148886,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var p uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { // The inline versions of min() and max() require a single ephemeral // table and 3 registers. The registers are used as follows: // @@ -148900,7 +148900,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (3) if (pKeyInfo != 0) && (int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + 1))) == 'i') { - *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = KEYINFO_ORDER_DESC + *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = U8(KEYINFO_ORDER_DESC) } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 2) Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9) @@ -149059,7 +149059,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse regArg = reg if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { var addrIsNull int32 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regArg) @@ -149108,7 +149108,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } } } - if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) + 8 /* &.a */))).FpExpr) @@ -149147,7 +149147,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888: for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult) Xsqlite3VdbeAddOp1(tls, v, OP_Last, (*Window)(unsafe.Pointer(pWin)).FcsrApp) @@ -149385,7 +149385,7 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) } - if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { + if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*Window)(unsafe.Pointer(pWin)).FcsrApp) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) @@ -149565,7 +149565,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal // control skips over this test if the BIGNULL flag is set and either // reg1 or reg2 contain a NULL value. Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) Xsqlite3ReleaseTempReg(tls, pParse, reg1) Xsqlite3ReleaseTempReg(tls, pParse, reg2) @@ -149673,7 +149673,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn if op == (*WindowCodeArg)(unsafe.Pointer(p)).FeDelete { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, csr) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } if jumpOnEof != 0 { @@ -149779,7 +149779,7 @@ func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* s var ret int32 = 0 var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, SQLITE_AFF_NUMERIC, bp /* &pVal */) + Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uint8(SQLITE_AFF_NUMERIC), bp /* &pVal */) if (*(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0) && (Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) > 0) { ret = 1 } @@ -150556,7 +150556,7 @@ func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlit } { (*Select)(unsafe.Pointer(pLoop)).FpNext = pNext - *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (SF_Compound) + *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (U32(SF_Compound)) } goto __2 @@ -150568,7 +150568,7 @@ func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlit goto __3 __3: ; - if ((((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { + if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { Xsqlite3ErrorMsg(tls, pParse, ts+25722 /* "too many terms i..." */, 0) } } @@ -150588,7 +150588,7 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq // memset(p, 0, sizeof(Expr)); (*Expr)(unsafe.Pointer(p)).Fop = U8(op) (*Expr)(unsafe.Pointer(p)).FaffExpr = int8(0) - (*Expr)(unsafe.Pointer(p)).Fflags = EP_Leaf + (*Expr)(unsafe.Pointer(p)).Fflags = U32(EP_Leaf) (*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1) (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+24 /* &.pRight */, uintptr(0)) @@ -152914,7 +152914,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(38): /* ccons ::= UNIQUE onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(39): /* ccons ::= CHECK LP expr RP */ @@ -153051,7 +153051,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(67): /* tcons ::= UNIQUE LP sortlist RP onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(68): /* tcons ::= CHECK LP expr RP onconf */ @@ -153106,7 +153106,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(82): /* cmd ::= select */ { - *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: SRT_Output} + *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(SRT_Output)} Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), bp+24 /* &dest */) Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } @@ -153202,7 +153202,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(92): /* values ::= VALUES LP nexprlist RP */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_Values, uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) } break case uint32(93): /* values ::= values COMMA LP nexprlist RP */ @@ -153214,7 +153214,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))) } if pRight != 0 { - (*Select)(unsafe.Pointer(pRight)).Fop = TK_ALL + (*Select)(unsafe.Pointer(pRight)).Fop = U8(TK_ALL) (*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pRight } else { @@ -153344,7 +153344,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } else { var pSubquery uintptr Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) - pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_NestedFrom, uintptr(0)) + pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0)) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } @@ -153790,7 +153790,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break @@ -153807,7 +153807,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break @@ -154014,7 +154014,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { Xsqlite3CreateIndex(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), - (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), SQLITE_IDXTYPE_APPDEF) + (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), uint8(SQLITE_IDXTYPE_APPDEF)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0) { Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) } @@ -154208,7 +154208,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 { - (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = OE_Ignore + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = int8(OE_Ignore) } } break @@ -154474,7 +154474,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{}))) if *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0 { - (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = TK_FILTER + (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = U8(TK_FILTER) (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } else { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) @@ -154879,35 +154879,35 @@ var aKWOffset = [145]uint16{ } /* sqlite3.c:159521:33 */ // aKWCode[i] is the parser symbol code for the i-th keyword var aKWCode = [145]uint8{ - TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE, - TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN, - TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD, - TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE, - TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE, - TK_EXCLUDE, TK_DELETE, TK_TEMP, TK_TEMP, TK_OR, - TK_ISNULL, TK_NULLS, TK_SAVEPOINT, TK_INTERSECT, TK_TIES, - TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW, - TK_EXCEPT, TK_TRANSACTION, TK_ACTION, TK_ON, TK_JOIN_KW, - TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, - TK_INTO, TK_OFFSET, TK_OF, TK_SET, TK_TRIGGER, - TK_RANGE, TK_GENERATED, TK_DETACH, TK_HAVING, TK_LIKE_KW, - TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY, - TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH, - TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE, - TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE, - TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH, - TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT, TK_UPDATE, - TK_VALUES, TK_VIRTUAL, TK_ALWAYS, TK_WHEN, TK_WHERE, - TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND, TK_DEFERRED, - TK_DISTINCT, TK_IS, TK_AUTOINCR, TK_TO, TK_IN, - TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, - TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DROP, - TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER, TK_REPLACE, - TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_LIMIT, - TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER, - TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW, TK_UNBOUNDED, - TK_UNION, TK_USING, TK_VACUUM, TK_VIEW, TK_WINDOW, - TK_DO, TK_BY, TK_INITIALLY, TK_ALL, TK_PRIMARY, + uint8(TK_REINDEX), uint8(TK_INDEXED), uint8(TK_INDEX), uint8(TK_DESC), uint8(TK_ESCAPE), + uint8(TK_EACH), uint8(TK_CHECK), uint8(TK_KEY), uint8(TK_BEFORE), uint8(TK_FOREIGN), + uint8(TK_FOR), uint8(TK_IGNORE), uint8(TK_LIKE_KW), uint8(TK_EXPLAIN), uint8(TK_INSTEAD), + uint8(TK_ADD), uint8(TK_DATABASE), uint8(TK_AS), uint8(TK_SELECT), uint8(TK_TABLE), + uint8(TK_JOIN_KW), uint8(TK_THEN), uint8(TK_END), uint8(TK_DEFERRABLE), uint8(TK_ELSE), + uint8(TK_EXCLUDE), uint8(TK_DELETE), uint8(TK_TEMP), uint8(TK_TEMP), uint8(TK_OR), + uint8(TK_ISNULL), uint8(TK_NULLS), uint8(TK_SAVEPOINT), uint8(TK_INTERSECT), uint8(TK_TIES), + uint8(TK_NOTNULL), uint8(TK_NOT), uint8(TK_NO), uint8(TK_NULL), uint8(TK_LIKE_KW), + uint8(TK_EXCEPT), uint8(TK_TRANSACTION), uint8(TK_ACTION), uint8(TK_ON), uint8(TK_JOIN_KW), + uint8(TK_ALTER), uint8(TK_RAISE), uint8(TK_EXCLUSIVE), uint8(TK_EXISTS), uint8(TK_CONSTRAINT), + uint8(TK_INTO), uint8(TK_OFFSET), uint8(TK_OF), uint8(TK_SET), uint8(TK_TRIGGER), + uint8(TK_RANGE), uint8(TK_GENERATED), uint8(TK_DETACH), uint8(TK_HAVING), uint8(TK_LIKE_KW), + uint8(TK_BEGIN), uint8(TK_JOIN_KW), uint8(TK_REFERENCES), uint8(TK_UNIQUE), uint8(TK_QUERY), + uint8(TK_WITHOUT), uint8(TK_WITH), uint8(TK_JOIN_KW), uint8(TK_RELEASE), uint8(TK_ATTACH), + uint8(TK_BETWEEN), uint8(TK_NOTHING), uint8(TK_GROUPS), uint8(TK_GROUP), uint8(TK_CASCADE), + uint8(TK_ASC), uint8(TK_DEFAULT), uint8(TK_CASE), uint8(TK_COLLATE), uint8(TK_CREATE), + uint8(TK_CTIME_KW), uint8(TK_IMMEDIATE), uint8(TK_JOIN), uint8(TK_INSERT), uint8(TK_MATCH), + uint8(TK_PLAN), uint8(TK_ANALYZE), uint8(TK_PRAGMA), uint8(TK_ABORT), uint8(TK_UPDATE), + uint8(TK_VALUES), uint8(TK_VIRTUAL), uint8(TK_ALWAYS), uint8(TK_WHEN), uint8(TK_WHERE), + uint8(TK_RECURSIVE), uint8(TK_AFTER), uint8(TK_RENAME), uint8(TK_AND), uint8(TK_DEFERRED), + uint8(TK_DISTINCT), uint8(TK_IS), uint8(TK_AUTOINCR), uint8(TK_TO), uint8(TK_IN), + uint8(TK_CAST), uint8(TK_COLUMNKW), uint8(TK_COMMIT), uint8(TK_CONFLICT), uint8(TK_JOIN_KW), + uint8(TK_CTIME_KW), uint8(TK_CTIME_KW), uint8(TK_CURRENT), uint8(TK_PARTITION), uint8(TK_DROP), + uint8(TK_PRECEDING), uint8(TK_FAIL), uint8(TK_LAST), uint8(TK_FILTER), uint8(TK_REPLACE), + uint8(TK_FIRST), uint8(TK_FOLLOWING), uint8(TK_FROM), uint8(TK_JOIN_KW), uint8(TK_LIMIT), + uint8(TK_IF), uint8(TK_ORDER), uint8(TK_RESTRICT), uint8(TK_OTHERS), uint8(TK_OVER), + uint8(TK_JOIN_KW), uint8(TK_ROLLBACK), uint8(TK_ROWS), uint8(TK_ROW), uint8(TK_UNBOUNDED), + uint8(TK_UNION), uint8(TK_USING), uint8(TK_VACUUM), uint8(TK_VIEW), uint8(TK_WINDOW), + uint8(TK_DO), uint8(TK_BY), uint8(TK_INITIALLY), uint8(TK_ALL), uint8(TK_PRIMARY), } /* sqlite3.c:159536:28 */ // Hash table decoded: @@ -155934,7 +155934,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: switch int32(*(*int8)(unsafe.Pointer(zSql))) { case ';': { // A semicolon - token = TkSEMI + token = U8(TkSEMI) break } @@ -155948,14 +155948,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case '\f': { // White space is ignored - token = TkWS + token = U8(TkWS) break } case '/': { // C-style comments if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '*' { - token = TkOTHER + token = U8(TkOTHER) break } zSql += uintptr(2) @@ -155966,14 +155966,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: return 0 } zSql++ - token = TkWS + token = U8(TkWS) break } case '-': { // SQL-style comments from "--" to end of line if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '-' { - token = TkOTHER + token = U8(TkOTHER) break } for (*(*int8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*int8)(unsafe.Pointer(zSql))) != '\n') { @@ -155982,7 +155982,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return (libc.Bool32(int32(state) == 1)) } - token = TkWS + token = U8(TkWS) break } @@ -155995,7 +155995,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -156013,7 +156013,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -156030,9 +156030,9 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: case 'C': { if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+26195 /* "create" */, 6) == 0) { - token = TkCREATE + token = U8(TkCREATE) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -156043,13 +156043,13 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: case 'T': { if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+22669 /* "trigger" */, 7) == 0) { - token = TkTRIGGER + token = U8(TkTRIGGER) } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+26202 /* "temp" */, 4) == 0) { - token = TkTEMP + token = U8(TkTEMP) } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+26207 /* "temporary" */, 9) == 0) { - token = TkTEMP + token = U8(TkTEMP) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -156060,11 +156060,11 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: case 'E': { if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+26217 /* "end" */, 3) == 0) { - token = TkEND + token = U8(TkEND) } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+26221 /* "explain" */, 7) == 0) { - token = TkEXPLAIN + token = U8(TkEXPLAIN) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -156072,7 +156072,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough default: { - token = TkOTHER + token = U8(TkOTHER) break } @@ -156080,7 +156080,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: zSql += (uintptr(nId - 1)) } else { // Operators and special symbols - token = TkOTHER + token = U8(TkOTHER) } break @@ -156118,8 +156118,8 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16088 return rc } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zSql, SQLITE_UTF16LE, uintptr(0)) - zSql8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zSql, uint8(SQLITE_UTF16LE), uintptr(0)) + zSql8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zSql8 != 0 { rc = Xsqlite3_complete(tls, zSql8) } else { @@ -156614,11 +156614,11 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // silently truncated if necessary so that it does not exceed the // compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE // compile-time option. - if (mxMmap < int64(0)) || (mxMmap > SQLITE_MAX_MMAP_SIZE) { - mxMmap = SQLITE_MAX_MMAP_SIZE + if (mxMmap < int64(0)) || (mxMmap > int64(SQLITE_MAX_MMAP_SIZE)) { + mxMmap = int64(SQLITE_MAX_MMAP_SIZE) } if szMmap < int64(0) { - szMmap = SQLITE_DEFAULT_MMAP_SIZE + szMmap = int64(SQLITE_DEFAULT_MMAP_SIZE) } if szMmap > mxMmap { szMmap = mxMmap @@ -156709,10 +156709,10 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32 } if sz >= (LOOKASIDE_SMALL * 3) { nBig = (int32(szAlloc / (Sqlite3_int64((3 * LOOKASIDE_SMALL) + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz >= (LOOKASIDE_SMALL * 2) { nBig = (int32(szAlloc / (Sqlite3_int64(LOOKASIDE_SMALL + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz > 0 { nBig = (int32(szAlloc / Sqlite3_int64(sz))) nSm = 0 @@ -156885,22 +156885,22 @@ var aFlagOp = [16]struct { Fop int32 Fmask U32 }{ - {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: SQLITE_ForeignKeys}, - {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: SQLITE_EnableTrigger}, + {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: U32(SQLITE_ForeignKeys)}, + {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: U32(SQLITE_EnableTrigger)}, {Fop: SQLITE_DBCONFIG_ENABLE_VIEW, Fmask: SQLITE_EnableView}, - {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: SQLITE_Fts3Tokenizer}, - {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: SQLITE_LoadExtension}, - {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: SQLITE_NoCkptOnClose}, - {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: SQLITE_EnableQPSG}, - {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: SQLITE_TriggerEQP}, - {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: SQLITE_ResetDatabase}, - {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: SQLITE_Defensive}, + {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: U32(SQLITE_Fts3Tokenizer)}, + {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: U32(SQLITE_LoadExtension)}, + {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: U32(SQLITE_NoCkptOnClose)}, + {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: U32(SQLITE_EnableQPSG)}, + {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: U32(SQLITE_TriggerEQP)}, + {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: U32(SQLITE_ResetDatabase)}, + {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: U32(SQLITE_Defensive)}, {Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: (U32(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, - {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: SQLITE_LegacyAlter}, - {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: SQLITE_DqsDDL}, - {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: SQLITE_DqsDML}, - {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: SQLITE_LegacyFileFmt}, - {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: SQLITE_TrustedSchema}, + {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: U32(SQLITE_LegacyAlter)}, + {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: U32(SQLITE_DqsDDL)}, + {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: U32(SQLITE_DqsDML)}, + {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: U32(SQLITE_LegacyFileFmt)}, + {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: U32(SQLITE_TrustedSchema)}, } /* sqlite3.c:161939:9 */ // This is the default collating function named "BINARY" which is always @@ -157076,7 +157076,7 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_CLOSE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_CLOSE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) } // Force xDisconnect calls on all virtual tables @@ -157100,7 +157100,7 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit } // Convert the connection into a zombie and then close it. - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_ZOMBIE + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_ZOMBIE) Xsqlite3LeaveMutexAndCloseZombie(tls, db) return SQLITE_OK } @@ -157133,7 +157133,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: // If there are outstanding sqlite3_stmt or sqlite3_backup objects // or if the connection has not yet been closed by sqlite3_close_v2(), // then just leave the mutex and return. - if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != SQLITE_MAGIC_ZOMBIE) || (connectionIsBusy(tls, db) != 0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != U32(SQLITE_MAGIC_ZOMBIE)) || (connectionIsBusy(tls, db) != 0) { Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return } @@ -157247,7 +157247,7 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // the database rollback and schema reset, which can cause false // corruption reports in some cases. Xsqlite3BtreeEnterAll(tls, db) - schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) + schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt @@ -157270,7 +157270,7 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // Any deferred constraint violations have now been resolved. (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) // If one has been configured, invoke the rollback-hook callback if ((*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0) && ((inTrans != 0) || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) { @@ -157796,7 +157796,7 @@ func Xsqlite3CreateFunc(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 = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(0)) - if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { + if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, ts+28552 /* "unable to delete..." */, 0) @@ -157821,7 +157821,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++ } *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) = pDestructor - (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) | U32(extraFlags)) + (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) | U32(extraFlags)) (*FuncDef)(unsafe.Pointer(p)).FxSFunc = func() uintptr { if xSFunc != 0 { @@ -157905,7 +157905,7 @@ func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, SQLITE_UTF16LE) + zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, uint8(SQLITE_UTF16LE)) rc = Xsqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3DbFree(tls, db, zFunc8) rc = Xsqlite3ApiExit(tls, db, rc) @@ -157948,7 +157948,7 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i var zCopy uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, SQLITE_UTF8, uint8(0)) != uintptr(0))) + rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0))) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if rc != 0 { return SQLITE_OK @@ -157976,7 +157976,7 @@ func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uin pOld = (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg (*Sqlite3)(unsafe.Pointer(db)).FmTrace = func() uint8 { if xTrace != 0 { - return SQLITE_TRACE_LEGACY + return uint8(SQLITE_TRACE_LEGACY) } return uint8(0) }() @@ -158506,7 +158506,7 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u zVfs = zDefaultVfs nUri = Xsqlite3Strlen30(tls, zUri) - if !(((((flags & SQLITE_OPEN_URI) != 0) || // IMP: R-48725-32206 + if !(((((flags & uint32(SQLITE_OPEN_URI)) != 0) || // IMP: R-48725-32206 (Xsqlite3Config.FbOpenUri != 0)) && // IMP: R-51689-46548 (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+28755 /* "file:" */, uint64(5)) == 0)) { goto __1 @@ -158516,7 +158516,7 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u // 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 = flags | (SQLITE_OPEN_URI) + flags = flags | (uint32(SQLITE_OPEN_URI)) iIn = 0 __3: @@ -158877,13 +158877,13 @@ __1: isThreadsafe = 0 goto __3 __2: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_NOMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_NOMUTEX)) != 0) { goto __4 } isThreadsafe = 0 goto __5 __4: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_FULLMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_FULLMUTEX)) != 0) { goto __6 } isThreadsafe = 1 @@ -158897,7 +158897,7 @@ __5: __3: ; - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_PRIVATECACHE) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_PRIVATECACHE)) != 0) { goto __8 } *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_SHAREDCACHE)) @@ -158906,7 +158906,7 @@ __8: if !(Xsqlite3Config.FsharedCacheEnabled != 0) { goto __10 } - *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= SQLITE_OPEN_SHAREDCACHE + *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= uint32(SQLITE_OPEN_SHAREDCACHE) __10: ; __9: @@ -158968,8 +158968,8 @@ __12: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(((((((uint32(SQLITE_ShortColNames | SQLITE_EnableTrigger)) | SQLITE_EnableView) | - SQLITE_CacheSpill) | - SQLITE_TrustedSchema) | + uint32(SQLITE_CacheSpill)) | + uint32(SQLITE_TrustedSchema)) | // The SQLITE_DQS compile-time option determines the default settings // for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML. // @@ -158984,10 +158984,10 @@ __12: // Legacy behavior is 3 (double-quoted string literals are allowed anywhere) // and so that is the default. But developers are encouranged to use // -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible. - SQLITE_DqsDML) | - SQLITE_DqsDDL) | + uint32(SQLITE_DqsDML)) | + uint32(SQLITE_DqsDDL)) | - SQLITE_AutoIndex)) + uint32(SQLITE_AutoIndex))) Xsqlite3HashInit(tls, (db + 600 /* &.aCollSeq */)) Xsqlite3HashInit(tls, (db + 528 /* &.aModule */)) @@ -158997,19 +158997,19 @@ __12: // // EVIDENCE-OF: R-52786-44878 SQLite defines three built-in collating // functions: - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16BE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16LE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, ts+24752 /* "NOCASE" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+24752 /* "NOCASE" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{nocaseCollatingFunc})), uintptr(0)) - createCollation(tls, db, ts+28892 /* "RTRIM" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+28892 /* "RTRIM" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{rtrimCollFunc})), uintptr(0)) if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -159066,7 +159066,7 @@ __18: // Open the backend database driver rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 16 /* zOpen */)), db, ((*Sqlite3)(unsafe.Pointer(db)).FaDb + 8 /* &.pBt */), 0, - (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | SQLITE_OPEN_MAIN_DB))) + (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | uint32(SQLITE_OPEN_MAIN_DB)))) if !(rc != SQLITE_OK) { goto __20 } @@ -159096,7 +159096,7 @@ __22: (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 9513 /* "main" */ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = (U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)) (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 26202 /* "temp" */ - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = PAGER_SYNCHRONOUS_OFF + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = U8(PAGER_SYNCHRONOUS_OFF) (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_OPEN if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -159181,7 +159181,7 @@ __31: if !(rc != SQLITE_OK) { goto __33 } - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_SICK + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_SICK) __33: ; __32: @@ -159216,14 +159216,14 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* zFilename = ts + 28898 /* "\x00\x00" */ } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, SQLITE_UTF16LE, uintptr(0)) - zFilename8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(SQLITE_UTF16LE), uintptr(0)) + zFilename8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zFilename8 != 0 { rc = openDatabase(tls, zFilename8, ppDb, (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0)) if (rc == SQLITE_OK) && !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) { - ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, SQLITE_UTF16LE) + ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, U8(SQLITE_UTF16LE)) } } else { rc = SQLITE_NOMEM @@ -159257,7 +159257,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, SQLITE_UTF16LE) + zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, uint8(SQLITE_UTF16LE)) if zName8 != 0 { rc = createCollation(tls, db, zName8, U8(enc), pCtx, xCompare, uintptr(0)) Xsqlite3DbFree(tls, db, zName8) @@ -159421,7 +159421,7 @@ __7: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __9 } - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { goto __10 } iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) @@ -159457,7 +159457,7 @@ __4: zCollSeq = (*Column)(unsafe.Pointer(pCol)).FzColl notnull = (libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0)) primarykey = (libc.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0)) - autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)))) + autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)))) goto __13 __12: zDataType = ts + 14942 /* "INTEGER" */ @@ -159836,7 +159836,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: { var db uintptr = libc.VaUintptr(&ap) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (DBFLAG_InternalFunc) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (U32(DBFLAG_InternalFunc)) break } @@ -161453,7 +161453,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 { var z uintptr = Xsqlite3_value_text(tls, pValue) var n U32 = U32(Xsqlite3_value_bytes(tls, pValue)) - if Xsqlite3_value_subtype(tls, pValue) == JSON_SUBTYPE { + if Xsqlite3_value_subtype(tls, pValue) == uint32(JSON_SUBTYPE) { jsonAppendRaw(tls, p, z, n) } else { jsonAppendString(tls, p, z, n) @@ -161484,7 +161484,7 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ } return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})) }(), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) jsonZero(tls, p) } @@ -161633,7 +161633,7 @@ func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr jsonInit(tls, bp /* &s */, pCtx) jsonRenderNode(tls, pNode, bp /* &s */, aReplace) jsonResult(tls, bp /* &s */) - Xsqlite3_result_subtype(tls, pCtx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, pCtx, uint32(JSON_SUBTYPE)) } // Translate a single byte of Hex into an integer. @@ -161778,7 +161778,7 @@ int_as_real: __6: z1 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) - Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), SQLITE_UTF8) + Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), uint8(SQLITE_UTF8)) Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp /* r */))) goto __1 @@ -161998,7 +161998,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } if (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i)))))) == '{' { // Parse object - iThis = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -162055,7 +162055,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 return (int32(j + U32(1))) } else if int32(c) == '[' { // Parse array - iThis = jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -162104,7 +162104,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 if ((((((((int32(c) == '"') || (int32(c) == '\\')) || (int32(c) == '/')) || (int32(c) == 'b')) || (int32(c) == 'f')) || (int32(c) == 'n')) || (int32(c) == 'r')) || (int32(c) == 't')) || ((int32(c) == 'u') && (jsonIs4Hex(tls, ((z+uintptr(j))+uintptr(1))) != 0)) { - jnFlags = JNODE_ESCAPE + jnFlags = U8(JNODE_ESCAPE) } else { return -1 } @@ -162113,7 +162113,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } j++ } - jsonParseAddNode(tls, pParse, JSON_STRING, ((j + U32(1)) - i), (z + uintptr(i))) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), ((j + U32(1)) - i), (z + uintptr(i))) if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) { (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)).FjnFlags = jnFlags } @@ -162121,17 +162121,17 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } else if ((int32(c) == 'n') && (libc.Xstrncmp(tls, (z+uintptr(i)), ts+9023 /* "null" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 't') && (libc.Xstrncmp(tls, (z+uintptr(i)), ts+10724 /* "true" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 'f') && (libc.Xstrncmp(tls, (z+uintptr(i)), ts+10729 /* "false" */, uint64(5)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(5))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_FALSE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_FALSE), uint32(0), uintptr(0)) return (int32(i + U32(5))) } else if (int32(c) == '-') || ((int32(c) >= '0') && (int32(c) <= '9')) { // Parse number @@ -162189,9 +162189,9 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } jsonParseAddNode(tls, pParse, func() uint32 { if seenDP != 0 { - return JSON_REAL + return uint32(JSON_REAL) } - return JSON_INT + return uint32(JSON_INT) }(), (j - i), (z + uintptr(i))) return int32(j) @@ -162436,8 +162436,8 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp var iStart U32 var iLabel U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0))) - iLabel = U32(jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey)) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0))) + iLabel = U32(jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey)) zPath += uintptr(i) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { @@ -162526,7 +162526,7 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp if (i == U32(0)) && (pApnd != 0) { var iStart U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(1), uintptr(0))) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(1), uintptr(0))) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) @@ -162549,16 +162549,16 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186690:17: */ *(*int32)(unsafe.Pointer(pApnd)) = 1 if int32(*(*int8)(unsafe.Pointer(zPath))) == 0 { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } return ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16) } if int32(*(*int8)(unsafe.Pointer(zPath))) == '.' { - jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) } else if libc.Xstrncmp(tls, zPath, ts+29103 /* "[0]" */, uint64(3)) == 0 { - jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) } else { return uintptr(0) } @@ -162690,7 +162690,7 @@ func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq jsonInit(tls, bp /* &jx */, ctx) jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv))) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // Implementation of the json_array(VALUE,...) function. Return a JSON @@ -162711,7 +162711,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq } jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_array_length(JSON) @@ -162794,7 +162794,7 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* if (argc > 2) && (i == argc) { jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } jsonReset(tls, bp /* &jx */) } @@ -162848,9 +162848,9 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) if (j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn) && (int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*16)).FeType) != JSON_NULL) { var iStart int32 var iPatch int32 - iStart = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0)) - jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey) - iPatch = jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + iStart = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey) + iPatch = jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } @@ -162933,7 +162933,7 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s } jsonAppendChar(tls, bp /* &jx */, int8('}')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_remove(JSON, PATH, ...) @@ -163055,7 +163055,7 @@ __7: if !(pNode != 0) { goto __8 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __8: ; @@ -163152,7 +163152,7 @@ __9: if !((pNode != 0) && ((*(*int32)(unsafe.Pointer(bp + 48 /* bApnd */)) != 0) || (bIsSet != 0))) { goto __11 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __11: ; @@ -163266,7 +163266,7 @@ func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c: } else { Xsqlite3_result_text(tls, ctx, ts+29272 /* "[]" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187353:13: */ @@ -163370,7 +163370,7 @@ func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c } else { Xsqlite3_result_text(tls, ctx, ts+29275 /* "{}" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187460:13: */ @@ -164229,7 +164229,7 @@ func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:188649:13 // Given a node number iNode, return the corresponding key to use // in the Rtree.aHash table. func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:188658:21: */ - return ((uint32(iNode)) % HASHSIZE) + return ((uint32(iNode)) % uint32(HASHSIZE)) } // Search the node hash table for node iNode. If found, return a pointer @@ -165415,7 +165415,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -165474,7 +165474,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt } (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -165577,27 +165577,27 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql var op U8 switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) { case SQLITE_INDEX_CONSTRAINT_EQ: - op = RTREE_EQ + op = U8(RTREE_EQ) break fallthrough case SQLITE_INDEX_CONSTRAINT_GT: - op = RTREE_GT + op = U8(RTREE_GT) break fallthrough case SQLITE_INDEX_CONSTRAINT_LE: - op = RTREE_LE + op = U8(RTREE_LE) break fallthrough case SQLITE_INDEX_CONSTRAINT_LT: - op = RTREE_LT + op = U8(RTREE_LT) break fallthrough case SQLITE_INDEX_CONSTRAINT_GE: - op = RTREE_GE + op = U8(RTREE_GE) break fallthrough case SQLITE_INDEX_CONSTRAINT_MATCH: - op = RTREE_MATCH + op = U8(RTREE_MATCH) break fallthrough default: @@ -166568,7 +166568,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei var rc int32 = SQLITE_OK var n int32 - libc.X__builtin___memset_chk(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * RTREE_MAX_DIMENSIONS), libc.X__builtin_object_size(tls, bp /* &aCenterCoord[0] */, 0)) + libc.X__builtin___memset_chk(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * uint64(RTREE_MAX_DIMENSIONS)), libc.X__builtin_object_size(tls, bp /* &aCenterCoord[0] */, 0)) nCell = (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) + 1) n = ((nCell + 1) & (libc.CplInt32(1))) @@ -167208,7 +167208,7 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit rc = Xsqlite3_table_column_metadata(tls, db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+13637 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == SQLITE_ERROR { return SQLITE_OK } @@ -167230,13 +167230,13 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit if rc == SQLITE_OK { if nRow == int64(0) { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) } else { (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 { - if (nRow) > (RTREE_MIN_ROWEST) { + if (nRow) > (int64(RTREE_MIN_ROWEST)) { return nRow } - return RTREE_MIN_ROWEST + return int64(RTREE_MIN_ROWEST) }() } } @@ -168445,7 +168445,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit // is available // var r float64 at bp, 8 - Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, SQLITE_UTF8) + Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, uint8(SQLITE_UTF8)) *(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp /* r */))) } *(*uintptr)(unsafe.Pointer(p /* &.z */)) += (uintptr(j)) @@ -169728,7 +169728,7 @@ __1: (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule)) (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + 1*968) (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + int64(1)))) - (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = RTREE_COORD_REAL32 + (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(RTREE_COORD_REAL32) (*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2) (*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4) libc.X__builtin___memcpy_chk(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb), libc.X__builtin_object_size(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, 0)) @@ -169880,7 +169880,7 @@ func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -169971,7 +169971,7 @@ __12: ; (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -170455,11 +170455,11 @@ func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20 }{rtreecheck})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_REAL32 + var c uintptr = uintptr(RTREE_COORD_REAL32) rc = Xsqlite3_create_module_v2(tls, db, ts+32096 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_INT32 + var c uintptr = uintptr(RTREE_COORD_INT32) rc = Xsqlite3_create_module_v2(tls, db, ts+32384 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { @@ -172395,7 +172395,6 @@ __15: goto __14 goto __16 __16: - } // This is a helper function for rbuObjIterCacheTableInfo(). It populates @@ -177731,7 +177730,7 @@ func dbpageUpdate(tls *libc.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid rc = SQLITE_OK zErr = uintptr(0) - if !(((*Sqlite3)(unsafe.Pointer((*DbpageTable)(unsafe.Pointer(pTab)).Fdb)).Fflags & SQLITE_Defensive) != 0) { + if !(((*Sqlite3)(unsafe.Pointer((*DbpageTable)(unsafe.Pointer(pTab)).Fdb)).Fflags & uint64(SQLITE_Defensive)) != 0) { goto __1 } zErr = ts + 37382 /* "read-only" */ @@ -180641,7 +180640,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_OK var nCmd int32 = int32(libc.Xstrlen(tls, zCmd)) if Xsqlite3_strnicmp(tls, ts+37667 /* "prefix" */, zCmd, nCmd) == 0 { - var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * FTS5_MAX_PREFIX_INDEXES)) + var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * uint64(FTS5_MAX_PREFIX_INDEXES))) var p uintptr var bFirst int32 = 1 if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -185653,7 +185652,7 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 if rc == SQLITE_OK { var aOut uintptr = uintptr(0) // Read blob data into this buffer var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader) - var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + FTS5_DATA_PADDING)) + var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + uint64(FTS5_DATA_PADDING))) pRet = Xsqlite3_malloc64(tls, uint64(nAlloc)) if pRet != 0 { (*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte @@ -185959,10 +185958,10 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c: // Configuration cookie var pData uintptr - pData = fts5DataRead(tls, p, FTS5_STRUCTURE_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_STRUCTURE_ROWID)) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { // TODO: Do we need this if the leaf-index is appended? Probably... - libc.X__builtin___memset_chk(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, FTS5_DATA_PADDING, libc.X__builtin_object_size(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0)) + libc.X__builtin___memset_chk(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, uint64(FTS5_DATA_PADDING), libc.X__builtin_object_size(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0)) (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp /* &iCookie */, bp+8 /* &pRet */) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0) || ((*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp /* iCookie */)))) { (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp /* iCookie */))) @@ -186089,7 +186088,7 @@ func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3. } } - fts5DataWrite(tls, p, FTS5_STRUCTURE_ROWID, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) + fts5DataWrite(tls, p, int64(FTS5_STRUCTURE_ROWID), (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) sqlite3Fts5BufferFree(tls, bp /* &buf */) } } @@ -188079,7 +188078,7 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, } return sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), pBuf, (uint32(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + FTS5_DATA_ZERO_PADDING) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn))) }()) { - libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, FTS5_DATA_ZERO_PADDING, libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0)) + libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, uint64(FTS5_DATA_ZERO_PADDING), libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn+(*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0)) if pColset == uintptr(0) { fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32) @@ -189736,7 +189735,7 @@ func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBu *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (nData) } - libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, FTS5_DATA_ZERO_PADDING, libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0)) + libc.X__builtin___memset_chk(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, uint64(FTS5_DATA_ZERO_PADDING), libc.X__builtin_object_size(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0)) } } @@ -190151,7 +190150,7 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, } fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) - pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + FTS5_DATA_ZERO_PADDING))) + pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + uint64(FTS5_DATA_ZERO_PADDING)))) if pData != 0 { (*Fts5Data)(unsafe.Pointer(pData)).Fp = (pData + 1*16) (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+12 /* &.szLeaf */, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn) @@ -190220,7 +190219,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22158 fts5StructureInvalidate(tls, p) fts5IndexDiscardData(tls, p) libc.X__builtin___memset_chk(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Fts5Structure{})), libc.X__builtin_object_size(tls, bp /* &s */, 0)) - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, ts+810 /* "" */, 0) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+810 /* "" */, 0) fts5StructureWrite(tls, p, bp /* &s */) return fts5IndexReturn(tls, p) } @@ -190497,7 +190496,7 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize *(*I64)(unsafe.Pointer(pnRow)) = int64(0) libc.X__builtin___memset_chk(tls, anSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64(nCol)), libc.X__builtin_object_size(tls, anSize, 0)) - pData = fts5DataRead(tls, p, FTS5_AVERAGES_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID)) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0) { var i int32 = 0 var iCol int32 @@ -190515,7 +190514,7 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize // supplied as the second argument. func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:221923:12: */ - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, pData, nData) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData) return fts5IndexReturn(tls, p) } @@ -190543,7 +190542,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3Fts5Put32(tls, bp /* &aCookie[0] */, iNew) rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, - ts+38923 /* "block" */, FTS5_STRUCTURE_ROWID, 1, bp+8 /* &pBlob */) + ts+38923 /* "block" */, int64(FTS5_STRUCTURE_ROWID), 1, bp+8 /* &pBlob */) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)), bp /* &aCookie[0] */, 4, 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */))) @@ -190944,7 +190943,7 @@ func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sql fts5DecodeRowid(tls, iKey, bp+32 /* &iSegid */, bp+36 /* &bDlidx */, bp+40 /* &iHeight */, bp+44 /* &iPgno */) if *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)) == 0 { - if iKey == FTS5_AVERAGES_ROWID { + if iKey == int64(FTS5_AVERAGES_ROWID) { sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+39406 /* "{averages} " */, 0) } else { sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+39418 /* "{structure}" */, 0) @@ -191244,7 +191243,7 @@ __3: if !(*(*int32)(unsafe.Pointer(bp + 68 /* iSegid */)) == 0) { goto __8 } - if !(iRowid == FTS5_AVERAGES_ROWID) { + if !(iRowid == int64(FTS5_AVERAGES_ROWID)) { goto __10 } fts5DecodeAverages(tls, bp+64 /* &rc */, bp+48 /* &s */, a, n) @@ -192284,7 +192283,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u rc = SQLITE_NOMEM } else { rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+8 /* &pRet */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+8 /* &pRet */, uintptr(0)) if rc != SQLITE_OK { *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+834 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) } @@ -192439,7 +192438,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+24 /* &pStmt */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+24 /* &pStmt */, uintptr(0)) Xsqlite3_free(tls, zSql) if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { @@ -197636,7 +197635,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -197645,13 +197644,13 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -197665,7 +197664,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -197696,7 +197695,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -197710,7 +197709,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -197719,7 +197718,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -197742,7 +197741,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) diff --git a/speedtest1/main_darwin_arm64.go b/speedtest1/main_darwin_arm64.go index 91b8597..841b971 100644 --- a/speedtest1/main_darwin_arm64.go +++ b/speedtest1/main_darwin_arm64.go @@ -11937,7 +11937,7 @@ func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */ fallthrough case 'B': sqlite3.Xsqlite3_bind_text64(tls, g.pStmt, (int32(j + uint32(2))), bp+16 /* &zNum[0] */, uint64(len), - uintptr(0), SQLITE_UTF8) + uintptr(0), uint8(SQLITE_UTF8)) break } }