From ad76ca674b241bef0fea489d933648cc1a467346 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 10 Apr 2019 12:31:43 -0600 Subject: [PATCH] graphics/nxbe: Some bugfix found early in cursor testing. --- graphics/nxbe/nxbe_closewindow.c | 2 +- graphics/nxglib/cursor/nxglib_cursor_backup.c | 4 ++-- graphics/nxglib/cursor/nxglib_cursor_draw.c | 4 ++-- graphics/nxglib/cursor/nxglib_cursor_erase.c | 4 ++-- include/nuttx/nx/nxcursor.h | 2 +- libs/libnx/nxmu/nx_cursor.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/graphics/nxbe/nxbe_closewindow.c b/graphics/nxbe/nxbe_closewindow.c index b05bd00376..c5d577e5b9 100644 --- a/graphics/nxbe/nxbe_closewindow.c +++ b/graphics/nxbe/nxbe_closewindow.c @@ -89,7 +89,7 @@ void nxbe_closewindow(FAR struct nxbe_window_s *wnd) * indicate the modal state. */ - DEBUGASSERT(wnd->above == NULL & NXBE_STATE_ISMODAL(be)); + DEBUGASSERT(wnd->above == NULL && NXBE_STATE_ISMODAL(be)); /* Leave the modal state */ diff --git a/graphics/nxglib/cursor/nxglib_cursor_backup.c b/graphics/nxglib/cursor/nxglib_cursor_backup.c index 322800c0f0..ce37c5f02e 100644 --- a/graphics/nxglib/cursor/nxglib_cursor_backup.c +++ b/graphics/nxglib/cursor/nxglib_cursor_backup.c @@ -100,8 +100,8 @@ void NXGL_FUNCNAME(nxglib_cursor_backup, NXGLIB_SUFFIX) { /* Get the width and the height of the images in pixels/rows */ - width = be->cursor.bounds.pt2.x = be->cursor.bounds.pt1.x + 1; - height = be->cursor.bounds.pt2.y = be->cursor.bounds.pt1.y + 1; + width = be->cursor.bounds.pt2.x - be->cursor.bounds.pt1.x + 1; + height = be->cursor.bounds.pt2.y - be->cursor.bounds.pt1.y + 1; /* Get the width of the images in bytes. */ diff --git a/graphics/nxglib/cursor/nxglib_cursor_draw.c b/graphics/nxglib/cursor/nxglib_cursor_draw.c index a64a5998e1..a5e4618982 100644 --- a/graphics/nxglib/cursor/nxglib_cursor_draw.c +++ b/graphics/nxglib/cursor/nxglib_cursor_draw.c @@ -147,8 +147,8 @@ void NXGL_FUNCNAME(nxglib_cursor_draw, NXGLIB_SUFFIX) { /* Get the width and the height of the images in pixels/rows */ - width = be->cursor.bounds.pt2.x = be->cursor.bounds.pt1.x + 1; - height = be->cursor.bounds.pt2.y = be->cursor.bounds.pt1.y + 1; + width = be->cursor.bounds.pt2.x - be->cursor.bounds.pt1.x + 1; + height = be->cursor.bounds.pt2.y - be->cursor.bounds.pt1.y + 1; /* Get the width of the images in bytes. */ diff --git a/graphics/nxglib/cursor/nxglib_cursor_erase.c b/graphics/nxglib/cursor/nxglib_cursor_erase.c index fc48376d42..5f6ce7b507 100644 --- a/graphics/nxglib/cursor/nxglib_cursor_erase.c +++ b/graphics/nxglib/cursor/nxglib_cursor_erase.c @@ -99,8 +99,8 @@ void NXGL_FUNCNAME(nxglib_cursor_erase, NXGLIB_SUFFIX) { /* Get the width and the height of the images in pixels/rows */ - width = be->cursor.bounds.pt2.x = be->cursor.bounds.pt1.x + 1; - height = be->cursor.bounds.pt2.y = be->cursor.bounds.pt1.y + 1; + width = be->cursor.bounds.pt2.x - be->cursor.bounds.pt1.x + 1; + height = be->cursor.bounds.pt2.y - be->cursor.bounds.pt1.y + 1; /* Get the width of the images in bytes. */ diff --git a/include/nuttx/nx/nxcursor.h b/include/nuttx/nx/nxcursor.h index 17a006d460..ef2dede5bf 100644 --- a/include/nuttx/nx/nxcursor.h +++ b/include/nuttx/nx/nxcursor.h @@ -165,7 +165,7 @@ int nxcursor_enable(NXHANDLE hnd, bool enable); ****************************************************************************/ #if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR) -int nxcursor_setimage(NXHANDLE hnd, FAR struct nx_cursorimage_s *image); +int nxcursor_setimage(NXHANDLE hnd, FAR const struct nx_cursorimage_s *image); #endif /**************************************************************************** diff --git a/libs/libnx/nxmu/nx_cursor.c b/libs/libnx/nxmu/nx_cursor.c index 321ff8f0b1..ed4d61cd4c 100644 --- a/libs/libnx/nxmu/nx_cursor.c +++ b/libs/libnx/nxmu/nx_cursor.c @@ -119,7 +119,7 @@ int nxcursor_enable(NXHANDLE hnd, bool enable) ****************************************************************************/ #if defined(CONFIG_NX_HWCURSORIMAGE) || defined(CONFIG_NX_SWCURSOR) -int nxcursor_setimage(NXHANDLE hnd, FAR struct nx_cursorimage_s *image) +int nxcursor_setimage(NXHANDLE hnd, FAR const struct nx_cursorimage_s *image) { FAR struct nxmu_conn_s *conn = (FAR struct nxmu_conn_s *)hnd; struct nxsvrmsg_curimage_s outmsg;