diff --git a/examples/elf/elf_main.c b/examples/elf/elf_main.c index 7e5ff2074..0b72f61ca 100644 --- a/examples/elf/elf_main.c +++ b/examples/elf/elf_main.c @@ -107,7 +107,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_FEATURES # define message(format, ...) info(format, ##__VA_ARGS__) -# define errmsg(format, ...) err(format, ##__VA_ARGS__) +# define errmsg(format, ...) _err(format, ##__VA_ARGS__) # else # define message(format, ...) printf(format, ##__VA_ARGS__) # define errmsg(format, ...) fprintf(stderr, format, ##__VA_ARGS__) @@ -115,7 +115,7 @@ #else # ifdef CONFIG_DEBUG_FEATURES # define message info -# define errmsg err +# define errmsg _err # else # define message printf # define errmsg printf diff --git a/examples/helloxx/helloxx_main.cxx b/examples/helloxx/helloxx_main.cxx index 95dcfdcda..1e6a5dbb7 100644 --- a/examples/helloxx/helloxx_main.cxx +++ b/examples/helloxx/helloxx_main.cxx @@ -63,7 +63,7 @@ #endif #ifdef CONFIG_DEBUG_CXX -# define cxxdbg err +# define cxxdbg _err # define cxxllerr llerr # ifdef CONFIG_DEBUG_INFO # define cxxinfo info diff --git a/examples/ltdc/dma2d.c b/examples/ltdc/dma2d.c index deceea121..ee17a7442 100644 --- a/examples/ltdc/dma2d.c +++ b/examples/ltdc/dma2d.c @@ -92,7 +92,7 @@ static FAR struct dma2d_surface *ltdc_create_dma2d_surface(uint16_t xres, if (!sur->dma2d) { - err("ERROR: up_dma2dcreatelayer failed\n"); + _err("ERROR: up_dma2dcreatelayer failed\n"); free(sur); sur = NULL; } @@ -102,7 +102,7 @@ static FAR struct dma2d_surface *ltdc_create_dma2d_surface(uint16_t xres, if (ret != OK) { - err("ERROR: getvideoinfo() failed\n"); + _err("ERROR: getvideoinfo() failed\n"); } else { @@ -110,7 +110,7 @@ static FAR struct dma2d_surface *ltdc_create_dma2d_surface(uint16_t xres, if (ret != OK) { - err("ERROR: getplaneinfo() failed\n"); + _err("ERROR: getplaneinfo() failed\n"); } } @@ -419,7 +419,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: setalpha() failed\n"); + _err("ERROR: setalpha() failed\n"); _exit(1); } @@ -429,7 +429,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK || alpha != 127) { - err("ERROR: getalpha() failed\n"); + _err("ERROR: getalpha() failed\n"); _exit(1); } @@ -439,7 +439,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: setblendmode() failed\n"); + _err("ERROR: setblendmode() failed\n"); _exit(1); } @@ -449,7 +449,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK || blendmode != DMA2D_BLEND_ALPHA) { - err("ERROR: getblendmode() failed\n"); + _err("ERROR: getblendmode() failed\n"); _exit(1); } @@ -475,7 +475,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: ltdc getclut() failed\n"); + _err("ERROR: ltdc getclut() failed\n"); _exit(1); } @@ -499,7 +499,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: getclut() failed\n"); + _err("ERROR: getclut() failed\n"); _exit(1); } @@ -515,7 +515,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: setclut() failed\n"); + _err("ERROR: setclut() failed\n"); _exit(1); } @@ -523,7 +523,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: getclut() failed\n"); + _err("ERROR: getclut() failed\n"); _exit(1); } @@ -538,7 +538,7 @@ static void ltdc_dma2d_interface(void) memcmp(cmap->red, cmap->green, 256)) #endif { - err("ERROR: unexpected clut content\n"); + _err("ERROR: unexpected clut content\n"); _exit(1); } @@ -548,7 +548,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: ltdc getclut() failed\n"); + _err("ERROR: ltdc getclut() failed\n"); _exit(1); } @@ -563,7 +563,7 @@ static void ltdc_dma2d_interface(void) memcmp(cmap->red, cmap->green, 256)) #endif { - err("ERROR: unexpected clut content\n"); + _err("ERROR: unexpected clut content\n"); _exit(1); } @@ -575,7 +575,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: ltdc setclut() failed\n"); + _err("ERROR: ltdc setclut() failed\n"); _exit(1); } @@ -585,7 +585,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: getclut() failed\n"); + _err("ERROR: getclut() failed\n"); _exit(1); } @@ -600,7 +600,7 @@ static void ltdc_dma2d_interface(void) memcmp(cmap->blue, cmapltdc->blue, LTDC_EXAMPLE_NCOLORS)) #endif { - err("ERROR: clut of ltdc layer and related dma2d layer are different\n"); + _err("ERROR: clut of ltdc layer and related dma2d layer are different\n"); _exit(1); } else @@ -617,7 +617,7 @@ static void ltdc_dma2d_interface(void) if (ret == OK) { - err("ERROR: setclut() failed, expected error if first color exceeds 256\n"); + _err("ERROR: setclut() failed, expected error if first color exceeds 256\n"); } else { @@ -630,7 +630,7 @@ static void ltdc_dma2d_interface(void) if (ret == OK) { - err("ERROR: getclut() failed, expected error if first color exceeds 256\n"); + _err("ERROR: getclut() failed, expected error if first color exceeds 256\n"); } else { @@ -645,7 +645,7 @@ static void ltdc_dma2d_interface(void) if (ret != OK) { - err("ERROR: ltdc setclut() failed\n"); + _err("ERROR: ltdc setclut() failed\n"); _exit(1); } @@ -706,7 +706,7 @@ static void ltdc_dma2d_fillarea(void) } else { - err("ERROR: fail, wrong positioning can overflow layer buffer\n"); + _err("ERROR: fail, wrong positioning can overflow layer buffer\n"); } info("check if the dma2d driver recognized when positioning overflows the" @@ -731,7 +731,7 @@ static void ltdc_dma2d_fillarea(void) } else { - err("ERROR: fail, wrong positioning can overflow layer buffer\n"); + _err("ERROR: fail, wrong positioning can overflow layer buffer\n"); } /* Flip with non blend */ @@ -1462,7 +1462,7 @@ static void ltdc_dma2d_blitdynamiclayer(void) } else { - err("ERROR: fail, wrong positioning can overflow layer buffer\n"); + _err("ERROR: fail, wrong positioning can overflow layer buffer\n"); } info("check if the dma2d driver recognized when positioning overflows the" @@ -1506,7 +1506,7 @@ static void ltdc_dma2d_blitdynamiclayer(void) } else { - err("ERROR: fail, wrong positioning can overflow layer buffer\n"); + _err("ERROR: fail, wrong positioning can overflow layer buffer\n"); } /* Initialize the dma2d fullscreen background layer */ @@ -1750,7 +1750,7 @@ static void ltdc_dma2d_blenddynamiclayer(void) } else { - err("ERROR: fail, wrong positioning can overflow layer buffer\n"); + _err("ERROR: fail, wrong positioning can overflow layer buffer\n"); } info("check if the dma2d driver recognized when positioning overflows the" @@ -1810,7 +1810,7 @@ static void ltdc_dma2d_blenddynamiclayer(void) } else { - err("ERROR: fail, wrong positioning can overflow layer buffer\n"); + _err("ERROR: fail, wrong positioning can overflow layer buffer\n"); } /* Initialize the dma2d fullscreen background layer */ diff --git a/examples/ltdc/ltdc_main.c b/examples/ltdc/ltdc_main.c index d6db6d4f9..f95240523 100644 --- a/examples/ltdc/ltdc_main.c +++ b/examples/ltdc/ltdc_main.c @@ -96,19 +96,19 @@ static int ltdc_init_surface(int lid, uint32_t mode) if (!sur->layer) { - err("ERROR: up_ltdcgetlayer() failed\n"); + _err("ERROR: up_ltdcgetlayer() failed\n"); return -1; } if (sur->layer->getvideoinfo(sur->layer, &sur->vinfo) != OK) { - err("ERROR: getvideoinfo() failed\n"); + _err("ERROR: getvideoinfo() failed\n"); return -1; } if (sur->layer->getplaneinfo(sur->layer, 0, &sur->pinfo) != OK) { - err("ERROR: getplaneinfo() failed\n"); + _err("ERROR: getplaneinfo() failed\n"); return -1; } @@ -133,7 +133,7 @@ static int ltdc_init_surface(int lid, uint32_t mode) if (sur->layer->getlid(sur->layer, &lid, LTDC_LAYER_DMA2D) != OK) { - err("ERROR: getlid() failed\n"); + _err("ERROR: getlid() failed\n"); return -1; } @@ -141,7 +141,7 @@ static int ltdc_init_surface(int lid, uint32_t mode) if (sur->dma2d == NULL) { - err("ERROR: up_dma2dgetlayer() failed\n"); + _err("ERROR: up_dma2dgetlayer() failed\n"); return -1; } #endif @@ -176,14 +176,14 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setalpha() failed\n"); + _err("ERROR: setalpha() failed\n"); } ret = sur->layer->getalpha(sur->layer, &alpha); if (ret != OK || alpha != 0x7f) { - err("ERROR: getalpha() failed\n"); + _err("ERROR: getalpha() failed\n"); } /* setcolor */ @@ -192,14 +192,14 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setcolor() failed\n"); + _err("ERROR: setcolor() failed\n"); } ret = sur->layer->getcolor(sur->layer, &color); if (ret != OK || color != 0x11223344) { - err("ERROR: getcolor() failed\n"); + _err("ERROR: getcolor() failed\n"); } /* setcolorkey */ @@ -208,14 +208,14 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setcolorkey() failed\n"); + _err("ERROR: setcolorkey() failed\n"); } ret = sur->layer->getcolorkey(sur->layer, &color); if (ret != OK || color != 0x55667788) { - err("ERROR: getcolorkey() failed\n"); + _err("ERROR: getcolorkey() failed\n"); } /* setblendmode */ @@ -224,14 +224,14 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setblendmode() failed\n"); + _err("ERROR: setblendmode() failed\n"); } ret = sur->layer->getblendmode(sur->layer, &mode); if (ret != OK || mode != LTDC_BLEND_NONE) { - err("ERROR: getblendmode() failed\n"); + _err("ERROR: getblendmode() failed\n"); } /* setarea */ @@ -246,7 +246,7 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setarea() failed\n"); + _err("ERROR: setarea() failed\n"); } ret = sur->layer->getarea(sur->layer, &area, &xpos, &ypos); @@ -255,7 +255,7 @@ static void ltdc_setget_test(void) area.xpos != sur->vinfo.xres/4 || area.ypos != sur->vinfo.yres/4 || area.xres != sur->vinfo.xres/2 || area.yres != sur->vinfo.yres/2) { - err("ERROR: getarea() failed\n"); + _err("ERROR: getarea() failed\n"); } #ifdef CONFIG_FB_CMAP @@ -275,7 +275,7 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setclut() failed\n"); + _err("ERROR: setclut() failed\n"); } /* Clear all colors to black */ @@ -291,7 +291,7 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: getclut() failed\n"); + _err("ERROR: getclut() failed\n"); } #ifdef CONFIG_FB_TRANSPARENCY @@ -305,7 +305,7 @@ static void ltdc_setget_test(void) ltdc_cmpcolor(g_cmap.green, cmap->green, LTDC_EXAMPLE_NCOLORS)) #endif { - err("ERROR: getclut() failed, unexpected cmap content\n"); + _err("ERROR: getclut() failed, unexpected cmap content\n"); } ltdc_deletecmap(cmap); @@ -318,7 +318,7 @@ static void ltdc_setget_test(void) if (ret != OK) { - err("ERROR: setclut() failed\n"); + _err("ERROR: setclut() failed\n"); } } #endif @@ -1728,7 +1728,7 @@ FAR struct fb_cmap_s * ltdc_createcmap(uint16_t ncolors) if (!clut) { - err("ERROR: malloc() failed\n"); + _err("ERROR: malloc() failed\n"); free(cmap); return NULL;; } @@ -1805,7 +1805,7 @@ uint32_t ltdc_color(FAR struct fb_videoinfo_s *vinfo, uint8_t color) break; #endif default: - err("ERROR: Unsupported pixel format %d\n", vinfo->fmt); + _err("ERROR: Unsupported pixel format %d\n", vinfo->fmt); value = 0; break; } @@ -2059,13 +2059,13 @@ struct surface * ltdc_get_surface(uint32_t mode) if (ret != OK) { - err("ERROR: getlid() failed\n"); + _err("ERROR: getlid() failed\n"); _exit(1); } if (lid < 0 || lid > 1) { - err("ERROR: invalid layer id %d\n", lid); + _err("ERROR: invalid layer id %d\n", lid); _exit(1); } @@ -2086,7 +2086,7 @@ int ltdc_main(int argc, char *argv[]) if (up_fbinitialize(0) < 0) { - err("ERROR: up_fbinitialize() failed\n"); + _err("ERROR: up_fbinitialize() failed\n"); return -1; } @@ -2094,19 +2094,19 @@ int ltdc_main(int argc, char *argv[]) if (!fbtable) { - err("ERROR: up_fbgetvplane() failed\n"); + _err("ERROR: up_fbgetvplane() failed\n"); return -1; } if (fbtable->getvideoinfo(fbtable, &vinfo)<0) { - err("ERROR: getvideoinfo failed\n"); + _err("ERROR: getvideoinfo failed\n"); return -1; } if (fbtable->getplaneinfo(fbtable, 0, &pinfo)<0) { - err("ERROR: getplaneinfo failed\n"); + _err("ERROR: getplaneinfo failed\n"); return -1; } @@ -2122,7 +2122,7 @@ int ltdc_main(int argc, char *argv[]) { if (fbtable->putcmap(fbtable, &g_cmap) != OK) { - err("ERROR: putcmap() failed\n"); + _err("ERROR: putcmap() failed\n"); return -1; } } diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index be4081041..b742959d5 100644 --- a/examples/nxflat/nxflat_main.c +++ b/examples/nxflat/nxflat_main.c @@ -103,7 +103,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_FEATURES # define message(format, ...) info(format, ##__VA_ARGS__) -# define errmsg(format, ...) err(format, ##__VA_ARGS__) +# define errmsg(format, ...) _err(format, ##__VA_ARGS__) # else # define message(format, ...) printf(format, ##__VA_ARGS__) # define errmsg(format, ...) fprintf(stderr, format, ##__VA_ARGS__) @@ -111,7 +111,7 @@ #else # ifdef CONFIG_DEBUG_FEATURES # define message info -# define errmsg err +# define errmsg _err # else # define message printf # define errmsg printf diff --git a/examples/pca9635/pca9635_main.c b/examples/pca9635/pca9635_main.c index 7584fdb0e..c8bdf939b 100644 --- a/examples/pca9635/pca9635_main.c +++ b/examples/pca9635/pca9635_main.c @@ -98,7 +98,7 @@ int pca9635_main(int argc, char *argv[]) ret = ioctl(fd, PWMIOC_SETLED_BRIGHTNESS, (unsigned long)&ledbright); if (ret < 0) { - err("ERROR: ioctl(PWMIOC_SETLED_BRIGHTNESS) failed: %d\n", errno); + _err("ERROR: ioctl(PWMIOC_SETLED_BRIGHTNESS) failed: %d\n", errno); } } diff --git a/examples/posix_spawn/spawn_main.c b/examples/posix_spawn/spawn_main.c index 577a4793c..9212060f7 100644 --- a/examples/posix_spawn/spawn_main.c +++ b/examples/posix_spawn/spawn_main.c @@ -110,7 +110,7 @@ #ifdef CONFIG_CPP_HAVE_VARARGS # ifdef CONFIG_DEBUG_FEATURES # define message(format, ...) info(format, ##__VA_ARGS__) -# define errmsg(format, ...) err(format, ##__VA_ARGS__) +# define errmsg(format, ...) _err(format, ##__VA_ARGS__) # else # define message(format, ...) printf(format, ##__VA_ARGS__) # define errmsg(format, ...) fprintf(stderr, format, ##__VA_ARGS__) @@ -118,7 +118,7 @@ #else # ifdef CONFIG_DEBUG_FEATURES # define message info -# define errmsg err +# define errmsg _err # else # define message printf # define errmsg printf diff --git a/netutils/pppd/pppd.c b/netutils/pppd/pppd.c index 64e272740..eef3fb0cc 100644 --- a/netutils/pppd/pppd.c +++ b/netutils/pppd/pppd.c @@ -102,7 +102,8 @@ static int make_nonblock(int fd) static int tun_alloc(char *dev) { struct ifreq ifr; - int fd, err; + int fd; + int errcode; if ((fd = open("/dev/tun", O_RDWR)) < 0) { @@ -111,10 +112,10 @@ static int tun_alloc(char *dev) printf("tun fd:%i\n", fd); - if ((err = make_nonblock(fd)) < 0) + if ((errcode = make_nonblock(fd)) < 0) { close(fd); - return err; + return errcode; } memset(&ifr, 0, sizeof(ifr)); @@ -124,10 +125,10 @@ static int tun_alloc(char *dev) strncpy(ifr.ifr_name, dev, IFNAMSIZ); } - if ((err = ioctl(fd, TUNSETIFF, (unsigned long)&ifr)) < 0) + if ((errcode = ioctl(fd, TUNSETIFF, (unsigned long)&ifr)) < 0) { close(fd); - return err; + return errcode; } strcpy(dev, ifr.ifr_name); @@ -142,17 +143,17 @@ static int tun_alloc(char *dev) static int open_tty(char *dev) { int fd; - int err; + int errcode; if ((fd = open(dev, O_RDWR)) < 0) { return fd; } - if ((err = make_nonblock(fd)) < 0) + if ((errcode = make_nonblock(fd)) < 0) { close(fd); - return err; + return errcode; } printf("tty fd:%i\n", fd); diff --git a/nshlib/nsh_console.c b/nshlib/nsh_console.c index 7544d226a..e47bb2a2f 100644 --- a/nshlib/nsh_console.c +++ b/nshlib/nsh_console.c @@ -183,7 +183,7 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, ret = fwrite(buffer, 1, nbytes, pstate->cn_outstream); if (ret < 0) { - err("ERROR: [%d] Failed to send buffer: %d\n", + _err("ERROR: [%d] Failed to send buffer: %d\n", pstate->cn_outfd, errno); } return ret; diff --git a/nshlib/nsh_telnetd.c b/nshlib/nsh_telnetd.c index f4e1da0f7..3972c3c80 100644 --- a/nshlib/nsh_telnetd.c +++ b/nshlib/nsh_telnetd.c @@ -205,7 +205,7 @@ int nsh_telnetstart(void) ret = telnetd_start(&config); if (ret < 0) { - err("ERROR: Failed to tart the Telnet daemon: %d\n", ret); + _err("ERROR: Failed to tart the Telnet daemon: %d\n", ret); } return ret; diff --git a/system/i2c/i2c_main.c b/system/i2c/i2c_main.c index 286739c3a..5fc238bf5 100644 --- a/system/i2c/i2c_main.c +++ b/system/i2c/i2c_main.c @@ -426,7 +426,7 @@ ssize_t i2ctool_write(FAR struct i2ctool_s *i2ctool, FAR const void *buffer, siz ret = fwrite(buffer, 1, nbytes, OUTSTREAM(i2ctool)); if (ret < 0) { - err("ERROR: [%d] Failed to send buffer: %d\n", OUTFD(i2ctool), errno); + _err("ERROR: [%d] Failed to send buffer: %d\n", OUTFD(i2ctool), errno); } return ret; diff --git a/system/ubloxmodem/ubloxmodem_main.c b/system/ubloxmodem/ubloxmodem_main.c index 2a8a74dbd..3598e7027 100644 --- a/system/ubloxmodem/ubloxmodem_main.c +++ b/system/ubloxmodem/ubloxmodem_main.c @@ -59,7 +59,7 @@ ****************************************************************************/ #ifdef CONFIG_MODEM_U_BLOX_DEBUG -# define m_err err +# define m_err _err # define m_warn llwarn # define m_info info # define m_llerr llerr