etactica / lua-libmodbus

lua bindings to libmodbus
MIT License
33 stars 27 forks source link

get_s16 doesn't work well with lnum patch #4

Closed karlp closed 6 years ago

karlp commented 6 years ago

on lua5.1 and 5.3 vanilla, the get_s16(-5) call "correctly" returns -5 as expected

Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio (double int32)
> mb=require("libmodbus")
> =mb.get_s16(-5)
0
> =mb.get_s16(5)
5
> =mb.get_s16(0xface)
-1330
> 
karlp commented 6 years ago

Same for get_u32 and get_u32le.