shell.lua: Fix layer link assertions

Replace two always-true assertions:

        weston_assert_true(wc, &other_shview->view->layer_link.layer);

with what seems to have been the intended check:

        weston_assert_ptr_not_null(wc, other_shview->view->layer_link.layer);

This fixes a build warning:

  .../lua-shell/lua-shell.c: In function 'lua_shell_env_view_move_behind_other_view':
  .../lua-shell/lua-shell.c:1466:1: warning: the comparison will always evaluate as 'true' for the address of 'layer' will never be NULL [-Waddress]
  In file included from .../include/libweston/desktop.h:27,
                   from .../lua-shell/lua-shell.h:27,
                   from .../lua-shell/lua-shell.c:33:
  .../include/libweston/libweston.h:1112:23: note: 'layer' declared here
  .../lua-shell/lua-shell.c: In function 'lua_shell_env_view_move_in_front_of_other_view':
  .../lua-shell/lua-shell.c:1482:1: warning: the comparison will always evaluate as 'true' for the address of 'layer' will never be NULL [-Waddress]
  .../include/libweston/libweston.h:1112:23: note: 'layer' declared here

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2025-10-09 13:02:22 +02:00 committed by Philipp Zabel
parent dc473a4131
commit de3a3fca1b

View file

@ -1463,7 +1463,7 @@ lua_shell_env_view_move_behind_other_view(struct lua_State *lua)
struct lua_shell *shell = shview->shell;
struct weston_compositor *wc = shell->compositor;
weston_assert_true(wc, &other_shview->view->layer_link.layer);
weston_assert_ptr_not_null(wc, other_shview->view->layer_link.layer);
weston_view_move_to_layer(shview->view,
&other_shview->view->layer_link);
@ -1479,7 +1479,7 @@ lua_shell_env_view_move_in_front_of_other_view(struct lua_State *lua)
struct lua_shell *shell = shview->shell;
struct weston_compositor *wc = shell->compositor;
weston_assert_true(wc, &other_shview->view->layer_link.layer);
weston_assert_ptr_not_null(wc, other_shview->view->layer_link.layer);
weston_view_move_before_layer_entry(shview->view,
&other_shview->view->layer_link);