diff --git a/golua/lua/golua_c_lua51.go b/golua/lua/golua_c_lua51.go index 5348dc6..6b3ba4c 100644 --- a/golua/lua/golua_c_lua51.go +++ b/golua/lua/golua_c_lua51.go @@ -1,4 +1,5 @@ -//+build !lua52,!lua53,!lua54 +//go:build !lua52 && !lua53 && !lua54 +// +build !lua52,!lua53,!lua54 package lua @@ -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 { diff --git a/golua/lua/golua_c_lua52.go b/golua/lua/golua_c_lua52.go index 6195393..9cddcdc 100644 --- a/golua/lua/golua_c_lua52.go +++ b/golua/lua/golua_c_lua52.go @@ -1,4 +1,5 @@ -//+build lua52 +//go:build lua52 +// +build lua52 package lua @@ -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 { diff --git a/golua/lua/golua_c_lua53.go b/golua/lua/golua_c_lua53.go index d490b1b..2346b0c 100644 --- a/golua/lua/golua_c_lua53.go +++ b/golua/lua/golua_c_lua53.go @@ -1,4 +1,5 @@ -//+build lua53 +//go:build lua53 +// +build lua53 package lua @@ -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 { diff --git a/golua/lua/golua_c_lua54.go b/golua/lua/golua_c_lua54.go index 9acafe5..edcbf24 100644 --- a/golua/lua/golua_c_lua54.go +++ b/golua/lua/golua_c_lua54.go @@ -1,4 +1,5 @@ -//+build lua54 +//go:build lua54 +// +build lua54 package lua @@ -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 {