summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-01-28 03:24:51 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-20 17:46:33 +0200
commit02c1f5b4b90fffbba2115cdf0bb1c17c520a2817 (patch)
tree14e011cd2657f3338a9585ba977710f8871cb65e /src
parentd9efda7c01146eba207b7b4039c7457ec25e6b91 (diff)
downloadapk-tools-02c1f5b4b90fffbba2115cdf0bb1c17c520a2817.tar.bz2
apk-tools-02c1f5b4b90fffbba2115cdf0bb1c17c520a2817.tar.xz
lua-apk: fix compile warnings
Diffstat (limited to 'src')
-rw-r--r--src/lua-apk.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lua-apk.c b/src/lua-apk.c
index 6128718..7a04dc6 100644
--- a/src/lua-apk.c
+++ b/src/lua-apk.c
@@ -1,3 +1,4 @@
+#include <features.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
@@ -39,7 +40,7 @@ struct flagmap opendb_flagmap[] = {
static int Pversion_validate(lua_State *L)
{
apk_blob_t ver;
- ver.ptr = (char *)luaL_checklstring(L, 1, &ver.len);
+ ver.ptr = (char *)luaL_checklstring(L, 1, (size_t *)&ver.len);
lua_pushboolean(L, apk_version_validate(ver));
return 1;
}
@@ -50,8 +51,8 @@ static int Pversion_validate(lua_State *L)
static int Pversion_compare(lua_State *L)
{
apk_blob_t a, b;
- a.ptr = (char *)luaL_checklstring(L, 1, &a.len);
- b.ptr = (char *)luaL_checklstring(L, 2, &b.len);
+ a.ptr = (char *)luaL_checklstring(L, 1, (size_t *)&a.len);
+ b.ptr = (char *)luaL_checklstring(L, 2, (size_t *)&b.len);
lua_pushstring(L, apk_version_op_string(apk_version_compare_blob(a, b)));
return 1;
}
@@ -62,8 +63,8 @@ static int Pversion_compare(lua_State *L)
static int Pversion_is_less(lua_State *L)
{
apk_blob_t a, b;
- a.ptr = (char *)luaL_checklstring(L, 1, &a.len);
- b.ptr = (char *)luaL_checklstring(L, 2, &b.len);
+ a.ptr = (char *)luaL_checklstring(L, 1, (size_t *)&a.len);
+ b.ptr = (char *)luaL_checklstring(L, 2, (size_t *)&b.len);
lua_pushboolean(L, apk_version_compare_blob(a, b) == APK_VERSION_LESS);
return 1;
}
@@ -173,9 +174,9 @@ static int push_package(lua_State *L, struct apk_package *pkg)
}
lua_newtable(L);
set_string_field(L, -3, "name", pkg->name->name);
- set_string_field(L, -3, "version", pkg->version);
+ set_string_field(L, -3, "version", apk_blob_cstr(*pkg->version));
set_string_field(L, -3, "url", pkg->url);
- set_string_field(L, -3, "license", pkg->license);
+ set_string_field(L, -3, "license", apk_blob_cstr(*pkg->license));
set_string_field(L, -3, "description", pkg->description);
set_string_field(L, -3, "filename", pkg->filename);
set_int_field(L, -3, "size", pkg->size);