diff --git a/graphics/nxbe/nxbe_bitmap.c b/graphics/nxbe/nxbe_bitmap.c index 170c08ba0c..02449ad665 100644 --- a/graphics/nxbe/nxbe_bitmap.c +++ b/graphics/nxbe/nxbe_bitmap.c @@ -119,9 +119,7 @@ static inline void nxbe_bitmap_pwfb(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_point_s *origin, unsigned int stride) { - struct nxgl_rect_s bounds; - struct nxgl_point_s offset; - struct nxgl_rect_s remaining; + struct nxgl_rect_s destrect; unsigned int deststride; DEBUGASSERT(wnd != NULL && dest != NULL && src != NULL && origin != NULL); @@ -149,25 +147,33 @@ static inline void nxbe_bitmap_pwfb(FAR struct nxbe_window_s *wnd, return; } - /* Offset the rectangle and image origin by the window origin */ + /* Offset the rectangle and image origin by the window origin. This + * converts the rectangle in the device absolute coordinates. + */ - nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y); - nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1); + nxgl_rectoffset(&destrect, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y); - /* Clip to the limits of the window and of the background screen */ + /* Clip to the limits of the window and of the background screen (in + * device coordinates. + */ - nxgl_rectintersect(&remaining, &bounds, &wnd->bounds); - nxgl_rectintersect(&remaining, &remaining, &wnd->be->bkgd.bounds); + nxgl_rectintersect(&destrect, &destrect, &wnd->bounds); + nxgl_rectintersect(&destrect, &destrect, &wnd->be->bkgd.bounds); - if (!nxgl_nullrect(&remaining)) + if (!nxgl_nullrect(&destrect)) { + /* Restore the destination rectangle to relative window coordinates. */ + + nxgl_rectoffset(&destrect, &destrect, + -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); + /* Copy the rectangular region to the framebuffer (no clipping). * REVISIT: Assumes a single color plane. */ DEBUGASSERT(wnd->be->plane[0].pwfb.copyrectangle != NULL); - wnd->be->plane[0].pwfb.copyrectangle(wnd, &remaining, src[0], - &offset, stride); + wnd->be->plane[0].pwfb.copyrectangle(wnd, &destrect, src[0], + origin, stride); } } #endif diff --git a/graphics/nxbe/nxbe_closewindow.c b/graphics/nxbe/nxbe_closewindow.c index 6c9cd29568..10ed635142 100644 --- a/graphics/nxbe/nxbe_closewindow.c +++ b/graphics/nxbe/nxbe_closewindow.c @@ -74,13 +74,7 @@ void nxbe_closewindow(FAR struct nxbe_window_s *wnd) { FAR struct nxbe_state_s *be; -#ifdef CONFIG_DEBUG_FEATURES - if (wnd == NULL) - { - return; - } -#endif - + DEBUGASSERT(wnd != NULL); be = wnd->be; /* The background window should never be closed */ diff --git a/graphics/nxbe/nxbe_configure.c b/graphics/nxbe/nxbe_configure.c index 44df33d491..0eff716788 100644 --- a/graphics/nxbe/nxbe_configure.c +++ b/graphics/nxbe/nxbe_configure.c @@ -99,7 +99,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) /* Check the number of color planes */ -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_GRAPHICS if (be->vinfo.nplanes > CONFIG_NX_NPLANES) { gerr("ERROR: NX configured for only %d planes, controller wants %d\n", diff --git a/graphics/nxbe/nxbe_fill.c b/graphics/nxbe/nxbe_fill.c index 5c631584a7..fb612caf5a 100644 --- a/graphics/nxbe/nxbe_fill.c +++ b/graphics/nxbe/nxbe_fill.c @@ -150,12 +150,21 @@ static inline void nxbe_fill_pwfb(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) { + struct nxgl_rect_s relrect; + + DEBUGASSERT(wnd->be->plane[0].pwfb.fillrectangle != NULL); + + /* The rectangle that we receive here is in abolute device coordinates. We + * need to restore this to windows relative coordinates. + */ + + nxgl_rectoffset(&relrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); + /* Copy the rectangular region to the framebuffer (no clipping). * REVISIT: Assumes a single color plane. */ - DEBUGASSERT(wnd->be->plane[0].pwfb.fillrectangle != NULL); - wnd->be->plane[0].pwfb.fillrectangle(wnd, rect, color[0]); + wnd->be->plane[0].pwfb.fillrectangle(wnd, &relrect, color[0]); } #endif diff --git a/graphics/nxbe/nxbe_filltrapezoid.c b/graphics/nxbe/nxbe_filltrapezoid.c index 93eb44e53b..313182414e 100644 --- a/graphics/nxbe/nxbe_filltrapezoid.c +++ b/graphics/nxbe/nxbe_filltrapezoid.c @@ -179,7 +179,8 @@ static inline void nxbe_filltrapezoid_pwfb(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_trapezoid_s *trap, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) { - struct nxgl_rect_s newbounds; + struct nxgl_trapezoid_s reltrap; + struct nxgl_rect_s relbounds; FAR const void *src[CONFIG_NX_NPLANES] = { (FAR const void *)wnd->fbmem @@ -189,27 +190,28 @@ static inline void nxbe_filltrapezoid_pwfb(FAR struct nxbe_window_s *wnd, 0, 0 }; + /* Both the rectangle that we receive here are in abolute device + * coordinates. We need to restore both to windows relative coordinates. + */ + + nxgl_trapoffset(&reltrap, trap, + -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); + nxgl_rectoffset(&relbounds, bounds, + -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); + /* Copy the trapezoidal region to the framebuffer (no clipping). * REVISIT: Assumes a single color plane. */ DEBUGASSERT(wnd->be->plane[0].pwfb.filltrapezoid != NULL); - wnd->be->plane[0].pwfb.filltrapezoid(wnd, trap, bounds, color[0]); + wnd->be->plane[0].pwfb.filltrapezoid(wnd, &reltrap, &relbounds, + color[0]); - /* Copy the porition of the per-window framebuffer to the device graphics - * memory. + /* Copy the portion of the per-window framebuffer in the bounding box + * to the device graphics memory. */ - /* Restore the rectangle origin to (0,0) as required by nxbe_bitmap_dev(). - * nxbe_bitmap_dev() will offset the bounds yet again. - */ - - nxgl_rectoffset(&newbounds, bounds, - -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); - - /* Then perform the bitmap copy from the pre-window framebuffer */ - - nxbe_bitmap_dev(wnd, &newbounds, src, &origin, wnd->stride); + nxbe_bitmap_dev(wnd, &relbounds, src, &origin, wnd->stride); } #endif @@ -240,22 +242,22 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd, nxgl_mxpixel_t color[CONFIG_NX_NPLANES]) { struct nxgl_rect_s remaining; - struct nxgl_trapezoid_s offset_trap; + struct nxgl_trapezoid_s devtrap; DEBUGASSERT(wnd != NULL && trap != NULL); /* Offset the trapezoid by the window origin to position it within - * the framebuffer region + * the device graphics coordinate system. */ - nxgl_trapoffset(&offset_trap, trap, wnd->bounds.pt1.x, wnd->bounds.pt1.y); + nxgl_trapoffset(&devtrap, trap, wnd->bounds.pt1.x, wnd->bounds.pt1.y); /* Create a bounding box that contains the trapezoid */ - remaining.pt1.x = b16toi(ngl_min(offset_trap.top.x1, offset_trap.bot.x1)); - remaining.pt1.y = offset_trap.top.y; - remaining.pt2.x = b16toi(ngl_max(offset_trap.top.x2, offset_trap.bot.x2)); - remaining.pt2.y = offset_trap.bot.y; + remaining.pt1.x = b16toi(ngl_min(devtrap.top.x1, devtrap.bot.x1)); + remaining.pt1.y = devtrap.top.y; + remaining.pt2.x = b16toi(ngl_max(devtrap.top.x2, devtrap.bot.x2)); + remaining.pt2.y = devtrap.bot.y; /* Clip to any user specified clipping window */ @@ -278,14 +280,14 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd, if (NXBE_ISRAMBACKED(wnd)) { - nxbe_filltrapezoid_pwfb(wnd, &remaining, &offset_trap, color); + nxbe_filltrapezoid_pwfb(wnd, &remaining, &devtrap, color); } else #endif { /* Update only the graphics device memory. */ - nxbe_filltrapezoid_dev(wnd, &remaining, &offset_trap, color); + nxbe_filltrapezoid_dev(wnd, &remaining, &devtrap, color); } } } diff --git a/graphics/nxbe/nxbe_getrectangle.c b/graphics/nxbe/nxbe_getrectangle.c index ff1c7b2796..eeac3081fc 100644 --- a/graphics/nxbe/nxbe_getrectangle.c +++ b/graphics/nxbe/nxbe_getrectangle.c @@ -122,10 +122,19 @@ static inline void nxbe_getrectangle_pwfb(FAR struct nxbe_window_s *wnd, unsigned int deststride) { FAR struct nxbe_plane_s *pplane = &wnd->be->plane[plane]; + struct nxgl_rect_s relrect; DEBUGASSERT(pplane != NULL && pplane->pwfb.getrectangle != NULL); - pplane->pwfb.getrectangle(wnd, rect, dest, deststride); + /* The rectangle that we receive here is in abolute device coordinates. We + * need to restore this to windows relative coordinates. + */ + + nxgl_rectoffset(&relrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); + + /* Then get the rectangle from the framebuffer */ + + pplane->pwfb.getrectangle(wnd, &relrect, dest, deststride); } #endif diff --git a/graphics/nxbe/nxbe_move.c b/graphics/nxbe/nxbe_move.c index a5b50c69a1..2e3a3dd903 100644 --- a/graphics/nxbe/nxbe_move.c +++ b/graphics/nxbe/nxbe_move.c @@ -295,20 +295,25 @@ static inline void nxbe_move_pwfb(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_point_s *offset) { struct nxgl_point_s destpos; - struct nxgl_rect_s bounds; - FAR const void *src[CONFIG_NX_NPLANES] = - { - (FAR const void *)wnd->fbmem - }; + struct nxgl_rect_s srcrect; + struct nxgl_rect_s destrect; + FAR const void *src[CONFIG_NX_NPLANES]; FAR const struct nxgl_point_s origin = { 0, 0 }; + unsigned int bpp; + + /* The rectangle that we receive here is in abolute device coordinates. We + * need to restore this to windows relative coordinates. + */ + + nxgl_rectoffset(&srcrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y); /* Offset is the destination position of the moved rectangle */ - destpos.x = rect->pt1.x + offset->x; - destpos.y = rect->pt1.y + offset->y; + destpos.x = srcrect.pt1.x + offset->x; + destpos.y = srcrect.pt1.y + offset->y; /* Move the source rectangle to the destination position in the * frambebuffer. @@ -316,22 +321,35 @@ static inline void nxbe_move_pwfb(FAR struct nxbe_window_s *wnd, */ DEBUGASSERT(wnd->be->plane[0].pwfb.moverectangle != NULL); - wnd->be->plane[0].pwfb.moverectangle(wnd, rect, &destpos); + wnd->be->plane[0].pwfb.moverectangle(wnd, &srcrect, &destpos); /* Construct the destination bounding box in relative window * coordinates. This derives from the source bounding box with - * an offset distination and an offset to restore the relative - * window position. + * an offset distination. */ - nxgl_rectoffset(&bounds, rect, offset->x - wnd->bounds.pt1.x, - offset->y - wnd->bounds.pt1.y); + nxgl_rectoffset(&destrect, &srcrect, offset->x, offset->y); - /* Update the physical device by just copying the destination rectangle - * to the device graphics memory. + /* Update the physical device by just copying the rectangle from the + * framebuffer to the device graphics memory. + * + * Get the source of address of the moved rectangle in the framebuffer. + * REVISIT: For resolutions less than 8-bits, the starting pixel will + * be contained in the byte pointed to by src[0]but may not be properly + * aligned for the transfer. */ - nxbe_bitmap_dev(wnd, &bounds, src, &origin, wnd->stride); + bpp = wnd->be->plane[0].pinfo.bpp; + src[0] = (FAR void *) + ((FAR uint8_t *)wnd->fbmem + + destrect.pt1.y * wnd->stride + + ((bpp * destrect.pt1.x) >> 3)); + + /* Then transfer the rectangle to the destination rectangle in the + * device memory. + */ + + nxbe_bitmap_dev(wnd, &destrect, src, &origin, wnd->stride); } #endif diff --git a/graphics/nxbe/nxbe_setpixel.c b/graphics/nxbe/nxbe_setpixel.c index f610cd0c84..24cc2cb49b 100644 --- a/graphics/nxbe/nxbe_setpixel.c +++ b/graphics/nxbe/nxbe_setpixel.c @@ -39,6 +39,8 @@ #include +#include + #include #include @@ -112,12 +114,7 @@ void nxbe_setpixel(FAR struct nxbe_window_s *wnd, struct nxgl_rect_s rect; int i; -#ifdef CONFIG_DEBUG_FEATURES - if (!wnd || !pos) - { - return; - } -#endif + DEBUGASSERT(wnd != NULL && pos != NULL); /* Offset the position by the window origin */ diff --git a/graphics/nxbe/nxbe_setposition.c b/graphics/nxbe/nxbe_setposition.c index 7509960319..c4a4239dbc 100644 --- a/graphics/nxbe/nxbe_setposition.c +++ b/graphics/nxbe/nxbe_setposition.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxbe/nxbe_setposition.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,8 @@ #include +#include + #include #include "nxbe.h" @@ -63,12 +65,7 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd, struct nxgl_rect_s before; struct nxgl_rect_s rect; -#ifdef CONFIG_DEBUG_FEATURES - if (!wnd) - { - return; - } -#endif + DEBUGASSERT(wnd != NULL && pos != NULL); /* Back out the old window origin position from the bounding box */ diff --git a/graphics/nxbe/nxbe_setsize.c b/graphics/nxbe/nxbe_setsize.c index 86241402a5..295593a398 100644 --- a/graphics/nxbe/nxbe_setsize.c +++ b/graphics/nxbe/nxbe_setsize.c @@ -89,7 +89,7 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd, FAR uint8_t *src; FAR uint8_t *dest; nxgl_coord_t minheight; - nxgl_coord_t newidth; + nxgl_coord_t newwidth; nxgl_coord_t newheight; nxgl_coord_t oldheight; nxgl_coord_t row; @@ -114,10 +114,10 @@ static void nxbe_realloc(FAR struct nxbe_window_s *wnd, { oldheight = oldbounds->pt2.y - oldbounds->pt1.y + 1; - newidth = wnd->bounds.pt2.x - wnd->bounds.pt1.x + 1; + newwidth = wnd->bounds.pt2.x - wnd->bounds.pt1.x + 1; newheight = wnd->bounds.pt2.y - wnd->bounds.pt1.y + 1; bpp = wnd->be->plane[0].pinfo.bpp; - newstride = (bpp * newidth + 7) >> 3; + newstride = (bpp * newwidth + 7) >> 3; newfbsize = newstride * newheight; #ifdef CONFIG_BUILD_KERNEL diff --git a/graphics/nxmu/nxmu_releasebkgd.c b/graphics/nxmu/nxmu_releasebkgd.c index 2363035448..7d63eadd38 100644 --- a/graphics/nxmu/nxmu_releasebkgd.c +++ b/graphics/nxmu/nxmu_releasebkgd.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nxmu_releasebkgd.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,7 @@ #include +#include #include #include @@ -66,19 +67,13 @@ void nxmu_releasebkgd(FAR struct nxmu_state_s *fe) { - FAR struct nxbe_state_s *be = &fe->be; + FAR struct nxbe_state_s *be; -#ifdef CONFIG_DEBUG_FEATURES - if (!fe) - { - return; - } -#endif + DEBUGASSERT(fe != NULL); - /* Destroy the client window callbacks* and restore the server - * connection. - */ + /* Destroy the client window callbacks and restore the server connection. */ + be = &fe->be; be->bkgd.cb = NULL; be->bkgd.arg = NULL; be->bkgd.conn = &fe->conn; @@ -87,4 +82,3 @@ void nxmu_releasebkgd(FAR struct nxmu_state_s *fe) nxmu_redrawreq(&be->bkgd, &be->bkgd.bounds); } - diff --git a/graphics/nxmu/nxmu_sendclient.c b/graphics/nxmu/nxmu_sendclient.c index 44d1e8db88..efc96e007e 100644 --- a/graphics/nxmu/nxmu_sendclient.c +++ b/graphics/nxmu/nxmu_sendclient.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nxmu_sendclient.c * - * Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2017, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -72,15 +73,7 @@ int nxmu_sendclient(FAR struct nxmu_conn_s *conn, FAR const void *msg, { int ret; - /* Sanity checking */ - -#ifdef CONFIG_DEBUG_FEATURES - if (!conn || !conn->swrmq) - { - set_errno(EINVAL); - return ERROR; - } -#endif + DEBUGASSERT(conn != NULL && conn->swrmq != NULL && msg != NULL); /* Send the message to the client */ diff --git a/graphics/nxmu/nxmu_sendclientwindow.c b/graphics/nxmu/nxmu_sendclientwindow.c index c5ef4faaae..9654374f0e 100644 --- a/graphics/nxmu/nxmu_sendclientwindow.c +++ b/graphics/nxmu/nxmu_sendclientwindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nxmu_sendclientwindow.c * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -66,19 +67,11 @@ ****************************************************************************/ int nxmu_sendclientwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg, - size_t msglen) + size_t msglen) { - int ret = OK; + int ret = OK; - /* Sanity checking */ - -#ifdef CONFIG_DEBUG_FEATURES - if (!wnd || !wnd->conn) - { - set_errno(EINVAL); - return ERROR; - } -#endif + DEBUGASSERT(wnd != NULL && wnd->conn != NULL && msg != NULL); /* Ignore messages destined to a blocked window (no errors reported) */ diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c index 9d391e2de2..21bf053201 100644 --- a/graphics/nxmu/nxmu_server.c +++ b/graphics/nxmu/nxmu_server.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nxmu_server.c * - * Copyright (C) 2008-2012, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2012, 2017, 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ static inline void nxmu_disconnect(FAR struct nxmu_conn_s *conn) ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_disconnected_s)); if (ret < 0) { - gerr("ERROR: nxmu_sendclient failed: %d\n", errno); + gerr("ERROR: nxmu_sendclient failed: %d\n", ret); } /* Close the outgoing client message queue */ @@ -111,7 +111,7 @@ static inline void nxmu_connect(FAR struct nxmu_conn_s *conn) ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_connected_s)); if (ret < 0) { - gerr("ERROR: nxmu_sendclient failed: %d\n", errno); + gerr("ERROR: nxmu_sendclient failed: %d\n", ret); } } @@ -150,10 +150,11 @@ static inline void nxmu_blocked(FAR struct nxbe_window_s *wnd, FAR void *arg) outmsg.wnd = wnd; outmsg.arg = arg; - ret = nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_blocked_s)); + ret = nxmu_sendclient(wnd->conn, &outmsg, + sizeof(struct nxclimsg_blocked_s)); if (ret < 0) { - gerr("ERROR: nxmu_sendclient failed: %d\n", errno); + gerr("ERROR: nxmu_sendclient failed: %d\n", ret); } } @@ -174,18 +175,16 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, ret = nxbe_configure(dev, &fe->be); if (ret < 0) { - gerr("ERROR: nxbe_configure failed: %d\n", -ret); - set_errno(-ret); - return ERROR; + gerr("ERROR: nxbe_configure failed: %d\n", ret); + return ret; } #ifdef CONFIG_FB_CMAP ret = nxbe_colormap(dev); if (ret < 0) { - gerr("ERROR: nxbe_colormap failed: %d\n", -ret); - set_errno(-ret); - return ERROR; + gerr("ERROR: nxbe_colormap failed: %d\n", ret); + return ret; } #endif /* CONFIG_FB_CMAP */ @@ -204,8 +203,9 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, fe->conn.crdmq = mq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr); if (fe->conn.crdmq == (mqd_t)-1) { - gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno); - return ERROR; /* mq_open sets errno */ + int errcode = get_errno(); + gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errcode); + return -errcode; } /* NOTE that the outgoing client MQ (cwrmq) is not initialized. The @@ -220,9 +220,10 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, fe->conn.swrmq = mq_open(mqname, O_WRONLY); if (fe->conn.swrmq == (mqd_t)-1) { - gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno); + int errcode = get_errno(); + gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errcode); mq_close(fe->conn.crdmq); - return ERROR; /* mq_open sets errno */ + return -errcode; } /* The server is now "connected" to itself via the background window */ @@ -272,7 +273,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, * * Returned Value: * This function usually does not return. If it does return, it will - * return ERROR and errno will be set appropriately. + * return a negated errno value indicating the cause of the failure. * ****************************************************************************/ @@ -293,7 +294,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) ret = nxmu_setup(mqname, dev, &fe); if (ret < 0) { - return ret; /* nxmu_setup sets errno */ + return ret; } /* Produce the initial, background display */ @@ -536,6 +537,5 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) errout: nxmu_shutdown(&fe); - set_errno(-ret); - return ERROR; + return ret; } diff --git a/graphics/nxterm/Make.defs b/graphics/nxterm/Make.defs index 32629b8f0a..24673b2a72 100644 --- a/graphics/nxterm/Make.defs +++ b/graphics/nxterm/Make.defs @@ -47,7 +47,7 @@ ifeq ($(CONFIG_NXTERM_NXKBDIN),y) CSRCS += nxterm_kbdin.c endif -ifeq ($(CONFIG_DEBUG_FEATURES),y) +ifeq ($(CONFIG_DEBUG_GRAPHICS),y) CSRCS += nxterm_sem.c endif diff --git a/graphics/nxterm/nxterm.h b/graphics/nxterm/nxterm.h index f1e9375399..02bea4b09c 100644 --- a/graphics/nxterm/nxterm.h +++ b/graphics/nxterm/nxterm.h @@ -127,7 +127,7 @@ struct nxterm_state_s FAR void *handle; /* The window handle */ FAR struct nxterm_window_s wndo; /* Describes the window and font */ sem_t exclsem; /* Forces mutually exclusive access */ -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_GRAPHICS pid_t holder; /* Deadlock avoidance */ #endif #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS @@ -193,7 +193,7 @@ extern const struct file_operations g_nxterm_drvrops; /* Semaphore helpers */ -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_GRAPHICS int nxterm_semwait(FAR struct nxterm_state_s *priv); int nxterm_sempost(FAR struct nxterm_state_s *priv); #else diff --git a/graphics/nxterm/nxterm_kbdin.c b/graphics/nxterm/nxterm_kbdin.c index da88d18d19..00cccb1d50 100644 --- a/graphics/nxterm/nxterm_kbdin.c +++ b/graphics/nxterm/nxterm_kbdin.c @@ -335,7 +335,7 @@ int nxterm_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) struct pollfd **slot = (struct pollfd **)fds->priv; -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_GRAPHICS if (!slot) { gerr("ERROR: No slot\n"); diff --git a/graphics/nxterm/nxterm_register.c b/graphics/nxterm/nxterm_register.c index ed15a3906f..31e32d5751 100644 --- a/graphics/nxterm/nxterm_register.c +++ b/graphics/nxterm/nxterm_register.c @@ -90,7 +90,7 @@ FAR struct nxterm_state_s * memcpy(&priv->wndo, wndo, sizeof(struct nxterm_window_s)); nxsem_init(&priv->exclsem, 0, 1); -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_GRAPHICS priv->holder = NO_HOLDER; #endif diff --git a/graphics/nxterm/nxterm_sem.c b/graphics/nxterm/nxterm_sem.c index fbdbf41f0a..c54bed93f0 100644 --- a/graphics/nxterm/nxterm_sem.c +++ b/graphics/nxterm/nxterm_sem.c @@ -46,7 +46,7 @@ #include "nxterm.h" -#ifdef CONFIG_DEBUG_FEATURES +#ifdef CONFIG_DEBUG_GRAPHICS /**************************************************************************** * Public Functions @@ -110,4 +110,4 @@ int nxterm_sempost(FAR struct nxterm_state_s *priv) return nxsem_post(&priv->exclsem); } -#endif /* CONFIG_DEBUG_FEATURES */ +#endif /* CONFIG_DEBUG_GRAPHICS */ diff --git a/graphics/vnc/server/vnc_fbdev.c b/graphics/vnc/server/vnc_fbdev.c index 2be443a15b..bfba6e0c0d 100644 --- a/graphics/vnc/server/vnc_fbdev.c +++ b/graphics/vnc/server/vnc_fbdev.c @@ -45,15 +45,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/graphics/vnc/server/vnc_negotiate.c b/graphics/vnc/server/vnc_negotiate.c index b87fb99707..beaad4e70c 100644 --- a/graphics/vnc/server/vnc_negotiate.c +++ b/graphics/vnc/server/vnc_negotiate.c @@ -45,15 +45,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/graphics/vnc/server/vnc_raw.c b/graphics/vnc/server/vnc_raw.c index 5b548f3920..383849fd81 100644 --- a/graphics/vnc/server/vnc_raw.c +++ b/graphics/vnc/server/vnc_raw.c @@ -44,15 +44,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/graphics/vnc/server/vnc_receiver.c b/graphics/vnc/server/vnc_receiver.c index 277052b7cb..efa97283dd 100644 --- a/graphics/vnc/server/vnc_receiver.c +++ b/graphics/vnc/server/vnc_receiver.c @@ -43,15 +43,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/graphics/vnc/server/vnc_rre.c b/graphics/vnc/server/vnc_rre.c index adf347c569..f33b0921ac 100644 --- a/graphics/vnc/server/vnc_rre.c +++ b/graphics/vnc/server/vnc_rre.c @@ -44,15 +44,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/graphics/vnc/server/vnc_server.c b/graphics/vnc/server/vnc_server.c index beda5edbf6..c143a9a393 100644 --- a/graphics/vnc/server/vnc_server.c +++ b/graphics/vnc/server/vnc_server.c @@ -48,15 +48,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/graphics/vnc/server/vnc_updater.c b/graphics/vnc/server/vnc_updater.c index 3a163066af..439a952aff 100644 --- a/graphics/vnc/server/vnc_updater.c +++ b/graphics/vnc/server/vnc_updater.c @@ -48,15 +48,19 @@ #include #if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef CONFIG_DEBUG_FEATURES # undef CONFIG_DEBUG_ERROR # undef CONFIG_DEBUG_WARN # undef CONFIG_DEBUG_INFO -# define CONFIG_DEBUG_FEATURES 1 -# define CONFIG_DEBUG_ERROR 1 -# define CONFIG_DEBUG_WARN 1 -# define CONFIG_DEBUG_INFO 1 -# define CONFIG_DEBUG_GRAPHICS 1 +# undef CONFIG_DEBUG_GRAPHICS_ERROR +# undef CONFIG_DEBUG_GRAPHICS_WARN +# undef CONFIG_DEBUG_GRAPHICS_INFO +# define CONFIG_DEBUG_ERROR 1 +# define CONFIG_DEBUG_WARN 1 +# define CONFIG_DEBUG_INFO 1 +# define CONFIG_DEBUG_GRAPHICS 1 +# define CONFIG_DEBUG_GRAPHICS_ERROR 1 +# define CONFIG_DEBUG_GRAPHICS_WARN 1 +# define CONFIG_DEBUG_GRAPHICS_INFO 1 #endif #include diff --git a/libs/libnx/nxglib/nxglib_colorcmp.c b/libs/libnx/nxglib/nxglib_colorcmp.c index 8f68ac2d79..db84519452 100644 --- a/libs/libnx/nxglib/nxglib_colorcmp.c +++ b/libs/libnx/nxglib/nxglib_colorcmp.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -90,3 +70,4 @@ bool nxgl_colorcmp(const nxgl_mxpixel_t color1[CONFIG_NX_NPLANES], return true; } + diff --git a/libs/libnx/nxglib/nxglib_colorcopy.c b/libs/libnx/nxglib/nxglib_colorcopy.c index 52c03fa894..ecac53b633 100644 --- a/libs/libnx/nxglib/nxglib_colorcopy.c +++ b/libs/libnx/nxglib/nxglib_colorcopy.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -85,3 +65,4 @@ void nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES], dest[i] = src[i]; } } + diff --git a/libs/libnx/nxglib/nxglib_intersecting.c b/libs/libnx/nxglib/nxglib_intersecting.c index dc6e87e2d4..3dc425c67f 100644 --- a/libs/libnx/nxglib/nxglib_intersecting.c +++ b/libs/libnx/nxglib/nxglib_intersecting.c @@ -43,26 +43,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -81,3 +61,4 @@ bool nxgl_intersecting(FAR const struct nxgl_rect_s *rect1, return ((rect1->pt2.x > rect2->pt1.x) && (rect1->pt2.y > rect2->pt1.y) && (rect1->pt1.x < rect2->pt2.x) && (rect1->pt1.y < rect2->pt1.y)); } + diff --git a/libs/libnx/nxglib/nxglib_nonintersecting.c b/libs/libnx/nxglib/nxglib_nonintersecting.c index 0530fe09bc..748954d946 100644 --- a/libs/libnx/nxglib/nxglib_nonintersecting.c +++ b/libs/libnx/nxglib/nxglib_nonintersecting.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -147,3 +127,4 @@ void nxgl_nonintersecting(FAR struct nxgl_rect_s result[4], result[NX_RIGHT_NDX].pt2.x = rect1->pt2.x; result[NX_RIGHT_NDX].pt2.y = intersection.pt2.y; } + diff --git a/libs/libnx/nxglib/nxglib_nullrect.c b/libs/libnx/nxglib/nxglib_nullrect.c index 89a2d0641b..a0dc1fcbe1 100644 --- a/libs/libnx/nxglib/nxglib_nullrect.c +++ b/libs/libnx/nxglib/nxglib_nullrect.c @@ -43,26 +43,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -79,3 +59,4 @@ bool nxgl_nullrect(FAR const struct nxgl_rect_s *rect) { return (rect->pt1.x > rect->pt2.x || rect->pt1.y > rect->pt2.y); } + diff --git a/libs/libnx/nxglib/nxglib_rectadd.c b/libs/libnx/nxglib/nxglib_rectadd.c index f12e73fa1a..acb069fbb2 100644 --- a/libs/libnx/nxglib/nxglib_rectadd.c +++ b/libs/libnx/nxglib/nxglib_rectadd.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -82,3 +62,4 @@ void nxgl_rectadd(FAR struct nxgl_rect_s *dest, dest->pt2.x = ngl_max(src1->pt2.x, src2->pt2.x); dest->pt2.y = ngl_max(src1->pt2.y, src2->pt2.y); } + diff --git a/libs/libnx/nxglib/nxglib_rectcopy.c b/libs/libnx/nxglib/nxglib_rectcopy.c index 710c4d2371..19a5ab273f 100644 --- a/libs/libnx/nxglib/nxglib_rectcopy.c +++ b/libs/libnx/nxglib/nxglib_rectcopy.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -82,3 +62,4 @@ void nxgl_rectcopy(FAR struct nxgl_rect_s *dest, dest->pt2.x = src->pt2.x; dest->pt2.y = src->pt2.y; } + diff --git a/libs/libnx/nxglib/nxglib_rectinside.c b/libs/libnx/nxglib/nxglib_rectinside.c index 987f294eee..4f7d78ed42 100644 --- a/libs/libnx/nxglib/nxglib_rectinside.c +++ b/libs/libnx/nxglib/nxglib_rectinside.c @@ -43,26 +43,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -81,3 +61,4 @@ bool nxgl_rectinside(FAR const struct nxgl_rect_s *rect, return (pt->x >= rect->pt1.x && pt->x <= rect->pt2.x && pt->y >= rect->pt1.y && pt->y <= rect->pt2.y); } + diff --git a/libs/libnx/nxglib/nxglib_rectintersect.c b/libs/libnx/nxglib/nxglib_rectintersect.c index 16113df90b..a855bc00dc 100644 --- a/libs/libnx/nxglib/nxglib_rectintersect.c +++ b/libs/libnx/nxglib/nxglib_rectintersect.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -82,3 +62,4 @@ void nxgl_rectintersect(FAR struct nxgl_rect_s *dest, dest->pt2.x = ngl_min(src1->pt2.x, src2->pt2.x); dest->pt2.y = ngl_min(src1->pt2.y, src2->pt2.y); } + diff --git a/libs/libnx/nxglib/nxglib_rectoffset.c b/libs/libnx/nxglib/nxglib_rectoffset.c index 27c6b67718..7f02e7e812 100644 --- a/libs/libnx/nxglib/nxglib_rectoffset.c +++ b/libs/libnx/nxglib/nxglib_rectoffset.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -82,3 +62,4 @@ void nxgl_rectoffset(FAR struct nxgl_rect_s *dest, dest->pt2.x = src->pt2.x + dx; dest->pt2.y = src->pt2.y + dy; } + diff --git a/libs/libnx/nxglib/nxglib_rectoverlap.c b/libs/libnx/nxglib/nxglib_rectoverlap.c index 42ff91e0b5..cd570311ea 100644 --- a/libs/libnx/nxglib/nxglib_rectoverlap.c +++ b/libs/libnx/nxglib/nxglib_rectoverlap.c @@ -43,26 +43,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -87,3 +67,4 @@ bool nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1, (rect1->pt1.y <= rect2->pt2.y) && /* false: rect1 is wholly below rect2 */ (rect2->pt1.y <= rect1->pt2.y); /* false: rect2 is wholly below rect1 */ } + diff --git a/libs/libnx/nxglib/nxglib_rectsize.c b/libs/libnx/nxglib/nxglib_rectsize.c index bf8f675c03..84e7261ae0 100644 --- a/libs/libnx/nxglib/nxglib_rectsize.c +++ b/libs/libnx/nxglib/nxglib_rectsize.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -79,3 +59,4 @@ void nxgl_rectsize(FAR struct nxgl_size_s *size, size->w = rect->pt2.x - rect->pt1.x + 1; size->h = rect->pt2.y - rect->pt1.y + 1; } + diff --git a/libs/libnx/nxglib/nxglib_rectunion.c b/libs/libnx/nxglib/nxglib_rectunion.c index 4a181df701..a64d1a71fe 100644 --- a/libs/libnx/nxglib/nxglib_rectunion.c +++ b/libs/libnx/nxglib/nxglib_rectunion.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -83,3 +63,4 @@ void nxgl_rectunion(FAR struct nxgl_rect_s *dest, dest->pt2.x = ngl_max(src1->pt2.x, src2->pt2.x); dest->pt2.y = ngl_max(src1->pt2.y, src2->pt2.y); } + diff --git a/libs/libnx/nxglib/nxglib_rgb2yuv.c b/libs/libnx/nxglib/nxglib_rgb2yuv.c index da385ac58f..b521a9a64f 100644 --- a/libs/libnx/nxglib/nxglib_rgb2yuv.c +++ b/libs/libnx/nxglib/nxglib_rgb2yuv.c @@ -59,22 +59,6 @@ #define b16_P5870 0x00009646 /* 0.5870 */ #define b16_128P0 0x00800000 /* 128.0 */ -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -101,3 +85,4 @@ void nxgl_rgb2yuv(uint8_t r, uint8_t g, uint8_t b, *u = (uint8_t)b16toi(b16_128P0 - b16muli(b16_P1687, r) - b16muli(b16_P3313, g) + b16muli(b16_P5000, b)); *v = (uint8_t)b16toi(b16_128P0 + b16muli(b16_P5000, r) - b16muli(b16_P4187, g) - b16muli(b16_P0813, b)); } + diff --git a/libs/libnx/nxglib/nxglib_runcopy.c b/libs/libnx/nxglib/nxglib_runcopy.c index 194ccc468a..f545d4266e 100644 --- a/libs/libnx/nxglib/nxglib_runcopy.c +++ b/libs/libnx/nxglib/nxglib_runcopy.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,3 +60,4 @@ void nxgl_runcopy(FAR struct nxgl_run_s *dest, FAR const struct nxgl_run_s *src) dest->x2 = src->x2; dest->y = src->y; } + diff --git a/libs/libnx/nxglib/nxglib_runoffset.c b/libs/libnx/nxglib/nxglib_runoffset.c index 8e6f09a0ee..ae2ac51210 100644 --- a/libs/libnx/nxglib/nxglib_runoffset.c +++ b/libs/libnx/nxglib/nxglib_runoffset.c @@ -42,26 +42,6 @@ #include #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -83,3 +63,4 @@ void nxgl_runoffset(FAR struct nxgl_run_s *dest, dest->x2 = src->x2 + b16dx; dest->y = src->y + dy; } + diff --git a/libs/libnx/nxglib/nxglib_splitline.c b/libs/libnx/nxglib/nxglib_splitline.c index 10bffa257b..fda9af8203 100644 --- a/libs/libnx/nxglib/nxglib_splitline.c +++ b/libs/libnx/nxglib/nxglib_splitline.c @@ -46,10 +46,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Types ****************************************************************************/ @@ -60,14 +56,6 @@ struct b16point_s b16_t y; }; -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/libs/libnx/nxglib/nxglib_trapcopy.c b/libs/libnx/nxglib/nxglib_trapcopy.c index 6bb500e9ed..b1f3fedeff 100644 --- a/libs/libnx/nxglib/nxglib_trapcopy.c +++ b/libs/libnx/nxglib/nxglib_trapcopy.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,3 +60,4 @@ void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest, nxgl_runcopy(&dest->top, &src->top); nxgl_runcopy(&dest->bot, &src->bot); } + diff --git a/libs/libnx/nxglib/nxglib_trapoffset.c b/libs/libnx/nxglib/nxglib_trapoffset.c index 8aff0c368b..51ec492235 100644 --- a/libs/libnx/nxglib/nxglib_trapoffset.c +++ b/libs/libnx/nxglib/nxglib_trapoffset.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,3 +60,4 @@ void nxgl_trapoffset(FAR struct nxgl_trapezoid_s *dest, nxgl_runoffset(&dest->top, &src->top, dx, dy); nxgl_runoffset(&dest->bot, &src->bot, dx, dy); } + diff --git a/libs/libnx/nxglib/nxglib_vectoradd.c b/libs/libnx/nxglib/nxglib_vectoradd.c index 70a8e9f4bb..bb5d08a39b 100644 --- a/libs/libnx/nxglib/nxglib_vectoradd.c +++ b/libs/libnx/nxglib/nxglib_vectoradd.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,3 +60,4 @@ void nxgl_vectoradd(FAR struct nxgl_point_s *dest, dest->x = v1->x + v2->x; dest->y = v1->y + v2->y; } + diff --git a/libs/libnx/nxglib/nxglib_vectsubtract.c b/libs/libnx/nxglib/nxglib_vectsubtract.c index c52126730f..b422cf8e11 100644 --- a/libs/libnx/nxglib/nxglib_vectsubtract.c +++ b/libs/libnx/nxglib/nxglib_vectsubtract.c @@ -41,26 +41,6 @@ #include -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -80,3 +60,4 @@ void nxgl_vectsubtract(FAR struct nxgl_point_s *dest, dest->x = v1->x - v2->x; dest->y = v1->y - v2->y; } + diff --git a/libs/libnx/nxglib/nxglib_yuv2rgb.c b/libs/libnx/nxglib/nxglib_yuv2rgb.c index 4c67aa66ae..38b76bdbad 100644 --- a/libs/libnx/nxglib/nxglib_yuv2rgb.c +++ b/libs/libnx/nxglib/nxglib_yuv2rgb.c @@ -55,22 +55,6 @@ #define b16_1P772 0x0001c5a2 /* 1.722003 */ #define b16_128P0 0x00800000 /* 128.000000 */ -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -100,3 +84,4 @@ void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v, *g = (uint8_t)b16toi(itob16(y) - b16muli(b16_P3441, um128) - b16muli(b16_P7141, vm128)); *b = (uint8_t)b16toi(itob16(y) + b16muli(b16_1P772, um128)); } +