Lua: Add "tonumber" method to NSTime
authorSilvio Gissi <silvio.gissi@gmail.com>
Wed, 21 Jun 2017 19:46:45 +0000 (15:46 -0400)
committerGuy Harris <guy@alum.mit.edu>
Wed, 21 Jun 2017 23:50:27 +0000 (23:50 +0000)
commit59add43eecfbed3bae5d75dabe6e875b5adefe1b
tree34091c5a565ea91e02b2f83a3423b3a8aa7a2082
parent16f70b9bb1faf48d985e21fcfa92d1934c2b50f5
Lua: Add "tonumber" method to NSTime

Absolute and Relative time fields could not be converted to seconds
without converting to string and parsing to number.

Fixed conversion in generated code that was subject to precision loss

Usage:
f=Field.new("frame.delta_time")
delta=f().value:tonumber()

Change-Id: I6ef91c6238a6c2ed9adf6cae03f8913f0a09332e
Reviewed-on: https://code.wireshark.org/review/22316
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
epan/wslua/make-taps.pl
epan/wslua/wslua_nstime.c
test/lua/nstime.lua