Skip to content

Commit

Permalink
fix: Value.Int should work with int32.
Browse files Browse the repository at this point in the history
This applies to:

* `Value.Int() int32`
* `Value.SetInt(int32)`

refs #286
  • Loading branch information
pravic committed Feb 7, 2021
1 parent 81c00ac commit 3b44840
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sciter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2051,9 +2051,9 @@ func NewSymbol(sym string) *Value {
}

// UINT ValueIntData ( const VALUE* pval, INT* pData ) ;//{ return SAPI()->ValueIntData ( pval, pData ); }
func (pdst *Value) Int() int {
func (pdst *Value) Int() int32 {
cpdst := (*C.VALUE)(unsafe.Pointer(pdst))
var data int = 0
var data int32 = 0
pData := (*C.INT)(unsafe.Pointer(&data))
ret := VALUE_RESULT(C.ValueIntData(cpdst, pData))
if ret == HV_OK {
Expand All @@ -2063,7 +2063,7 @@ func (pdst *Value) Int() int {
}

// UINT ValueIntDataSet ( VALUE* pval, INT data, UINT type, UINT units ) ;//{ return SAPI()->ValueIntDataSet ( pval, data,type,units ); }
func (pdst *Value) SetInt(data int) error {
func (pdst *Value) SetInt(data int32) error {
cpdst := (*C.VALUE)(unsafe.Pointer(pdst))
// args
return wrapValueResult(VALUE_RESULT(C.ValueIntDataSet(cpdst, C.INT(data), T_INT, 0)), "ValueIntDataSet")
Expand Down

0 comments on commit 3b44840

Please sign in to comment.