graphics/, libc/: Change some err() ERRORS to warn() WARNINGS or info()

This commit is contained in:
Gregory Nutt 2016-06-12 11:11:57 -06:00
parent b29a4dd49c
commit 4f97f15b5e
41 changed files with 121 additions and 102 deletions

View File

@ -138,7 +138,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
if (dest->pt1.x < origin->x || dest->pt1.y < origin->y) if (dest->pt1.x < origin->x || dest->pt1.y < origin->y)
{ {
gerr("Bad dest start position\n"); gerr("ERROR: Bad dest start position\n");
return; return;
} }
@ -149,7 +149,7 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
deststride = (((dest->pt2.x - origin->x + 1) * wnd->be->plane[0].pinfo.bpp + 7) >> 3); deststride = (((dest->pt2.x - origin->x + 1) * wnd->be->plane[0].pinfo.bpp + 7) >> 3);
if (deststride > stride) if (deststride > stride)
{ {
gerr("Bad dest width\n"); gerr("ERROR: Bad dest width\n");
return; return;
} }

View File

@ -115,7 +115,7 @@ static inline void nxbe_pushrectangle(FAR struct nxbe_clipstack_s *stack,
sizeof(struct nxbe_cliprect_s) * mxrects); sizeof(struct nxbe_cliprect_s) * mxrects);
if (!newstack) if (!newstack)
{ {
gerr("Failed to reallocate stack\n"); gerr("ERROR: Failed to reallocate stack\n");
return; return;
} }

View File

@ -89,7 +89,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
ret = dev->getvideoinfo(dev, &be->vinfo); ret = dev->getvideoinfo(dev, &be->vinfo);
if (ret < 0) if (ret < 0)
{ {
gerr("Failed to get vinfo\n"); gerr("ERROR: Failed to get vinfo\n");
return ret; return ret;
} }
@ -102,13 +102,13 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
#ifdef CONFIG_DEBUG_FEATURES #ifdef CONFIG_DEBUG_FEATURES
if (be->vinfo.nplanes > CONFIG_NX_NPLANES) if (be->vinfo.nplanes > CONFIG_NX_NPLANES)
{ {
gerr("NX configured for only %d planes, controller wants %d\n", gerr("ERROR: NX configured for only %d planes, controller wants %d\n",
CONFIG_NX_NPLANES, be->vinfo.nplanes); CONFIG_NX_NPLANES, be->vinfo.nplanes);
return -E2BIG; return -E2BIG;
} }
else if (be->vinfo.nplanes < CONFIG_NX_NPLANES) else if (be->vinfo.nplanes < CONFIG_NX_NPLANES)
{ {
gerr("NX configured for %d planes, controller only needs %d\n", gwarn("WARNING: NX configured for %d planes, controller only needs %d\n",
CONFIG_NX_NPLANES, be->vinfo.nplanes); CONFIG_NX_NPLANES, be->vinfo.nplanes);
} }
#endif #endif
@ -120,7 +120,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
ret = dev->getplaneinfo(dev, i, &be->plane[i].pinfo); ret = dev->getplaneinfo(dev, i, &be->plane[i].pinfo);
if (ret < 0) if (ret < 0)
{ {
gerr("Failed to get pinfo[%d]\n", i); gerr("ERROR: Failed to get pinfo[%d]\n", i);
return ret; return ret;
} }
@ -216,7 +216,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be)
else else
#endif #endif
{ {
gerr("Unsupported pinfo[%d] BPP: %d\n", i, be->plane[i].pinfo.bpp); gerr("ERROR: Unsupported pinfo[%d] BPP: %d\n", i, be->plane[i].pinfo.bpp);
return -ENOSYS; return -ENOSYS;
} }
} }

View File

@ -103,6 +103,6 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
ret = nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_newposition_s)); ret = nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_newposition_s));
if (ret < 0) if (ret < 0)
{ {
gerr("nxmu_sendclient failed: %d\n", errno); gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
} }
} }

View File

@ -105,7 +105,7 @@ int nxmu_sendclient(FAR struct nxfe_conn_s *conn, FAR const void *msg,
ret = mq_send(conn->swrmq, msg, msglen, NX_CLIMSG_PRIO); ret = mq_send(conn->swrmq, msg, msglen, NX_CLIMSG_PRIO);
if (ret < 0) if (ret < 0)
{ {
gerr("mq_send failed: %d\n", errno); gerr("ERROR: mq_send failed: %d\n", errno);
} }
return ret; return ret;

View File

@ -87,7 +87,7 @@ static inline void nxmu_disconnect(FAR struct nxfe_conn_s *conn)
ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_disconnected_s)); ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_disconnected_s));
if (ret < 0) if (ret < 0)
{ {
gerr("nxmu_sendclient failed: %d\n", errno); gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
} }
/* Close the outgoing client message queue */ /* Close the outgoing client message queue */
@ -114,7 +114,7 @@ static inline void nxmu_connect(FAR struct nxfe_conn_s *conn)
conn->swrmq = mq_open(mqname, O_WRONLY); conn->swrmq = mq_open(mqname, O_WRONLY);
if (conn->swrmq == (mqd_t)-1) if (conn->swrmq == (mqd_t)-1)
{ {
gerr("mq_open(%s) failed: %d\n", mqname, errno); gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno);
outmsg.msgid = NX_CLIMSG_DISCONNECTED; outmsg.msgid = NX_CLIMSG_DISCONNECTED;
} }
@ -124,7 +124,7 @@ static inline void nxmu_connect(FAR struct nxfe_conn_s *conn)
ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_connected_s)); ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_connected_s));
if (ret < 0) if (ret < 0)
{ {
gerr("nxmu_sendclient failed: %d\n", errno); gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
} }
} }
@ -166,7 +166,7 @@ static inline void nxmu_blocked(FAR struct nxbe_window_s *wnd, FAR void *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) if (ret < 0)
{ {
gerr("nxmu_sendclient failed: %d\n", errno); gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
} }
} }
@ -187,7 +187,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
ret = nxbe_configure(dev, &fe->be); ret = nxbe_configure(dev, &fe->be);
if (ret < 0) if (ret < 0)
{ {
gerr("nxbe_configure failed: %d\n", -ret); gerr("ERROR: nxbe_configure failed: %d\n", -ret);
errno = -ret; errno = -ret;
return ERROR; return ERROR;
} }
@ -196,7 +196,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
ret = nxbe_colormap(dev); ret = nxbe_colormap(dev);
if (ret < 0) if (ret < 0)
{ {
gerr("nxbe_colormap failed: %d\n", -ret); gerr("ERROR: nxbe_colormap failed: %d\n", -ret);
errno = -ret; errno = -ret;
return ERROR; return ERROR;
} }
@ -217,7 +217,7 @@ 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); fe->conn.crdmq = mq_open(mqname, O_RDONLY | O_CREAT, 0666, &attr);
if (fe->conn.crdmq == (mqd_t)-1) if (fe->conn.crdmq == (mqd_t)-1)
{ {
gerr("mq_open(%s) failed: %d\n", mqname, errno); gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno);
return ERROR; /* mq_open sets errno */ return ERROR; /* mq_open sets errno */
} }
@ -233,7 +233,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev,
fe->conn.swrmq = mq_open(mqname, O_WRONLY); fe->conn.swrmq = mq_open(mqname, O_WRONLY);
if (fe->conn.swrmq == (mqd_t)-1) if (fe->conn.swrmq == (mqd_t)-1)
{ {
gerr("mq_open(%s) failed: %d\n", mqname, errno); gerr("ERROR: mq_open(%s) failed: %d\n", mqname, errno);
mq_close(fe->conn.crdmq); mq_close(fe->conn.crdmq);
return ERROR; /* mq_open sets errno */ return ERROR; /* mq_open sets errno */
} }
@ -334,7 +334,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
{ {
if (errno != EINTR) if (errno != EINTR)
{ {
gerr("mq_receive failed: %d\n", errno); gerr("ERROR: mq_receive failed: %d\n", errno);
goto errout; /* mq_receive sets errno */ goto errout; /* mq_receive sets errno */
} }
continue; continue;
@ -545,7 +545,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev)
case NX_CLIMSG_CONNECTED: /* Shouldn't happen */ case NX_CLIMSG_CONNECTED: /* Shouldn't happen */
case NX_CLIMSG_DISCONNECTED: case NX_CLIMSG_DISCONNECTED:
default: default:
gerr("Unrecognized command: %d\n", msg->msgid); gerr("ERROR: Unrecognized command: %d\n", msg->msgid);
break; break;
} }
} }

View File

@ -120,7 +120,7 @@ static inline int nxsu_setup(FAR NX_DRIVERTYPE *dev,
ret = nxbe_configure(dev, &fe->be); ret = nxbe_configure(dev, &fe->be);
if (ret < 0) if (ret < 0)
{ {
gerr("nxbe_configure failed: %d\n", -ret); gerr("ERROR: nxbe_configure failed: %d\n", -ret);
errno = -ret; errno = -ret;
return ERROR; return ERROR;
} }
@ -129,7 +129,7 @@ static inline int nxsu_setup(FAR NX_DRIVERTYPE *dev,
ret = nxbe_colormap(dev); ret = nxbe_colormap(dev);
if (ret < 0) if (ret < 0)
{ {
gerr("nxbe_colormap failed: %d\n", -ret); gerr("ERROR: nxbe_colormap failed: %d\n", -ret);
errno = -ret; errno = -ret;
return ERROR; return ERROR;
} }

View File

@ -318,7 +318,7 @@ nxterm_renderglyph(FAR struct nxterm_state_s *priv,
{ {
/* Actually, the RENDERER never returns a failure */ /* Actually, the RENDERER never returns a failure */
gerr("nxterm_renderglyph: RENDERER failed\n"); gerr("ERROR: nxterm_renderglyph: RENDERER failed\n");
nxterm_freeglyph(glyph); nxterm_freeglyph(glyph);
glyph = NULL; glyph = NULL;
} }

View File

@ -137,7 +137,7 @@ void nxterm_redraw(NXTERM handle, FAR const struct nxgl_rect_s *rect, bool more)
ret = priv->ops->fill(priv, rect, priv->wndo.wcolor); ret = priv->ops->fill(priv, rect, priv->wndo.wcolor);
if (ret < 0) if (ret < 0)
{ {
gerr("fill failed: %d\n", errno); gerr("ERROR: fill failed: %d\n", errno);
} }
/* Then redraw each character on the display (Only the characters within /* Then redraw each character on the display (Only the characters within

View File

@ -87,7 +87,7 @@ FAR struct nxterm_state_s *
priv = (FAR struct nxterm_state_s *)kmm_zalloc(sizeof(struct nxterm_state_s)); priv = (FAR struct nxterm_state_s *)kmm_zalloc(sizeof(struct nxterm_state_s));
if (!priv) if (!priv)
{ {
gerr("Failed to allocate the NX driver structure\n"); gerr("ERROR: Failed to allocate the NX driver structure\n");
return NULL; return NULL;
} }
@ -112,7 +112,7 @@ FAR struct nxterm_state_s *
priv->font = nxf_getfonthandle(wndo->fontid); priv->font = nxf_getfonthandle(wndo->fontid);
if (!priv->font) if (!priv->font)
{ {
gerr("Failed to get font ID %d: %d\n", wndo->fontid, errno); gerr("ERROR: Failed to get font ID %d: %d\n", wndo->fontid, errno);
goto errout; goto errout;
} }
@ -150,7 +150,7 @@ FAR struct nxterm_state_s *
ret = register_driver(devname, &g_nxterm_drvrops, 0666, priv); ret = register_driver(devname, &g_nxterm_drvrops, 0666, priv);
if (ret < 0) if (ret < 0)
{ {
gerr("Failed to register %s\n", devname); gerr("ERROR: Failed to register %s\n", devname);
} }
return (NXTERM)priv; return (NXTERM)priv;

View File

@ -118,7 +118,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor);
if (ret < 0) if (ret < 0)
{ {
gerr("Fill failed: %d\n", errno); gerr("ERROR: Fill failed: %d\n", errno);
} }
/* Fill each character that might lie within in the bounding box */ /* Fill each character that might lie within in the bounding box */
@ -141,7 +141,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor);
if (ret < 0) if (ret < 0)
{ {
gerr("Fill failed: %d\n", errno); gerr("ERROR: Fill failed: %d\n", errno);
} }
} }
#else #else
@ -177,7 +177,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
ret = priv->ops->move(priv, &rect, &offset); ret = priv->ops->move(priv, &rect, &offset);
if (ret < 0) if (ret < 0)
{ {
gerr("Move failed: %d\n", errno); gerr("ERROR: Move failed: %d\n", errno);
} }
/* Finally, clear the vacated bottom part of the display */ /* Finally, clear the vacated bottom part of the display */
@ -187,7 +187,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv,
ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor);
if (ret < 0) if (ret < 0)
{ {
gerr("Fill failed: %d\n", errno); gerr("ERROR: Fill failed: %d\n", errno);
} }
} }
#endif #endif

View File

@ -237,7 +237,7 @@ static int up_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
return OK; return OK;
} }
gerr("Returning EINVAL\n"); gerr("ERROR: Returning EINVAL\n");
return -EINVAL; return -EINVAL;
} }
@ -274,7 +274,7 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable,
return OK; return OK;
} }
gerr("Returning EINVAL\n"); gerr("ERROR: Returning EINVAL\n");
return -EINVAL; return -EINVAL;
} }
#endif #endif
@ -311,7 +311,7 @@ static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s
return OK; return OK;
} }
gerr("Returning EINVAL\n"); gerr("ERROR: Returning EINVAL\n");
return -EINVAL; return -EINVAL;
} }
#endif #endif
@ -347,7 +347,8 @@ static int up_getcursor(FAR struct fb_vtable_s *vtable,
return OK; return OK;
} }
gerr("Returning EINVAL\n");
gerr("ERROR: Returning EINVAL\n");
return -EINVAL; return -EINVAL;
} }
#endif #endif
@ -400,7 +401,7 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable,
return OK; return OK;
} }
gerr("Returning EINVAL\n"); gerr("ERROR: Returning EINVAL\n");
return -EINVAL; return -EINVAL;
} }
#endif #endif

View File

@ -168,7 +168,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
} }
else if (nrecvd == 0) else if (nrecvd == 0)
{ {
gerr("Connection closed\n"); gwarn("WARNING: Connection closed\n");
return -ECONNABORTED; return -ECONNABORTED;
} }
@ -240,7 +240,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
} }
else if (nrecvd == 0) else if (nrecvd == 0)
{ {
gerr("Connection closed\n"); gwarn("WARNING: Connection closed\n");
return -ECONNABORTED; return -ECONNABORTED;
} }
@ -329,7 +329,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
} }
else if (nrecvd == 0) else if (nrecvd == 0)
{ {
gerr("Connection closed\n"); gwarn("WARNING: Connection closed\n");
return -ECONNABORTED; return -ECONNABORTED;
} }
@ -404,7 +404,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
} }
else if (nrecvd == 0) else if (nrecvd == 0)
{ {
gerr("Connection closed\n"); gwarn("WARNING: Connection closed\n");
return -ECONNABORTED; return -ECONNABORTED;
} }
else if (nrecvd != sizeof(struct rfb_setpixelformat_s)) else if (nrecvd != sizeof(struct rfb_setpixelformat_s))
@ -451,7 +451,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
} }
else if (nrecvd == 0) else if (nrecvd == 0)
{ {
gerr("Connection closed\n"); gwarn("WARNING: Connection closed\n");
return -ECONNABORTED; return -ECONNABORTED;
} }

View File

@ -186,7 +186,7 @@ int vnc_receiver(FAR struct vnc_session_s *session)
else if (nrecvd == 0) else if (nrecvd == 0)
{ {
gerr("Connection closed\n", errcode); gwarn("WARNING: Connection closed\n", errcode);
return OK; return OK;
} }

View File

@ -190,9 +190,13 @@
# define updllerr(format, ...) llerr(format, ##__VA_ARGS__) # define updllerr(format, ...) llerr(format, ##__VA_ARGS__)
# define updinfo(format, ...) info(format, ##__VA_ARGS__) # define updinfo(format, ...) info(format, ##__VA_ARGS__)
# define updllinfo(format, ...) llinfo(format, ##__VA_ARGS__) # define updllinfo(format, ...) llinfo(format, ##__VA_ARGS__)
# define updinfo(format, ...) info(format, ##__VA_ARGS__)
# define updllinfo(format, ...) llinfo(format, ##__VA_ARGS__)
# else # else
# define upderr err # define upderr err
# define updllerr llerr # define updllerr llerr
# define updwarn warn
# define updllwarn llwarn
# define updinfo info # define updinfo info
# define updllinfo llinfo # define updllinfo llinfo
# endif # endif
@ -200,11 +204,15 @@
# ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_CPP_HAVE_VARARGS
# define upderr(x...) # define upderr(x...)
# define updllerr(x...) # define updllerr(x...)
# define updwarn(x...)
# define updllwarn(x...)
# define updinfo(x...) # define updinfo(x...)
# define updllinfo(x...) # define updllinfo(x...)
# else # else
# define upderr (void) # define upderr (void)
# define updllerr (void) # define updllerr (void)
# define updwarn (void)
# define updllwarn (void)
# define updinfo (void) # define updinfo (void)
# define updllinfo (void) # define updllinfo (void)
# endif # endif

View File

@ -79,7 +79,7 @@ CSRCS += lib_crc64.c lib_crc32.c lib_crc16.c lib_crc8.c
CSRCS += lib_dumpbuffer.c lib_match.c CSRCS += lib_dumpbuffer.c lib_match.c
ifeq ($(CONFIG_DEBUG_FEATURES),y) ifeq ($(CONFIG_DEBUG_FEATURES),y)
CSRCS += lib_dbg.c CSRCS += lib_debug.c
endif endif
# Keyboard driver encoder/decoder # Keyboard driver encoder/decoder

View File

@ -93,9 +93,11 @@
#ifdef CONFIG_DEBUG_LCD #ifdef CONFIG_DEBUG_LCD
# define lcderr err # define lcderr err
# define lcdwarn warn
# define lcdinfo info # define lcdinfo info
#else #else
# define lcderr(x...) # define lcderr(x...)
# define lcdwarn(x...)
# define lcdinfo(x...) # define lcdinfo(x...)
#endif #endif
@ -264,7 +266,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
* return the following characters later. * return the following characters later.
*/ */
lcderr("Parsing failed: ESC followed by %02x\n", ch); lcderr("ERROR: Parsing failed: ESC followed by %02x\n", ch);
return slcd_reget(state, pch, parg); return slcd_reget(state, pch, parg);
} }
@ -295,7 +297,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
if (code < (int)FIRST_SLCDCODE || code > (int)LAST_SLCDCODE) if (code < (int)FIRST_SLCDCODE || code > (int)LAST_SLCDCODE)
{ {
lcderr("Parsing failed: ESC-L followed by %02x\n", ch); lcderr("ERROR: Parsing failed: ESC-L followed by %02x\n", ch);
/* Not a special command code.. put the character in the reget /* Not a special command code.. put the character in the reget
* buffer. * buffer.
@ -338,7 +340,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
* following characters later. * following characters later.
*/ */
lcderr("Parsing failed: ESC-L-%c followed by %02x\n", lcderr("ERROR: Parsing failed: ESC-L-%c followed by %02x\n",
state->buf[NDX_COUNTH], ch); state->buf[NDX_COUNTH], ch);
return slcd_reget(state, pch, parg); return slcd_reget(state, pch, parg);
@ -384,7 +386,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
* of the characters later. * of the characters later.
*/ */
lcderr("Parsing failed: ESC-L-%c-%c followed by %02x\n", lcderr("ERROR: Parsing failed: ESC-L-%c-%c followed by %02x\n",
state->buf[NDX_COUNTH], state->buf[NDX_COUNTL], ch); state->buf[NDX_COUNTH], state->buf[NDX_COUNTL], ch);
return slcd_reget(state, pch, parg); return slcd_reget(state, pch, parg);

View File

@ -283,16 +283,16 @@ static int dns_recv_response(int sd, FAR struct sockaddr *addr,
* match. * match.
*/ */
#ifdef CONFIG_DEBUG_NET #if defined(CONFIG_DEBUG_NET) && defined(CONFIG_DEBUG_INFO)
{ {
int d = 64; int d = 64;
nameptr = dns_parse_name((uint8_t *)buffer + 12) + 4; nameptr = dns_parse_name((uint8_t *)buffer + 12) + 4;
for (; ; ) for (; ; )
{ {
nerr("%02X %02X %02X %02X %02X %02X %02X %02X \n", ninfo("%02X %02X %02X %02X %02X %02X %02X %02X \n",
nameptr[0], nameptr[1], nameptr[2], nameptr[3], nameptr[0], nameptr[1], nameptr[2], nameptr[3],
nameptr[4], nameptr[5], nameptr[6], nameptr[7]); nameptr[4], nameptr[5], nameptr[6], nameptr[7]);
nameptr += 8; nameptr += 8;
d -= 8; d -= 8;

View File

@ -69,7 +69,7 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr)
{ {
int ret; int ret;
serr("attr=0x%p\n", attr); linfo("attr=0x%p\n", attr);
if (!attr) if (!attr)
{ {
@ -81,7 +81,7 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr)
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -66,7 +66,7 @@
int pthread_attr_getaffinity_np(FAR const pthread_attr_t *attr, int pthread_attr_getaffinity_np(FAR const pthread_attr_t *attr,
size_t cpusetsize, cpu_set_t *cpuset) size_t cpusetsize, cpu_set_t *cpuset)
{ {
serr("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset); linfo("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset);
DEBUGASSERT(attr != NULL && cpusetsize == sizeof(cpu_set_t) && cpuset != NULL); DEBUGASSERT(attr != NULL && cpusetsize == sizeof(cpu_set_t) && cpuset != NULL);

View File

@ -72,7 +72,7 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr,
{ {
int ret; int ret;
serr("attr=0x%p inheritsched=0x%p\n", attr, inheritsched); linfo("attr=0x%p inheritsched=0x%p\n", attr, inheritsched);
if (!attr || !inheritsched) if (!attr || !inheritsched)
{ {
@ -84,8 +84,6 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr,
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -70,7 +70,7 @@ int pthread_attr_getschedparam(FAR const pthread_attr_t *attr,
{ {
int ret; int ret;
serr("attr=0x%p param=0x%p\n", attr, param); linfo("attr=0x%p param=0x%p\n", attr, param);
if (!attr || !param) if (!attr || !param)
{ {
@ -90,6 +90,6 @@ int pthread_attr_getschedparam(FAR const pthread_attr_t *attr,
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -68,7 +68,7 @@ int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy)
{ {
int ret; int ret;
serr("attr=0x%p policy=0x%p\n", attr, policy); linfo("attr=0x%p policy=0x%p\n", attr, policy);
if (!attr || !policy) if (!attr || !policy)
{ {
@ -80,6 +80,6 @@ int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy)
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -67,7 +67,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz
{ {
int ret; int ret;
serr("attr=0x%p stacksize=0x%p\n", attr, stacksize); linfo("attr=0x%p stacksize=0x%p\n", attr, stacksize);
if (!stacksize) if (!stacksize)
{ {
@ -79,7 +79,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -87,7 +87,7 @@ int pthread_attr_init(FAR pthread_attr_t *attr)
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p\n", attr); linfo("attr=0x%p\n", attr);
if (!attr) if (!attr)
{ {
ret = ENOMEM; ret = ENOMEM;
@ -102,7 +102,7 @@ int pthread_attr_init(FAR pthread_attr_t *attr)
memcpy(attr, &g_default_pthread_attr, sizeof(pthread_attr_t)); memcpy(attr, &g_default_pthread_attr, sizeof(pthread_attr_t));
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -68,7 +68,7 @@ int pthread_attr_setaffinity_np(FAR pthread_attr_t *attr,
size_t cpusetsize, size_t cpusetsize,
FAR const cpu_set_t *cpuset) FAR const cpu_set_t *cpuset)
{ {
serr("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset); linfo("attr=0x%p cpusetsize=%d cpuset=0x%p\n", attr, (int)cpusetsize, cpuset);
DEBUGASSERT(attr != NULL && cpusetsize == sizeof(cpu_set_t) && DEBUGASSERT(attr != NULL && cpusetsize == sizeof(cpu_set_t) &&
cpuset != NULL && *cpuset != 0); cpuset != NULL && *cpuset != 0);

View File

@ -73,7 +73,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr,
{ {
int ret; int ret;
serr("inheritsched=%d\n", inheritsched); linfo("inheritsched=%d\n", inheritsched);
if (!attr || if (!attr ||
(inheritsched != PTHREAD_INHERIT_SCHED && (inheritsched != PTHREAD_INHERIT_SCHED &&
@ -87,7 +87,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr,
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -70,7 +70,7 @@ int pthread_attr_setschedparam(FAR pthread_attr_t *attr,
{ {
int ret; int ret;
serr("attr=0x%p param=0x%p\n", attr, param); linfo("attr=0x%p param=0x%p\n", attr, param);
if (!attr || !param) if (!attr || !param)
{ {
@ -90,6 +90,6 @@ int pthread_attr_setschedparam(FAR pthread_attr_t *attr,
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -70,7 +70,7 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy)
{ {
int ret; int ret;
serr("attr=0x%p policy=%d\n", attr, policy); linfo("attr=0x%p policy=%d\n", attr, policy);
if (!attr || if (!attr ||
(policy != SCHED_FIFO (policy != SCHED_FIFO
@ -90,6 +90,6 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy)
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -68,7 +68,7 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize)
{ {
int ret; int ret;
serr("attr=0x%p stacksize=%ld\n", attr, stacksize); linfo("attr=0x%p stacksize=%ld\n", attr, stacksize);
if (!attr || stacksize < PTHREAD_STACK_MIN) if (!attr || stacksize < PTHREAD_STACK_MIN)
{ {
@ -80,7 +80,7 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize)
ret = OK; ret = OK;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -67,14 +67,14 @@ int pthread_condattr_destroy(FAR pthread_condattr_t *attr)
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p\n", attr); linfo("attr=0x%p\n", attr);
if (!attr) if (!attr)
{ {
ret = EINVAL; ret = EINVAL;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -67,7 +67,7 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr)
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p\n", attr); linfo("attr=0x%p\n", attr);
if (!attr) if (!attr)
{ {
@ -78,7 +78,7 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr)
*attr = 0; *attr = 0;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -68,7 +68,7 @@ int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr)
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p\n", attr); linfo("attr=0x%p\n", attr);
if (!attr) if (!attr)
{ {
@ -79,6 +79,6 @@ int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr)
attr->pshared = 0; attr->pshared = 0;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -68,7 +68,7 @@ int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *p
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p pshared=0x%p\n", attr, pshared); linfo("attr=0x%p pshared=0x%p\n", attr, pshared);
if (!attr || !pshared) if (!attr || !pshared)
{ {
@ -79,6 +79,6 @@ int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *p
*pshared = attr->pshared; *pshared = attr->pshared;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -67,7 +67,7 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr)
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p\n", attr); linfo("attr=0x%p\n", attr);
if (!attr) if (!attr)
{ {
@ -81,6 +81,6 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr)
#endif #endif
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -68,7 +68,7 @@ int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared)
{ {
int ret = OK; int ret = OK;
serr("attr=0x%p pshared=%d\n", attr, pshared); linfo("attr=0x%p pshared=%d\n", attr, pshared);
if (!attr || (pshared != 0 && pshared != 1)) if (!attr || (pshared != 0 && pshared != 1))
{ {
@ -79,6 +79,6 @@ int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared)
attr->pshared = pshared; attr->pshared = pshared;
} }
serr("Returning %d\n", ret); linfo("Returning %d\n", ret);
return ret; return ret;
} }

View File

@ -39,6 +39,15 @@
#include <nuttx/config.h> #include <nuttx/config.h>
/* Output debug info even if debug output is not selected. */
#undef CONFIG_DEBUG_ERROR
#undef CONFIG_DEBUG_WARN
#undef CONFIG_DEBUG_INFO
#define CONFIG_DEBUG_ERROR 1
#define CONFIG_DEBUG_WARN 1
#define CONFIG_DEBUG_INFO 1
#include <spawn.h> #include <spawn.h>
#include <debug.h> #include <debug.h>

View File

@ -556,15 +556,16 @@ static int cmp(Bigint * a, Bigint * b)
i = a->wds; i = a->wds;
j = b->wds; j = b->wds;
#ifdef CONFIG_DEBUG_LIB #ifdef CONFIG_DEBUG_LIB
if (i > 1 && !a->x[i - 1]) if (i > 1 && !a->x[i - 1])
{ {
lerr("cmp called with a->x[a->wds-1] == 0\n"); lerr("ERROR: cmp called with a->x[a->wds-1] == 0\n");
} }
if (j > 1 && !b->x[j - 1]) if (j > 1 && !b->x[j - 1])
{ {
lerr("cmp called with b->x[b->wds-1] == 0\n"); lerr("ERROR: cmp called with b->x[b->wds-1] == 0\n");
} }
#endif #endif
@ -722,7 +723,7 @@ static Bigint *d2b(double d, int *e, int *bits)
#ifdef CONFIG_DEBUG_LIB #ifdef CONFIG_DEBUG_LIB
if (!z) if (!z)
{ {
lerr("Zero passed to d2b\n"); lerr("ERROR: Zero passed to d2b\n");
} }
#endif #endif
k = lo0bits(&z); k = lo0bits(&z);
@ -763,7 +764,7 @@ static Bigint *d2b(double d, int *e, int *bits)
#ifdef CONFIG_DEBUG_LIB #ifdef CONFIG_DEBUG_LIB
if (!z) if (!z)
{ {
lerr("Zero passed to d2b\n"); lerr("ERROR: Zero passed to d2b\n");
} }
#endif #endif
k = lo0bits(&z); k = lo0bits(&z);
@ -851,7 +852,7 @@ static int quorem(Bigint * b, Bigint * S)
#ifdef CONFIG_DEBUG_LIB #ifdef CONFIG_DEBUG_LIB
if (b->wds > n) if (b->wds > n)
{ {
lerr("oversize b in quorem\n"); lerr("ERROR: oversize b in quorem\n");
} }
#endif #endif
if (b->wds < n) if (b->wds < n)
@ -867,7 +868,7 @@ static int quorem(Bigint * b, Bigint * S)
#ifdef CONFIG_DEBUG_LIB #ifdef CONFIG_DEBUG_LIB
if (q > 9) if (q > 9)
{ {
lerr("oversized quotient in quorem\n"); lerr("ERROR: oversized quotient in quorem\n");
} }
#endif #endif

View File

@ -317,7 +317,7 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result)
/* Get the seconds since the EPOCH */ /* Get the seconds since the EPOCH */
epoch = *timer; epoch = *timer;
serr("timer=%d\n", (int)epoch); linfo("timer=%d\n", (int)epoch);
/* Convert to days, hours, minutes, and seconds since the EPOCH */ /* Convert to days, hours, minutes, and seconds since the EPOCH */
@ -332,15 +332,15 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result)
sec = epoch; sec = epoch;
serr("hour=%d min=%d sec=%d\n", linfo("hour=%d min=%d sec=%d\n",
(int)hour, (int)min, (int)sec); (int)hour, (int)min, (int)sec);
/* Convert the days since the EPOCH to calendar day */ /* Convert the days since the EPOCH to calendar day */
clock_utc2calendar(jdn, &year, &month, &day); clock_utc2calendar(jdn, &year, &month, &day);
serr("jdn=%d year=%d month=%d day=%d\n", linfo("jdn=%d year=%d month=%d day=%d\n",
(int)jdn, (int)year, (int)month, (int)day); (int)jdn, (int)year, (int)month, (int)day);
/* Then return the struct tm contents */ /* Then return the struct tm contents */

View File

@ -94,14 +94,14 @@ time_t mktime(FAR struct tm *tp)
*/ */
jdn = clock_calendar2utc(tp->tm_year + 1900, tp->tm_mon, tp->tm_mday); jdn = clock_calendar2utc(tp->tm_year + 1900, tp->tm_mon, tp->tm_mday);
serr("jdn=%d tm_year=%d tm_mon=%d tm_mday=%d\n", linfo("jdn=%d tm_year=%d tm_mon=%d tm_mday=%d\n",
(int)jdn, tp->tm_year, tp->tm_mon, tp->tm_mday); (int)jdn, tp->tm_year, tp->tm_mon, tp->tm_mday);
/* Return the seconds into the julian day. */ /* Return the seconds into the julian day. */
ret = ((jdn * 24 + tp->tm_hour) * 60 + tp->tm_min) * 60 + tp->tm_sec; ret = ((jdn * 24 + tp->tm_hour) * 60 + tp->tm_min) * 60 + tp->tm_sec;
serr("ret=%d tm_hour=%d tm_min=%d tm_sec=%d\n", linfo("ret=%d tm_hour=%d tm_min=%d tm_sec=%d\n",
(int)ret, tp->tm_hour, tp->tm_min, tp->tm_sec); (int)ret, tp->tm_hour, tp->tm_min, tp->tm_sec);
return ret; return ret;
} }