Skip to content

Commit

Permalink
modify integer type
Browse files Browse the repository at this point in the history
  • Loading branch information
missdeer committed Jan 16, 2024
1 parent 7525c49 commit 0a8db2e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions golua/lua/golua_c_lua51.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build !lua52,!lua53,!lua54
//go:build !lua52 && !lua53 && !lua54
// +build !lua52,!lua53,!lua54

package lua

Expand Down Expand Up @@ -110,8 +111,8 @@ import "C"

import "unsafe"

func luaToInteger(s *C.lua_State, n C.int) C.longlong {
return C.lua_tointeger(s, n)
func luaToInteger(s *C.lua_State, n C.int) C.int {
return C.int(C.lua_tointeger(s, n))
}

func luaToNumber(s *C.lua_State, n C.int) C.double {
Expand Down
7 changes: 4 additions & 3 deletions golua/lua/golua_c_lua52.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build lua52
//go:build lua52
// +build lua52

package lua

Expand Down Expand Up @@ -122,8 +123,8 @@ import "C"

import "unsafe"

func luaToInteger(s *C.lua_State, n C.int) C.longlong {
return C.lua_tointegerx(s, n, nil)
func luaToInteger(s *C.lua_State, n C.int) C.int {
return C.int(C.lua_tointegerx(s, n, nil))
}

func luaToNumber(s *C.lua_State, n C.int) C.double {
Expand Down
7 changes: 4 additions & 3 deletions golua/lua/golua_c_lua53.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build lua53
//go:build lua53
// +build lua53

package lua

Expand Down Expand Up @@ -122,8 +123,8 @@ import "C"

import "unsafe"

func luaToInteger(s *C.lua_State, n C.int) C.longlong {
return C.lua_tointegerx(s, n, nil)
func luaToInteger(s *C.lua_State, n C.int) C.int {
return C.int(C.lua_tointegerx(s, n, nil))
}

func luaToNumber(s *C.lua_State, n C.int) C.double {
Expand Down
7 changes: 4 additions & 3 deletions golua/lua/golua_c_lua54.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build lua54
//go:build lua54
// +build lua54

package lua

Expand Down Expand Up @@ -124,8 +125,8 @@ import "C"

import "unsafe"

func luaToInteger(s *C.lua_State, n C.int) C.longlong {
return C.lua_tointegerx(s, n, nil)
func luaToInteger(s *C.lua_State, n C.int) C.int {
return C.int(C.lua_tointegerx(s, n, nil))
}

func luaToNumber(s *C.lua_State, n C.int) C.double {
Expand Down

0 comments on commit 0a8db2e

Please sign in to comment.