diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/wslua/wslua_nstime.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | epan/wslua/wslua_nstime.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/epan/wslua/wslua_nstime.c b/epan/wslua/wslua_nstime.c index b3012e71..94db190a 100644 --- a/epan/wslua/wslua_nstime.c +++ b/epan/wslua/wslua_nstime.c @@ -54,9 +54,7 @@ WSLUA_METAMETHOD NSTime__call(lua_State* L) { /* Creates a NSTime object. */ } WSLUA_METHOD NSTime_tonumber(lua_State* L) { - /* Returns a Lua number of the `NSTime` representing seconds from epoch - @since 2.4.0 - */ + /* Returns a Lua number of the `NSTime` representing seconds from epoch. */ NSTime nstime = checkNSTime(L,1); lua_pushnumber(L, (lua_Number)nstime_to_sec(nstime)); WSLUA_RETURN(1); /* The Lua number. */ @@ -64,10 +62,10 @@ WSLUA_METHOD NSTime_tonumber(lua_State* L) { WSLUA_METAMETHOD NSTime__tostring(lua_State* L) { NSTime nstime = checkNSTime(L,1); - gchar *str; + char *str; long secs = (long)nstime->secs; - gint nsecs = nstime->nsecs; - gboolean negative_zero = FALSE; + int nsecs = nstime->nsecs; + bool negative_zero = false; /* Time is defined as sec + nsec/10^9, both parts can be negative. * Translate this into the more familiar sec.nsec notation instead. */ @@ -133,10 +131,10 @@ WSLUA_METAMETHOD NSTime__unm(lua_State* L) { /* Calculates the negative NSTime. WSLUA_METAMETHOD NSTime__eq(lua_State* L) { /* Compares two NSTimes. */ NSTime time1 = checkNSTime(L,1); NSTime time2 = checkNSTime(L,2); - gboolean result = FALSE; + bool result = false; if (nstime_cmp(time1, time2) == 0) - result = TRUE; + result = true; lua_pushboolean(L,result); @@ -146,10 +144,10 @@ WSLUA_METAMETHOD NSTime__eq(lua_State* L) { /* Compares two NSTimes. */ WSLUA_METAMETHOD NSTime__le(lua_State* L) { /* Compares two NSTimes. */ NSTime time1 = checkNSTime(L,1); NSTime time2 = checkNSTime(L,2); - gboolean result = FALSE; + bool result = false; if (nstime_cmp(time1, time2) <= 0) - result = TRUE; + result = true; lua_pushboolean(L,result); @@ -159,10 +157,10 @@ WSLUA_METAMETHOD NSTime__le(lua_State* L) { /* Compares two NSTimes. */ WSLUA_METAMETHOD NSTime__lt(lua_State* L) { /* Compares two NSTimes. */ NSTime time1 = checkNSTime(L,1); NSTime time2 = checkNSTime(L,2); - gboolean result = FALSE; + bool result = false; if (nstime_cmp(time1, time2) < 0) - result = TRUE; + result = true; lua_pushboolean(L,result); @@ -171,12 +169,12 @@ WSLUA_METAMETHOD NSTime__lt(lua_State* L) { /* Compares two NSTimes. */ /* WSLUA_ATTRIBUTE NSTime_secs RW The NSTime seconds. */ -WSLUA_ATTRIBUTE_NUMBER_GETTER(NSTime,secs); -WSLUA_ATTRIBUTE_NUMBER_SETTER(NSTime,secs,time_t); +WSLUA_ATTRIBUTE_INTEGER_GETTER(NSTime,secs); +WSLUA_ATTRIBUTE_INTEGER_SETTER(NSTime,secs,time_t); /* WSLUA_ATTRIBUTE NSTime_nsecs RW The NSTime nano seconds. */ -WSLUA_ATTRIBUTE_NUMBER_GETTER(NSTime,nsecs); -WSLUA_ATTRIBUTE_NUMBER_SETTER(NSTime,nsecs,int); +WSLUA_ATTRIBUTE_INTEGER_GETTER(NSTime,nsecs); +WSLUA_ATTRIBUTE_INTEGER_SETTER(NSTime,nsecs,int); /* Gets registered as metamethod automatically by WSLUA_REGISTER_CLASS/META */ static int NSTime__gc(lua_State* L) { |