Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gosqlite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gosqlite
Commits
78a62ead
Commit
78a62ead
authored
Nov 27, 2014
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warning: built-in function ‘free’ declared as non-function
parent
6f042750
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
stmt.go
stmt.go
+4
-2
No files found.
stmt.go
View file @
78a62ead
...
@@ -17,6 +17,9 @@ package sqlite
...
@@ -17,6 +17,9 @@ package sqlite
// #define SQLITE_STATIC ((sqlite3_destructor_type)0)
// #define SQLITE_STATIC ((sqlite3_destructor_type)0)
// #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
// #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
static inline int my_bind_text(sqlite3_stmt *stmt, int pidx, const char *data, int data_len) {
return sqlite3_bind_text(stmt, pidx, data, data_len, free);
}
static inline int my_bind_empty_text(sqlite3_stmt *stmt, int pidx) {
static inline int my_bind_empty_text(sqlite3_stmt *stmt, int pidx) {
return sqlite3_bind_text(stmt, pidx, "", 0, SQLITE_STATIC);
return sqlite3_bind_text(stmt, pidx, "", 0, SQLITE_STATIC);
}
}
...
@@ -355,8 +358,7 @@ func (s *Stmt) BindByIndex(index int, value interface{}) error {
...
@@ -355,8 +358,7 @@ func (s *Stmt) BindByIndex(index int, value interface{}) error {
if
i64
&&
len
(
value
)
>
math
.
MaxInt32
{
if
i64
&&
len
(
value
)
>
math
.
MaxInt32
{
return
s
.
specificError
(
"string too big: %d at index %d"
,
len
(
value
),
index
)
return
s
.
specificError
(
"string too big: %d at index %d"
,
len
(
value
),
index
)
}
}
f
:=
C
.
sqlite3_destructor_type
(
C
.
free
)
rv
=
C
.
my_bind_text
(
s
.
stmt
,
i
,
C
.
CString
(
value
),
C
.
int
(
len
(
value
)))
rv
=
C
.
sqlite3_bind_text
(
s
.
stmt
,
i
,
C
.
CString
(
value
),
C
.
int
(
len
(
value
)),
f
)
}
}
case
int
:
case
int
:
if
i64
{
if
i64
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment