diff --git a/common/luaobject.c b/common/luaobject.c index 3e20a03c..ddaa37e4 100644 --- a/common/luaobject.c +++ b/common/luaobject.c @@ -84,7 +84,7 @@ luaA_object_incref(lua_State *L, int tud, int oud) /* Get the number of references */ lua_rawget(L, -2); /* Get the number of references and increment it */ - int count = lua_tonumber(L, -1) + 1; + int count = lua_tointeger(L, -1) + 1; lua_pop(L, 1); /* Push the pointer (key) */ lua_pushlightuserdata(L, pointer); @@ -121,8 +121,8 @@ luaA_object_decref(lua_State *L, int tud, const void *pointer) /* Get the number of references */ lua_rawget(L, -2); /* Get the number of references and decrement it */ - int count = lua_tonumber(L, -1) - 1; - /* Did we find the item in our table? (tonumber(nil)-1) is -1 */ + int count = lua_tointeger(L, -1) - 1; + /* Did we find the item in our table? (tointeger(nil)-1) is -1 */ if (count < 0) { buffer_t buf; diff --git a/objects/button.c b/objects/button.c index 4420ec35..f008ae50 100644 --- a/objects/button.c +++ b/objects/button.c @@ -116,7 +116,7 @@ luaA_button_set_modifiers(lua_State *L, button_t *b) static int luaA_button_set_button(lua_State *L, button_t *b) { - b->button = luaL_checknumber(L, -1); + b->button = luaL_checkinteger(L, -1); luaA_object_emit_signal(L, -3, "property::button", 0); return 0; } diff --git a/root.c b/root.c index 59534fc1..8bbe960f 100644 --- a/root.c +++ b/root.c @@ -171,7 +171,7 @@ luaA_root_fake_input(lua_State *L) if(lua_type(L, 2) == LUA_TSTRING) { detail = _string_to_key_code(lua_tostring(L, 2)); /* keysym */ } else { - detail = luaL_checknumber(L, 2); /* keycode */ + detail = luaL_checkinteger(L, 2); /* keycode */ } } else if(A_STREQ(stype, "key_release")) @@ -180,25 +180,25 @@ luaA_root_fake_input(lua_State *L) if(lua_type(L, 2) == LUA_TSTRING) { detail = _string_to_key_code(lua_tostring(L, 2)); /* keysym */ } else { - detail = luaL_checknumber(L, 2); /* keycode */ + detail = luaL_checkinteger(L, 2); /* keycode */ } } else if(A_STREQ(stype, "button_press")) { type = XCB_BUTTON_PRESS; - detail = luaL_checknumber(L, 2); /* button number */ + detail = luaL_checkinteger(L, 2); /* button number */ } else if(A_STREQ(stype, "button_release")) { type = XCB_BUTTON_RELEASE; - detail = luaL_checknumber(L, 2); /* button number */ + detail = luaL_checkinteger(L, 2); /* button number */ } else if(A_STREQ(stype, "motion_notify")) { type = XCB_MOTION_NOTIFY; detail = luaA_checkboolean(L, 2); /* relative to the current position or not */ - x = luaL_checknumber(L, 3); - y = luaL_checknumber(L, 4); + x = luaL_checkinteger(L, 3); + y = luaL_checkinteger(L, 4); } else return 0; diff --git a/strut.c b/strut.c index 41849450..6300f435 100644 --- a/strut.c +++ b/strut.c @@ -51,10 +51,10 @@ void luaA_tostrut(lua_State *L, int idx, strut_t *strut) { luaA_checktable(L, idx); - strut->left = luaA_getopt_number(L, idx, "left", strut->left); - strut->right = luaA_getopt_number(L, idx, "right", strut->right); - strut->top = luaA_getopt_number(L, idx, "top", strut->top); - strut->bottom = luaA_getopt_number(L, idx, "bottom", strut->bottom); + strut->left = luaA_getopt_integer(L, idx, "left", strut->left); + strut->right = luaA_getopt_integer(L, idx, "right", strut->right); + strut->top = luaA_getopt_integer(L, idx, "top", strut->top); + strut->bottom = luaA_getopt_integer(L, idx, "bottom", strut->bottom); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80