From 4f97f15b5e46703937b88feb02f3e50771b7a169 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 12 Jun 2016 11:11:57 -0600 Subject: [PATCH] graphics/, libc/: Change some err() ERRORS to warn() WARNINGS or info() --- graphics/nxbe/nxbe_bitmap.c | 4 ++-- graphics/nxbe/nxbe_clipper.c | 2 +- graphics/nxbe/nxbe_configure.c | 10 +++++----- graphics/nxmu/nxmu_reportposition.c | 2 +- graphics/nxmu/nxmu_sendclient.c | 2 +- graphics/nxmu/nxmu_server.c | 20 ++++++++++---------- graphics/nxsu/nx_open.c | 4 ++-- graphics/nxterm/nxterm_font.c | 2 +- graphics/nxterm/nxterm_redraw.c | 2 +- graphics/nxterm/nxterm_register.c | 6 +++--- graphics/nxterm/nxterm_scroll.c | 8 ++++---- graphics/vnc/server/vnc_fbdev.c | 11 ++++++----- graphics/vnc/server/vnc_negotiate.c | 10 +++++----- graphics/vnc/server/vnc_receiver.c | 2 +- graphics/vnc/server/vnc_server.h | 8 ++++++++ libc/misc/Make.defs | 2 +- libc/misc/{lib_dbg.c => lib_debug.c} | 0 libc/misc/lib_slcddecode.c | 10 ++++++---- libc/netdb/lib_dnsquery.c | 8 ++++---- libc/pthread/pthread_attrdestroy.c | 4 ++-- libc/pthread/pthread_attrgetaffinity.c | 2 +- libc/pthread/pthread_attrgetinheritsched.c | 6 ++---- libc/pthread/pthread_attrgetschedparam.c | 4 ++-- libc/pthread/pthread_attrgetschedpolicy.c | 4 ++-- libc/pthread/pthread_attrgetstacksize.c | 4 ++-- libc/pthread/pthread_attrinit.c | 4 ++-- libc/pthread/pthread_attrsetaffinity.c | 2 +- libc/pthread/pthread_attrsetinheritsched.c | 4 ++-- libc/pthread/pthread_attrsetschedparam.c | 4 ++-- libc/pthread/pthread_attrsetschedpolicy.c | 4 ++-- libc/pthread/pthread_attrsetstacksize.c | 4 ++-- libc/pthread/pthread_condattrdestroy.c | 4 ++-- libc/pthread/pthread_condattrinit.c | 4 ++-- libc/pthread/pthread_mutexattrdestroy.c | 4 ++-- libc/pthread/pthread_mutexattrgetpshared.c | 4 ++-- libc/pthread/pthread_mutexattrinit.c | 4 ++-- libc/pthread/pthread_mutexattrsetpshared.c | 4 ++-- libc/spawn/lib_psa_dump.c | 9 +++++++++ libc/stdio/lib_dtoa.c | 13 +++++++------ libc/time/lib_gmtimer.c | 10 +++++----- libc/time/lib_mktime.c | 8 ++++---- 41 files changed, 121 insertions(+), 102 deletions(-) rename libc/misc/{lib_dbg.c => lib_debug.c} (100%) diff --git a/graphics/nxbe/nxbe_bitmap.c b/graphics/nxbe/nxbe_bitmap.c index 94069fa124..61a380ca10 100644 --- a/graphics/nxbe/nxbe_bitmap.c +++ b/graphics/nxbe/nxbe_bitmap.c @@ -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) { - gerr("Bad dest start position\n"); + gerr("ERROR: Bad dest start position\n"); 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); if (deststride > stride) { - gerr("Bad dest width\n"); + gerr("ERROR: Bad dest width\n"); return; } diff --git a/graphics/nxbe/nxbe_clipper.c b/graphics/nxbe/nxbe_clipper.c index 652b6e61c0..e73ba6c853 100644 --- a/graphics/nxbe/nxbe_clipper.c +++ b/graphics/nxbe/nxbe_clipper.c @@ -115,7 +115,7 @@ static inline void nxbe_pushrectangle(FAR struct nxbe_clipstack_s *stack, sizeof(struct nxbe_cliprect_s) * mxrects); if (!newstack) { - gerr("Failed to reallocate stack\n"); + gerr("ERROR: Failed to reallocate stack\n"); return; } diff --git a/graphics/nxbe/nxbe_configure.c b/graphics/nxbe/nxbe_configure.c index 4fd38552f3..891d2e15c5 100644 --- a/graphics/nxbe/nxbe_configure.c +++ b/graphics/nxbe/nxbe_configure.c @@ -89,7 +89,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) ret = dev->getvideoinfo(dev, &be->vinfo); if (ret < 0) { - gerr("Failed to get vinfo\n"); + gerr("ERROR: Failed to get vinfo\n"); return ret; } @@ -102,13 +102,13 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) #ifdef CONFIG_DEBUG_FEATURES 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); return -E2BIG; } 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); } #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); if (ret < 0) { - gerr("Failed to get pinfo[%d]\n", i); + gerr("ERROR: Failed to get pinfo[%d]\n", i); return ret; } @@ -216,7 +216,7 @@ int nxbe_configure(FAR NX_DRIVERTYPE *dev, FAR struct nxbe_state_s *be) else #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; } } diff --git a/graphics/nxmu/nxmu_reportposition.c b/graphics/nxmu/nxmu_reportposition.c index 5e7584464c..757873ac1e 100644 --- a/graphics/nxmu/nxmu_reportposition.c +++ b/graphics/nxmu/nxmu_reportposition.c @@ -103,6 +103,6 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd) ret = nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_newposition_s)); if (ret < 0) { - gerr("nxmu_sendclient failed: %d\n", errno); + gerr("ERROR: nxmu_sendclient failed: %d\n", errno); } } diff --git a/graphics/nxmu/nxmu_sendclient.c b/graphics/nxmu/nxmu_sendclient.c index 511b5814a1..7a0ab2be7b 100644 --- a/graphics/nxmu/nxmu_sendclient.c +++ b/graphics/nxmu/nxmu_sendclient.c @@ -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); if (ret < 0) { - gerr("mq_send failed: %d\n", errno); + gerr("ERROR: mq_send failed: %d\n", errno); } return ret; diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c index 28b37518b9..5ceb92d532 100644 --- a/graphics/nxmu/nxmu_server.c +++ b/graphics/nxmu/nxmu_server.c @@ -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)); if (ret < 0) { - gerr("nxmu_sendclient failed: %d\n", errno); + gerr("ERROR: nxmu_sendclient failed: %d\n", errno); } /* 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); 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; } @@ -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)); 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)); 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); if (ret < 0) { - gerr("nxbe_configure failed: %d\n", -ret); + gerr("ERROR: nxbe_configure failed: %d\n", -ret); errno = -ret; return ERROR; } @@ -196,7 +196,7 @@ static inline int nxmu_setup(FAR const char *mqname, FAR NX_DRIVERTYPE *dev, ret = nxbe_colormap(dev); if (ret < 0) { - gerr("nxbe_colormap failed: %d\n", -ret); + gerr("ERROR: nxbe_colormap failed: %d\n", -ret); errno = -ret; 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); 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 */ } @@ -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); 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); return ERROR; /* mq_open sets errno */ } @@ -334,7 +334,7 @@ int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev) { if (errno != EINTR) { - gerr("mq_receive failed: %d\n", errno); + gerr("ERROR: mq_receive failed: %d\n", errno); goto errout; /* mq_receive sets errno */ } 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_DISCONNECTED: default: - gerr("Unrecognized command: %d\n", msg->msgid); + gerr("ERROR: Unrecognized command: %d\n", msg->msgid); break; } } diff --git a/graphics/nxsu/nx_open.c b/graphics/nxsu/nx_open.c index 202e011ee8..5162c02004 100644 --- a/graphics/nxsu/nx_open.c +++ b/graphics/nxsu/nx_open.c @@ -120,7 +120,7 @@ static inline int nxsu_setup(FAR NX_DRIVERTYPE *dev, ret = nxbe_configure(dev, &fe->be); if (ret < 0) { - gerr("nxbe_configure failed: %d\n", -ret); + gerr("ERROR: nxbe_configure failed: %d\n", -ret); errno = -ret; return ERROR; } @@ -129,7 +129,7 @@ static inline int nxsu_setup(FAR NX_DRIVERTYPE *dev, ret = nxbe_colormap(dev); if (ret < 0) { - gerr("nxbe_colormap failed: %d\n", -ret); + gerr("ERROR: nxbe_colormap failed: %d\n", -ret); errno = -ret; return ERROR; } diff --git a/graphics/nxterm/nxterm_font.c b/graphics/nxterm/nxterm_font.c index 7c8035aebb..b3e95d220d 100644 --- a/graphics/nxterm/nxterm_font.c +++ b/graphics/nxterm/nxterm_font.c @@ -318,7 +318,7 @@ nxterm_renderglyph(FAR struct nxterm_state_s *priv, { /* Actually, the RENDERER never returns a failure */ - gerr("nxterm_renderglyph: RENDERER failed\n"); + gerr("ERROR: nxterm_renderglyph: RENDERER failed\n"); nxterm_freeglyph(glyph); glyph = NULL; } diff --git a/graphics/nxterm/nxterm_redraw.c b/graphics/nxterm/nxterm_redraw.c index 8130dfae68..925495dfd2 100644 --- a/graphics/nxterm/nxterm_redraw.c +++ b/graphics/nxterm/nxterm_redraw.c @@ -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); 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 diff --git a/graphics/nxterm/nxterm_register.c b/graphics/nxterm/nxterm_register.c index 797e60f49a..41cd456789 100644 --- a/graphics/nxterm/nxterm_register.c +++ b/graphics/nxterm/nxterm_register.c @@ -87,7 +87,7 @@ FAR struct nxterm_state_s * priv = (FAR struct nxterm_state_s *)kmm_zalloc(sizeof(struct nxterm_state_s)); if (!priv) { - gerr("Failed to allocate the NX driver structure\n"); + gerr("ERROR: Failed to allocate the NX driver structure\n"); return NULL; } @@ -112,7 +112,7 @@ FAR struct nxterm_state_s * priv->font = nxf_getfonthandle(wndo->fontid); 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; } @@ -150,7 +150,7 @@ FAR struct nxterm_state_s * ret = register_driver(devname, &g_nxterm_drvrops, 0666, priv); if (ret < 0) { - gerr("Failed to register %s\n", devname); + gerr("ERROR: Failed to register %s\n", devname); } return (NXTERM)priv; diff --git a/graphics/nxterm/nxterm_scroll.c b/graphics/nxterm/nxterm_scroll.c index ff648c7421..50a983a56e 100644 --- a/graphics/nxterm/nxterm_scroll.c +++ b/graphics/nxterm/nxterm_scroll.c @@ -118,7 +118,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); 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 */ @@ -141,7 +141,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); if (ret < 0) { - gerr("Fill failed: %d\n", errno); + gerr("ERROR: Fill failed: %d\n", errno); } } #else @@ -177,7 +177,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->move(priv, &rect, &offset); 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 */ @@ -187,7 +187,7 @@ static inline void nxterm_movedisplay(FAR struct nxterm_state_s *priv, ret = priv->ops->fill(priv, &rect, priv->wndo.wcolor); if (ret < 0) { - gerr("Fill failed: %d\n", errno); + gerr("ERROR: Fill failed: %d\n", errno); } } #endif diff --git a/graphics/vnc/server/vnc_fbdev.c b/graphics/vnc/server/vnc_fbdev.c index 13e81330c9..2e56d53e8e 100644 --- a/graphics/vnc/server/vnc_fbdev.c +++ b/graphics/vnc/server/vnc_fbdev.c @@ -237,7 +237,7 @@ static int up_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno, return OK; } - gerr("Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } @@ -274,7 +274,7 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, return OK; } - gerr("Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } #endif @@ -311,7 +311,7 @@ static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s return OK; } - gerr("Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } #endif @@ -347,7 +347,8 @@ static int up_getcursor(FAR struct fb_vtable_s *vtable, return OK; } - gerr("Returning EINVAL\n"); + + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } #endif @@ -400,7 +401,7 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable, return OK; } - gerr("Returning EINVAL\n"); + gerr("ERROR: Returning EINVAL\n"); return -EINVAL; } #endif diff --git a/graphics/vnc/server/vnc_negotiate.c b/graphics/vnc/server/vnc_negotiate.c index 3a28cb3350..910d0b6f26 100644 --- a/graphics/vnc/server/vnc_negotiate.c +++ b/graphics/vnc/server/vnc_negotiate.c @@ -168,7 +168,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) } else if (nrecvd == 0) { - gerr("Connection closed\n"); + gwarn("WARNING: Connection closed\n"); return -ECONNABORTED; } @@ -240,7 +240,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) } else if (nrecvd == 0) { - gerr("Connection closed\n"); + gwarn("WARNING: Connection closed\n"); return -ECONNABORTED; } @@ -329,7 +329,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) } else if (nrecvd == 0) { - gerr("Connection closed\n"); + gwarn("WARNING: Connection closed\n"); return -ECONNABORTED; } @@ -404,7 +404,7 @@ int vnc_negotiate(FAR struct vnc_session_s *session) } else if (nrecvd == 0) { - gerr("Connection closed\n"); + gwarn("WARNING: Connection closed\n"); return -ECONNABORTED; } 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) { - gerr("Connection closed\n"); + gwarn("WARNING: Connection closed\n"); return -ECONNABORTED; } diff --git a/graphics/vnc/server/vnc_receiver.c b/graphics/vnc/server/vnc_receiver.c index 530f5c0ab3..8f4e0988af 100644 --- a/graphics/vnc/server/vnc_receiver.c +++ b/graphics/vnc/server/vnc_receiver.c @@ -186,7 +186,7 @@ int vnc_receiver(FAR struct vnc_session_s *session) else if (nrecvd == 0) { - gerr("Connection closed\n", errcode); + gwarn("WARNING: Connection closed\n", errcode); return OK; } diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h index a625b1ed1c..9b9406038b 100644 --- a/graphics/vnc/server/vnc_server.h +++ b/graphics/vnc/server/vnc_server.h @@ -190,9 +190,13 @@ # define updllerr(format, ...) llerr(format, ##__VA_ARGS__) # define updinfo(format, ...) info(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 # define upderr err # define updllerr llerr +# define updwarn warn +# define updllwarn llwarn # define updinfo info # define updllinfo llinfo # endif @@ -200,11 +204,15 @@ # ifdef CONFIG_CPP_HAVE_VARARGS # define upderr(x...) # define updllerr(x...) +# define updwarn(x...) +# define updllwarn(x...) # define updinfo(x...) # define updllinfo(x...) # else # define upderr (void) # define updllerr (void) +# define updwarn (void) +# define updllwarn (void) # define updinfo (void) # define updllinfo (void) # endif diff --git a/libc/misc/Make.defs b/libc/misc/Make.defs index 6fa349e0f9..e25b6a783a 100644 --- a/libc/misc/Make.defs +++ b/libc/misc/Make.defs @@ -79,7 +79,7 @@ CSRCS += lib_crc64.c lib_crc32.c lib_crc16.c lib_crc8.c CSRCS += lib_dumpbuffer.c lib_match.c ifeq ($(CONFIG_DEBUG_FEATURES),y) -CSRCS += lib_dbg.c +CSRCS += lib_debug.c endif # Keyboard driver encoder/decoder diff --git a/libc/misc/lib_dbg.c b/libc/misc/lib_debug.c similarity index 100% rename from libc/misc/lib_dbg.c rename to libc/misc/lib_debug.c diff --git a/libc/misc/lib_slcddecode.c b/libc/misc/lib_slcddecode.c index 40ff576683..1c079018dc 100644 --- a/libc/misc/lib_slcddecode.c +++ b/libc/misc/lib_slcddecode.c @@ -93,9 +93,11 @@ #ifdef CONFIG_DEBUG_LCD # define lcderr err +# define lcdwarn warn # define lcdinfo info #else # define lcderr(x...) +# define lcdwarn(x...) # define lcdinfo(x...) #endif @@ -264,7 +266,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, * 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); } @@ -295,7 +297,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, 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 * buffer. @@ -338,7 +340,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream, * 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); 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. */ - 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); return slcd_reget(state, pch, parg); diff --git a/libc/netdb/lib_dnsquery.c b/libc/netdb/lib_dnsquery.c index 636bad4fe4..21ed201ba8 100644 --- a/libc/netdb/lib_dnsquery.c +++ b/libc/netdb/lib_dnsquery.c @@ -283,16 +283,16 @@ static int dns_recv_response(int sd, FAR struct sockaddr *addr, * match. */ -#ifdef CONFIG_DEBUG_NET +#if defined(CONFIG_DEBUG_NET) && defined(CONFIG_DEBUG_INFO) { int d = 64; nameptr = dns_parse_name((uint8_t *)buffer + 12) + 4; for (; ; ) { - nerr("%02X %02X %02X %02X %02X %02X %02X %02X \n", - nameptr[0], nameptr[1], nameptr[2], nameptr[3], - nameptr[4], nameptr[5], nameptr[6], nameptr[7]); + ninfo("%02X %02X %02X %02X %02X %02X %02X %02X \n", + nameptr[0], nameptr[1], nameptr[2], nameptr[3], + nameptr[4], nameptr[5], nameptr[6], nameptr[7]); nameptr += 8; d -= 8; diff --git a/libc/pthread/pthread_attrdestroy.c b/libc/pthread/pthread_attrdestroy.c index beb505242c..7dc431f808 100644 --- a/libc/pthread/pthread_attrdestroy.c +++ b/libc/pthread/pthread_attrdestroy.c @@ -69,7 +69,7 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr) { int ret; - serr("attr=0x%p\n", attr); + linfo("attr=0x%p\n", attr); if (!attr) { @@ -81,7 +81,7 @@ int pthread_attr_destroy(FAR pthread_attr_t *attr) ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetaffinity.c b/libc/pthread/pthread_attrgetaffinity.c index 5588c51342..a08f18cb00 100644 --- a/libc/pthread/pthread_attrgetaffinity.c +++ b/libc/pthread/pthread_attrgetaffinity.c @@ -66,7 +66,7 @@ int pthread_attr_getaffinity_np(FAR const pthread_attr_t *attr, 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); diff --git a/libc/pthread/pthread_attrgetinheritsched.c b/libc/pthread/pthread_attrgetinheritsched.c index 3a52eaee1f..0f6b42a879 100644 --- a/libc/pthread/pthread_attrgetinheritsched.c +++ b/libc/pthread/pthread_attrgetinheritsched.c @@ -72,7 +72,7 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr, { 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) { @@ -84,8 +84,6 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr, ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } - - diff --git a/libc/pthread/pthread_attrgetschedparam.c b/libc/pthread/pthread_attrgetschedparam.c index fb84828f1a..beea2a595b 100644 --- a/libc/pthread/pthread_attrgetschedparam.c +++ b/libc/pthread/pthread_attrgetschedparam.c @@ -70,7 +70,7 @@ int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, { 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) { @@ -90,6 +90,6 @@ int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetschedpolicy.c b/libc/pthread/pthread_attrgetschedpolicy.c index 821c0bffc8..601b3cebea 100644 --- a/libc/pthread/pthread_attrgetschedpolicy.c +++ b/libc/pthread/pthread_attrgetschedpolicy.c @@ -68,7 +68,7 @@ int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy) { 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) { @@ -80,6 +80,6 @@ int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy) ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrgetstacksize.c b/libc/pthread/pthread_attrgetstacksize.c index 3a8df45b89..130bed7fb6 100644 --- a/libc/pthread/pthread_attrgetstacksize.c +++ b/libc/pthread/pthread_attrgetstacksize.c @@ -67,7 +67,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz { int ret; - serr("attr=0x%p stacksize=0x%p\n", attr, stacksize); + linfo("attr=0x%p stacksize=0x%p\n", attr, stacksize); if (!stacksize) { @@ -79,7 +79,7 @@ int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksiz ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrinit.c b/libc/pthread/pthread_attrinit.c index 18d3fa09b0..1d303a05f0 100644 --- a/libc/pthread/pthread_attrinit.c +++ b/libc/pthread/pthread_attrinit.c @@ -87,7 +87,7 @@ int pthread_attr_init(FAR pthread_attr_t *attr) { int ret = OK; - serr("attr=0x%p\n", attr); + linfo("attr=0x%p\n", attr); if (!attr) { 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)); } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetaffinity.c b/libc/pthread/pthread_attrsetaffinity.c index 6a526cd46e..c8e7c3607d 100644 --- a/libc/pthread/pthread_attrsetaffinity.c +++ b/libc/pthread/pthread_attrsetaffinity.c @@ -68,7 +68,7 @@ int pthread_attr_setaffinity_np(FAR pthread_attr_t *attr, size_t cpusetsize, 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) && cpuset != NULL && *cpuset != 0); diff --git a/libc/pthread/pthread_attrsetinheritsched.c b/libc/pthread/pthread_attrsetinheritsched.c index a3ee237410..89d29d07bb 100644 --- a/libc/pthread/pthread_attrsetinheritsched.c +++ b/libc/pthread/pthread_attrsetinheritsched.c @@ -73,7 +73,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, { int ret; - serr("inheritsched=%d\n", inheritsched); + linfo("inheritsched=%d\n", inheritsched); if (!attr || (inheritsched != PTHREAD_INHERIT_SCHED && @@ -87,7 +87,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetschedparam.c b/libc/pthread/pthread_attrsetschedparam.c index 12af4c8ca8..602f76eafa 100644 --- a/libc/pthread/pthread_attrsetschedparam.c +++ b/libc/pthread/pthread_attrsetschedparam.c @@ -70,7 +70,7 @@ int pthread_attr_setschedparam(FAR pthread_attr_t *attr, { 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) { @@ -90,6 +90,6 @@ int pthread_attr_setschedparam(FAR pthread_attr_t *attr, ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetschedpolicy.c b/libc/pthread/pthread_attrsetschedpolicy.c index 932954edfb..2aa2686157 100644 --- a/libc/pthread/pthread_attrsetschedpolicy.c +++ b/libc/pthread/pthread_attrsetschedpolicy.c @@ -70,7 +70,7 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy) { int ret; - serr("attr=0x%p policy=%d\n", attr, policy); + linfo("attr=0x%p policy=%d\n", attr, policy); if (!attr || (policy != SCHED_FIFO @@ -90,6 +90,6 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy) ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_attrsetstacksize.c b/libc/pthread/pthread_attrsetstacksize.c index 41bec38f19..3ed309981c 100644 --- a/libc/pthread/pthread_attrsetstacksize.c +++ b/libc/pthread/pthread_attrsetstacksize.c @@ -68,7 +68,7 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize) { 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) { @@ -80,7 +80,7 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize) ret = OK; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_condattrdestroy.c b/libc/pthread/pthread_condattrdestroy.c index 92af75db74..d538891f82 100644 --- a/libc/pthread/pthread_condattrdestroy.c +++ b/libc/pthread/pthread_condattrdestroy.c @@ -67,14 +67,14 @@ int pthread_condattr_destroy(FAR pthread_condattr_t *attr) { int ret = OK; - serr("attr=0x%p\n", attr); + linfo("attr=0x%p\n", attr); if (!attr) { ret = EINVAL; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_condattrinit.c b/libc/pthread/pthread_condattrinit.c index ac6889dc01..64d2d0ac25 100644 --- a/libc/pthread/pthread_condattrinit.c +++ b/libc/pthread/pthread_condattrinit.c @@ -67,7 +67,7 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr) { int ret = OK; - serr("attr=0x%p\n", attr); + linfo("attr=0x%p\n", attr); if (!attr) { @@ -78,7 +78,7 @@ int pthread_condattr_init(FAR pthread_condattr_t *attr) *attr = 0; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrdestroy.c b/libc/pthread/pthread_mutexattrdestroy.c index 3b0aaba28a..c20a67bdf7 100644 --- a/libc/pthread/pthread_mutexattrdestroy.c +++ b/libc/pthread/pthread_mutexattrdestroy.c @@ -68,7 +68,7 @@ int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr) { int ret = OK; - serr("attr=0x%p\n", attr); + linfo("attr=0x%p\n", attr); if (!attr) { @@ -79,6 +79,6 @@ int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr) attr->pshared = 0; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrgetpshared.c b/libc/pthread/pthread_mutexattrgetpshared.c index a7f8ce6d8f..b8f0b77ec4 100644 --- a/libc/pthread/pthread_mutexattrgetpshared.c +++ b/libc/pthread/pthread_mutexattrgetpshared.c @@ -68,7 +68,7 @@ int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *p { 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) { @@ -79,6 +79,6 @@ int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *p *pshared = attr->pshared; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrinit.c b/libc/pthread/pthread_mutexattrinit.c index 620736e2c6..95f5ba8ab8 100644 --- a/libc/pthread/pthread_mutexattrinit.c +++ b/libc/pthread/pthread_mutexattrinit.c @@ -67,7 +67,7 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr) { int ret = OK; - serr("attr=0x%p\n", attr); + linfo("attr=0x%p\n", attr); if (!attr) { @@ -81,6 +81,6 @@ int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr) #endif } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/pthread/pthread_mutexattrsetpshared.c b/libc/pthread/pthread_mutexattrsetpshared.c index ebcc3c7e3c..3418521ee8 100644 --- a/libc/pthread/pthread_mutexattrsetpshared.c +++ b/libc/pthread/pthread_mutexattrsetpshared.c @@ -68,7 +68,7 @@ int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared) { 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)) { @@ -79,6 +79,6 @@ int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared) attr->pshared = pshared; } - serr("Returning %d\n", ret); + linfo("Returning %d\n", ret); return ret; } diff --git a/libc/spawn/lib_psa_dump.c b/libc/spawn/lib_psa_dump.c index b4be80293a..81ccc7a675 100644 --- a/libc/spawn/lib_psa_dump.c +++ b/libc/spawn/lib_psa_dump.c @@ -39,6 +39,15 @@ #include +/* 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 #include diff --git a/libc/stdio/lib_dtoa.c b/libc/stdio/lib_dtoa.c index 480165ed06..8ddc3bfd35 100644 --- a/libc/stdio/lib_dtoa.c +++ b/libc/stdio/lib_dtoa.c @@ -556,15 +556,16 @@ static int cmp(Bigint * a, Bigint * b) i = a->wds; j = b->wds; + #ifdef CONFIG_DEBUG_LIB 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]) { - lerr("cmp called with b->x[b->wds-1] == 0\n"); + lerr("ERROR: cmp called with b->x[b->wds-1] == 0\n"); } #endif @@ -722,7 +723,7 @@ static Bigint *d2b(double d, int *e, int *bits) #ifdef CONFIG_DEBUG_LIB if (!z) { - lerr("Zero passed to d2b\n"); + lerr("ERROR: Zero passed to d2b\n"); } #endif k = lo0bits(&z); @@ -763,7 +764,7 @@ static Bigint *d2b(double d, int *e, int *bits) #ifdef CONFIG_DEBUG_LIB if (!z) { - lerr("Zero passed to d2b\n"); + lerr("ERROR: Zero passed to d2b\n"); } #endif k = lo0bits(&z); @@ -851,7 +852,7 @@ static int quorem(Bigint * b, Bigint * S) #ifdef CONFIG_DEBUG_LIB if (b->wds > n) { - lerr("oversize b in quorem\n"); + lerr("ERROR: oversize b in quorem\n"); } #endif if (b->wds < n) @@ -867,7 +868,7 @@ static int quorem(Bigint * b, Bigint * S) #ifdef CONFIG_DEBUG_LIB if (q > 9) { - lerr("oversized quotient in quorem\n"); + lerr("ERROR: oversized quotient in quorem\n"); } #endif diff --git a/libc/time/lib_gmtimer.c b/libc/time/lib_gmtimer.c index a3439e3c03..a9624747c9 100644 --- a/libc/time/lib_gmtimer.c +++ b/libc/time/lib_gmtimer.c @@ -317,7 +317,7 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result) /* Get the seconds since the EPOCH */ epoch = *timer; - serr("timer=%d\n", (int)epoch); + linfo("timer=%d\n", (int)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; - serr("hour=%d min=%d sec=%d\n", - (int)hour, (int)min, (int)sec); + linfo("hour=%d min=%d sec=%d\n", + (int)hour, (int)min, (int)sec); /* Convert the days since the EPOCH to calendar day */ clock_utc2calendar(jdn, &year, &month, &day); - serr("jdn=%d year=%d month=%d day=%d\n", - (int)jdn, (int)year, (int)month, (int)day); + linfo("jdn=%d year=%d month=%d day=%d\n", + (int)jdn, (int)year, (int)month, (int)day); /* Then return the struct tm contents */ diff --git a/libc/time/lib_mktime.c b/libc/time/lib_mktime.c index 327e86f4c7..160e10fcf1 100644 --- a/libc/time/lib_mktime.c +++ b/libc/time/lib_mktime.c @@ -94,14 +94,14 @@ time_t mktime(FAR struct tm *tp) */ 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", - (int)jdn, tp->tm_year, tp->tm_mon, tp->tm_mday); + linfo("jdn=%d tm_year=%d tm_mon=%d tm_mday=%d\n", + (int)jdn, tp->tm_year, tp->tm_mon, tp->tm_mday); /* Return the seconds into the julian day. */ 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", - (int)ret, tp->tm_hour, tp->tm_min, tp->tm_sec); + linfo("ret=%d tm_hour=%d tm_min=%d tm_sec=%d\n", + (int)ret, tp->tm_hour, tp->tm_min, tp->tm_sec); return ret; }