Skip to content

Commit 8476602

Browse files
committed
fix all unconvert issues
1 parent 144deb6 commit 8476602

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sqlite3.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func (c *SQLiteConn) RegisterCommitHook(callback func() int) {
336336
if callback == nil {
337337
C.sqlite3_commit_hook(c.db, nil, nil)
338338
} else {
339-
C.sqlite3_commit_hook(c.db, (*[0]byte)(unsafe.Pointer(C.commitHookTrampoline)), unsafe.Pointer(newHandle(c, callback)))
339+
C.sqlite3_commit_hook(c.db, (*[0]byte)(C.commitHookTrampoline), unsafe.Pointer(newHandle(c, callback)))
340340
}
341341
}
342342

@@ -349,7 +349,7 @@ func (c *SQLiteConn) RegisterRollbackHook(callback func()) {
349349
if callback == nil {
350350
C.sqlite3_rollback_hook(c.db, nil, nil)
351351
} else {
352-
C.sqlite3_rollback_hook(c.db, (*[0]byte)(unsafe.Pointer(C.rollbackHookTrampoline)), unsafe.Pointer(newHandle(c, callback)))
352+
C.sqlite3_rollback_hook(c.db, (*[0]byte)(C.rollbackHookTrampoline), unsafe.Pointer(newHandle(c, callback)))
353353
}
354354
}
355355

@@ -366,7 +366,7 @@ func (c *SQLiteConn) RegisterUpdateHook(callback func(int, string, string, int64
366366
if callback == nil {
367367
C.sqlite3_update_hook(c.db, nil, nil)
368368
} else {
369-
C.sqlite3_update_hook(c.db, (*[0]byte)(unsafe.Pointer(C.updateHookTrampoline)), unsafe.Pointer(newHandle(c, callback)))
369+
C.sqlite3_update_hook(c.db, (*[0]byte)(C.updateHookTrampoline), unsafe.Pointer(newHandle(c, callback)))
370370
}
371371
}
372372

@@ -448,7 +448,7 @@ func (c *SQLiteConn) RegisterFunc(name string, impl interface{}, pure bool) erro
448448
}
449449

450450
func sqlite3CreateFunction(db *C.sqlite3, zFunctionName *C.char, nArg C.int, eTextRep C.int, pApp uintptr, xFunc unsafe.Pointer, xStep unsafe.Pointer, xFinal unsafe.Pointer) C.int {
451-
return C._sqlite3_create_function(db, zFunctionName, nArg, eTextRep, C.uintptr_t(pApp), (*[0]byte)(unsafe.Pointer(xFunc)), (*[0]byte)(unsafe.Pointer(xStep)), (*[0]byte)(unsafe.Pointer(xFinal)))
451+
return C._sqlite3_create_function(db, zFunctionName, nArg, eTextRep, C.uintptr_t(pApp), (*[0]byte)(xFunc), (*[0]byte)(xStep), (*[0]byte)(xFinal))
452452
}
453453

454454
// AutoCommit return which currently auto commit or not.
@@ -859,7 +859,7 @@ func (s *SQLiteStmt) bind(args []namedValue) error {
859859
case int64:
860860
rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v))
861861
case bool:
862-
if bool(v) {
862+
if v {
863863
rv = C.sqlite3_bind_int(s.s, n, 1)
864864
} else {
865865
rv = C.sqlite3_bind_int(s.s, n, 0)
@@ -1070,10 +1070,10 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
10701070
n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
10711071
switch dest[i].(type) {
10721072
case sql.RawBytes:
1073-
dest[i] = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
1073+
dest[i] = (*[1 << 30]byte)(p)[0:n]
10741074
default:
10751075
slice := make([]byte, n)
1076-
copy(slice[:], (*[1 << 30]byte)(unsafe.Pointer(p))[0:n])
1076+
copy(slice[:], (*[1 << 30]byte)(p)[0:n])
10771077
dest[i] = slice
10781078
}
10791079
case C.SQLITE_NULL:

0 commit comments

Comments
 (0)