use math.MaxInt32. related issue #238

type
Yasuhiro Matsumoto 2015-09-16 15:22:36 +09:00
parent 09259a5557
commit fdc70a0fab
1 changed files with 3 additions and 4 deletions

View File

@ -22,22 +22,21 @@ import "C"
import (
"errors"
"fmt"
"math"
"reflect"
"unsafe"
)
//export callbackTrampoline
func callbackTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) {
// TODO should create slice dynamically?
args := (*[1 << 20]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
args := (*[math.MaxInt32 - 1]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
fi := (*functionInfo)(unsafe.Pointer(C.sqlite3_user_data(ctx)))
fi.Call(ctx, args)
}
//export stepTrampoline
func stepTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) {
// TODO should create slice dynamically?
args := (*[1 << 20]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
args := (*[math.MaxInt32 - 1]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
ai := (*aggInfo)(unsafe.Pointer(C.sqlite3_user_data(ctx)))
ai.Step(ctx, args)
}