Skip to content

Commit

Permalink
chore: upgrade to latest lvgl private header
Browse files Browse the repository at this point in the history
Signed-off-by: Neo Xu <[email protected]>
  • Loading branch information
XuNeo committed Aug 3, 2024
1 parent c5ba19b commit 11a193b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int luavgl_obj_on_event(lua_State *L)
}

lv_event_code_t code = lua_tointeger(L, 2);
if (code >= _LV_EVENT_LAST) {
if (code >= LV_EVENT_LAST) {

Check failure on line 51 in src/event.c

View workflow job for this annotation

GitHub Actions / Build on ubuntu-latest

‘LV_EVENT_LAST’ undeclared (first use in this function); did you mean ‘LV_EVENT_LEAVE’?
luaL_argerror(L, 2, "event code illegal");
return 0;
}
Expand All @@ -68,7 +68,7 @@ static int luavgl_obj_on_event(lua_State *L)
event->dsc = NULL;
event->L = NULL;
event->ref = LUA_NOREF;
event->code = _LV_EVENT_LAST;
event->code = LV_EVENT_LAST;
if (res != LV_RESULT_OK) {
return luaL_error(L, "Failed to remove event dsc: %d\n", res);
}
Expand All @@ -88,7 +88,7 @@ static int luavgl_obj_on_event(lua_State *L)
break;
}

if (events[i]->code == _LV_EVENT_LAST) {
if (events[i]->code == LV_EVENT_LAST) {
/* code marked as _LV_EVENT_LAST means this event has been removed, we can
* reuse it. */
event = events[i];
Expand Down
2 changes: 2 additions & 0 deletions src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "private.h"
#include "rotable.h"

#include "src/lvgl_private.h"

typedef struct luavgl_fs_s {
lv_fs_file_t file;
bool closed; /* userdata exists but lv_fs has been closed */
Expand Down
10 changes: 5 additions & 5 deletions src/style.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef enum {
} style_type_t;

enum {
LV_STYLE_SIZE = _LV_STYLE_LAST_BUILT_IN_PROP + 1,
LV_STYLE_SIZE = LV_STYLE_LAST_BUILT_IN_PROP + 1,

Check failure on line 21 in src/style.c

View workflow job for this annotation

GitHub Actions / Build on ubuntu-latest

‘LV_STYLE_LAST_BUILT_IN_PROP’ undeclared here (not in a function)
LV_STYLE_PAD_ALL,
LV_STYLE_PAD_VER,
LV_STYLE_PAD_HOR,
Expand Down Expand Up @@ -269,7 +269,7 @@ static int luavgl_set_flex_layout_kv(lua_State *L, style_set_cb_t cb,

/* if reverse presents */
if (luavgl_strstr(str, "-reverse")) {
flow |= _LV_FLEX_REVERSE;
flow |= LV_FLEX_REVERSE;

Check failure on line 272 in src/style.c

View workflow job for this annotation

GitHub Actions / Build on ubuntu-latest

‘LV_FLEX_REVERSE’ undeclared (first use in this function)
}
}
lua_pop(L, 1);
Expand All @@ -282,9 +282,9 @@ static int luavgl_set_flex_layout_kv(lua_State *L, style_set_cb_t cb,
if (lua_type(L, -1) == LUA_TSTRING) {
str = lua_tostring(L, -1);
if (lv_strcmp("wrap", str) == 0) {
flow |= _LV_FLEX_WRAP;
flow |= LV_FLEX_WRAP;

Check failure on line 285 in src/style.c

View workflow job for this annotation

GitHub Actions / Build on ubuntu-latest

‘LV_FLEX_WRAP’ undeclared (first use in this function); did you mean ‘LV_FLEX_H’?
} else if (lv_strcmp("wrap-reverse", str) == 0) {
flow |= _LV_FLEX_WRAP | _LV_FLEX_REVERSE;
flow |= LV_FLEX_WRAP | LV_FLEX_REVERSE;
}
/* else: normal */
}
Expand Down Expand Up @@ -479,7 +479,7 @@ static int luavgl_set_style_kv(lua_State *L, style_set_cb_t cb, void *args)
default:
break;
}
} else if ((prop & mask) <= _LV_STYLE_LAST_BUILT_IN_PROP) {
} else if ((prop & mask) <= LV_STYLE_LAST_BUILT_IN_PROP) {
cb(prop & mask, value, args);
} else {
return luaL_error(L, "unknown style");
Expand Down
4 changes: 2 additions & 2 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ LUALIB_API int luavgl_obj_createmetatable(lua_State *L,
const rotable_Reg *l, int n)
{
if (luavgl_obj_getmetatable(L, clz) != LUA_TNIL) /* meta already exists */
return 0; /* leave previous value on top, but return 0 */
return 1;
lua_pop(L, 1);

/* create metatable, 4 elements, normally for __magic, __index, __gc and
Expand Down Expand Up @@ -179,7 +179,7 @@ LUALIB_API int luavgl_obj_createmetatable(lua_State *L,
rotable_newlib(L, l); /* t = {l} */
if (clz != &lv_obj_class) {
/* b = getmatatable(clz.base_clz) */
if (luavgl_obj_getmetatable(L, clz->base_class) == LUA_TNIL) {
if (luavgl_obj_getmetatable(L, lv_obj_get_base_class(clz)) == LUA_TNIL) {

Check failure on line 182 in src/util.c

View workflow job for this annotation

GitHub Actions / Build on ubuntu-latest

implicit declaration of function ‘lv_obj_get_base_class’; did you mean ‘lv_obj_get_class’? [-Werror=implicit-function-declaration]

Check failure on line 182 in src/util.c

View workflow job for this annotation

GitHub Actions / Build on ubuntu-latest

passing argument 2 of ‘luavgl_obj_getmetatable’ makes pointer from integer without a cast [-Werror=int-conversion]
return luaL_error(L, "need to init base class firstly: %s.", name);
}

Expand Down

0 comments on commit 11a193b

Please sign in to comment.