summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/address.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-10-26 04:52:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-10-26 04:52:07 +0000
commit64d9a00a9934cd06401f4b9ec2e14950a4423a87 (patch)
tree99f8a9f96407f1420e36a37f02a000346dc6ca81 /libs/nixio/src/address.c
parent2181825db596a12d23f56fa8fbfebd94f99b13c4 (diff)
nixio: store stats and other number information as integer, which works better when lua number support is downgraded from double to float
Diffstat (limited to 'libs/nixio/src/address.c')
-rw-r--r--libs/nixio/src/address.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/nixio/src/address.c b/libs/nixio/src/address.c
index 41ab8a367..33f7ce413 100644
--- a/libs/nixio/src/address.c
+++ b/libs/nixio/src/address.c
@@ -323,7 +323,7 @@ static int nixio_sock_getsockname(lua_State *L) {
}
lua_pushstring(L, addr.host);
- lua_pushnumber(L, addr.port);
+ lua_pushinteger(L, addr.port);
return 2;
}
@@ -342,7 +342,7 @@ static int nixio_sock_getpeername(lua_State *L) {
}
lua_pushstring(L, addr.host);
- lua_pushnumber(L, addr.port);
+ lua_pushinteger(L, addr.port);
return 2;
}
@@ -420,34 +420,34 @@ static int nixio_getifaddrs(lua_State *L) {
lua_createtable(L, 0, 10);
struct nixio__nds *stats = c->ifa_data;
- lua_pushnumber(L, stats->rx_packets);
+ lua_pushinteger(L, stats->rx_packets);
lua_setfield(L, -2, "rx_packets");
- lua_pushnumber(L, stats->tx_packets);
+ lua_pushinteger(L, stats->tx_packets);
lua_setfield(L, -2, "tx_packets");
- lua_pushnumber(L, stats->rx_bytes);
+ lua_pushinteger(L, stats->rx_bytes);
lua_setfield(L, -2, "rx_bytes");
- lua_pushnumber(L, stats->tx_bytes);
+ lua_pushinteger(L, stats->tx_bytes);
lua_setfield(L, -2, "tx_bytes");
- lua_pushnumber(L, stats->rx_errors);
+ lua_pushinteger(L, stats->rx_errors);
lua_setfield(L, -2, "rx_errors");
- lua_pushnumber(L, stats->tx_errors);
+ lua_pushinteger(L, stats->tx_errors);
lua_setfield(L, -2, "tx_errors");
- lua_pushnumber(L, stats->rx_dropped);
+ lua_pushinteger(L, stats->rx_dropped);
lua_setfield(L, -2, "rx_dropped");
- lua_pushnumber(L, stats->tx_dropped);
+ lua_pushinteger(L, stats->tx_dropped);
lua_setfield(L, -2, "tx_dropped");
- lua_pushnumber(L, stats->multicast);
+ lua_pushinteger(L, stats->multicast);
lua_setfield(L, -2, "multicast");
- lua_pushnumber(L, stats->collisions);
+ lua_pushinteger(L, stats->collisions);
lua_setfield(L, -2, "collisions");
} else {
lua_newtable(L);