Example #1
0
LUALIB_API lua_Unsigned luaL_checkunsigned (lua_State *L, int narg) {
  int isnum;
  lua_Unsigned d = lua_tounsignedx(L, narg, &isnum);
  if (!isnum)
	tag_error(L, narg, LUA_TNUMBER);
  return d;
}
Example #2
0
uint32_t luaL_checkunsigned (LuaThread *L, int narg) {
  THREAD_CHECK(L);
  int isnum;
  uint32_t d = lua_tounsignedx(L, narg, &isnum);
  if (!isnum)
    tag_error(L, narg, LUA_TNUMBER);
  return d;
}
Example #3
0
LUALIB_API lua_Unsigned 
luaL_checkunsigned (lua_State *L, int narg) {
  int isnum;
  lua_Unsigned d = lua_tounsignedx(L, narg, &isnum);
  if (!isnum) {
	return luaL_error(L, "arg %d is not a unsigned", narg);
  }
  return d;
}
Example #4
0
static int
_dict_insert(lua_State *L, Table* dict) {
    if(!lua_istable(L, -1)) {
        return 0;
    }

    size_t len = lua_rawlen(L, -1);
    size_t i;
    uint32_t rune;
    TableNode *node = NULL;
    for(i=1; i<=len; i++) {
        lua_rawgeti(L, -1, i);
        int isnum;
		rune = lua_tounsignedx(L, -1, &isnum);
        lua_pop(L, 1);

        if(!isnum) {
            return 0;
        }

        Table *tmp;
        if(node == NULL) {
            tmp = dict;
        } else {
            if(node->value == NULL) {
                node->value = table_new();
            } 
            tmp = (Table*)node->value;
        }
        node = table_insert(tmp, rune);
    }
    if(node) {
        node->flag = 'o';
    }
    return 1;
}
Example #5
0
inline lua_Unsigned toX<lua_Unsigned>(lua_State* L, int index, int* is)
{
    LUNA_INDEX_ASSERT(L, index);
    return lua_tounsignedx(L, index, is);
}
Example #6
0
Lua::Var :: operator unsigned int() const
 { return (unsigned int)lua_tounsignedx(st->vm, ind, nullptr); }