From f10f2de2e4d6a492d86d7743e5633e6b9ea399a3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 8 Sep 2015 09:20:49 -0600 Subject: [PATCH] Eliminate some warnings --- examples/nxterm/nxterm_internal.h | 102 +++++++++++++++--------------- examples/nxterm/nxterm_main.c | 28 ++++---- examples/nxterm/nxterm_server.c | 14 ++-- examples/nxterm/nxterm_toolbar.c | 2 +- examples/nxterm/nxterm_wndo.c | 2 +- netutils/dhcpd/dhcpd.c | 18 +++--- 6 files changed, 83 insertions(+), 83 deletions(-) diff --git a/examples/nxterm/nxterm_internal.h b/examples/nxterm/nxterm_internal.h index 5d1df732e..68c4975d6 100644 --- a/examples/nxterm/nxterm_internal.h +++ b/examples/nxterm/nxterm_internal.h @@ -93,27 +93,27 @@ # error "Only CONFIG_NX_NPLANES==1 supported" #endif -#ifndef CONFIG_EXAMPLES_NXCON_VPLANE -# define CONFIG_EXAMPLES_NXCON_VPLANE 0 +#ifndef CONFIG_EXAMPLES_NXTERM_VPLANE +# define CONFIG_EXAMPLES_NXTERM_VPLANE 0 #endif /* Pixel depth. If none provided, pick the smallest enabled pixel depth */ -#ifndef CONFIG_EXAMPLES_NXCON_BPP +#ifndef CONFIG_EXAMPLES_NXTERM_BPP # if !defined(CONFIG_NX_DISABLE_1BPP) -# define CONFIG_EXAMPLES_NXCON_BPP 1 +# define CONFIG_EXAMPLES_NXTERM_BPP 1 # elif !defined(CONFIG_NX_DISABLE_2BPP) -# define CONFIG_EXAMPLES_NXCON_BPP 2 +# define CONFIG_EXAMPLES_NXTERM_BPP 2 # elif !defined(CONFIG_NX_DISABLE_4BPP) -# define CONFIG_EXAMPLES_NXCON_BPP 4 +# define CONFIG_EXAMPLES_NXTERM_BPP 4 # elif !defined(CONFIG_NX_DISABLE_8BPP) -# define CONFIG_EXAMPLES_NXCON_BPP 8 +# define CONFIG_EXAMPLES_NXTERM_BPP 8 # elif !defined(CONFIG_NX_DISABLE_16BPP) -# define CONFIG_EXAMPLES_NXCON_BPP 16 +# define CONFIG_EXAMPLES_NXTERM_BPP 16 //#elif !defined(CONFIG_NX_DISABLE_24BPP) //# define CONFIG_NXTERM_BPP 24 # elif !defined(CONFIG_NX_DISABLE_32BPP) -# define CONFIG_EXAMPLES_NXCON_BPP 32 +# define CONFIG_EXAMPLES_NXTERM_BPP 32 # else # error "No pixel depth provided" # endif @@ -121,62 +121,62 @@ /* Background color (default is darker royal blue) */ -#ifndef CONFIG_EXAMPLES_NXCON_BGCOLOR -# if CONFIG_EXAMPLES_NXCON_BPP == 24 || CONFIG_EXAMPLES_NXCON_BPP == 32 -# define CONFIG_EXAMPLES_NXCON_BGCOLOR RGBTO24(39, 64, 139) -# elif CONFIG_EXAMPLES_NXCON_BPP == 16 -# define CONFIG_EXAMPLES_NXCON_BGCOLOR RGBTO16(39, 64, 139) +#ifndef CONFIG_EXAMPLES_NXTERM_BGCOLOR +# if CONFIG_EXAMPLES_NXTERM_BPP == 24 || CONFIG_EXAMPLES_NXTERM_BPP == 32 +# define CONFIG_EXAMPLES_NXTERM_BGCOLOR RGBTO24(39, 64, 139) +# elif CONFIG_EXAMPLES_NXTERM_BPP == 16 +# define CONFIG_EXAMPLES_NXTERM_BGCOLOR RGBTO16(39, 64, 139) # else -# define CONFIG_EXAMPLES_NXCON_BGCOLOR RGBTO8(39, 64, 139) +# define CONFIG_EXAMPLES_NXTERM_BGCOLOR RGBTO8(39, 64, 139) # endif #endif /* Window color (lighter steel blue) */ -#ifndef CONFIG_EXAMPLES_NXCON_WCOLOR -# if CONFIG_EXAMPLES_NXCON_BPP == 24 || CONFIG_EXAMPLES_NXCON_BPP == 32 -# define CONFIG_EXAMPLES_NXCON_WCOLOR RGBTO24(202, 225, 255) -# elif CONFIG_EXAMPLES_NXCON_BPP == 16 -# define CONFIG_EXAMPLES_NXCON_WCOLOR RGBTO16(202, 225, 255) +#ifndef CONFIG_EXAMPLES_NXTERM_WCOLOR +# if CONFIG_EXAMPLES_NXTERM_BPP == 24 || CONFIG_EXAMPLES_NXTERM_BPP == 32 +# define CONFIG_EXAMPLES_NXTERM_WCOLOR RGBTO24(202, 225, 255) +# elif CONFIG_EXAMPLES_NXTERM_BPP == 16 +# define CONFIG_EXAMPLES_NXTERM_WCOLOR RGBTO16(202, 225, 255) # else -# define CONFIG_EXAMPLES_NXCON_WCOLOR RGBTO8(202, 225, 255) +# define CONFIG_EXAMPLES_NXTERM_WCOLOR RGBTO8(202, 225, 255) # endif #endif /* Toolbar color (medium grey) */ -#ifndef CONFIG_EXAMPLES_NXCON_TBCOLOR +#ifndef CONFIG_EXAMPLES_NXTERM_TBCOLOR # if CONFIG_EXAMPLES_NX_BPP == 24 || CONFIG_EXAMPLES_NX_BPP == 32 -# define CONFIG_EXAMPLES_NXCON_TBCOLOR RGBTO24(188, 188, 188) +# define CONFIG_EXAMPLES_NXTERM_TBCOLOR RGBTO24(188, 188, 188) # elif CONFIG_EXAMPLES_NX_BPP == 16 -# define CONFIG_EXAMPLES_NXCON_TBCOLOR RGBTO16(188, 188, 188) +# define CONFIG_EXAMPLES_NXTERM_TBCOLOR RGBTO16(188, 188, 188) # else -# define CONFIG_EXAMPLES_NXCON_TBCOLOR RGBTO8(188, 188, 188) +# define CONFIG_EXAMPLES_NXTERM_TBCOLOR RGBTO8(188, 188, 188) # endif #endif /* Font ID */ -#ifndef CONFIG_EXAMPLES_NXCON_FONTID -# define CONFIG_EXAMPLES_NXCON_FONTID NXFONT_DEFAULT +#ifndef CONFIG_EXAMPLES_NXTERM_FONTID +# define CONFIG_EXAMPLES_NXTERM_FONTID NXFONT_DEFAULT #endif /* Font color */ -#ifndef CONFIG_EXAMPLES_NXCON_FONTCOLOR -# if CONFIG_EXAMPLES_NXCON_BPP == 24 || CONFIG_EXAMPLES_NXCON_BPP == 32 -# define CONFIG_EXAMPLES_NXCON_FONTCOLOR RGBTO24(0, 0, 0) -# elif CONFIG_EXAMPLES_NXCON_BPP == 16 -# define CONFIG_EXAMPLES_NXCON_FONTCOLOR RGBTO16(0, 0, 0) +#ifndef CONFIG_EXAMPLES_NXTERM_FONTCOLOR +# if CONFIG_EXAMPLES_NXTERM_BPP == 24 || CONFIG_EXAMPLES_NXTERM_BPP == 32 +# define CONFIG_EXAMPLES_NXTERM_FONTCOLOR RGBTO24(0, 0, 0) +# elif CONFIG_EXAMPLES_NXTERM_BPP == 16 +# define CONFIG_EXAMPLES_NXTERM_FONTCOLOR RGBTO16(0, 0, 0) # else -# define CONFIG_EXAMPLES_NXCON_FONTCOLOR RGBTO8(0, 0, 0) +# define CONFIG_EXAMPLES_NXTERM_FONTCOLOR RGBTO8(0, 0, 0) # endif #endif /* Height of the toolbar */ -#ifndef CONFIG_EXAMPLES_NXCON_TOOLBAR_HEIGHT -# define CONFIG_EXAMPLES_NXCON_TOOLBAR_HEIGHT 16 +#ifndef CONFIG_EXAMPLES_NXTERM_TOOLBAR_HEIGHT +# define CONFIG_EXAMPLES_NXTERM_TOOLBAR_HEIGHT 16 #endif /* Multi-user NX support */ @@ -193,36 +193,36 @@ #ifndef CONFIG_NX_BLOCKING # error "This example depends on CONFIG_NX_BLOCKING" #endif -#ifndef CONFIG_EXAMPLES_NXCON_STACKSIZE -# define CONFIG_EXAMPLES_NXCON_STACKSIZE 2048 +#ifndef CONFIG_EXAMPLES_NXTERM_STACKSIZE +# define CONFIG_EXAMPLES_NXTERM_STACKSIZE 2048 #endif -#ifndef CONFIG_EXAMPLES_NXCON_LISTENERPRIO -# define CONFIG_EXAMPLES_NXCON_LISTENERPRIO 100 +#ifndef CONFIG_EXAMPLES_NXTERM_LISTENERPRIO +# define CONFIG_EXAMPLES_NXTERM_LISTENERPRIO 100 #endif -#ifndef CONFIG_EXAMPLES_NXCON_CLIENTPRIO -# define CONFIG_EXAMPLES_NXCON_CLIENTPRIO 100 +#ifndef CONFIG_EXAMPLES_NXTERM_CLIENTPRIO +# define CONFIG_EXAMPLES_NXTERM_CLIENTPRIO 100 #endif -#ifndef CONFIG_EXAMPLES_NXCON_SERVERPRIO -# define CONFIG_EXAMPLES_NXCON_SERVERPRIO 120 +#ifndef CONFIG_EXAMPLES_NXTERM_SERVERPRIO +# define CONFIG_EXAMPLES_NXTERM_SERVERPRIO 120 #endif -#ifndef CONFIG_EXAMPLES_NXCON_NOTIFYSIGNO -# define CONFIG_EXAMPLES_NXCON_NOTIFYSIGNO 4 +#ifndef CONFIG_EXAMPLES_NXTERM_NOTIFYSIGNO +# define CONFIG_EXAMPLES_NXTERM_NOTIFYSIGNO 4 #endif /* Graphics Device */ -#ifndef CONFIG_EXAMPLES_NXCON_DEVNO -# define CONFIG_EXAMPLES_NXCON_DEVNO 0 +#ifndef CONFIG_EXAMPLES_NXTERM_DEVNO +# define CONFIG_EXAMPLES_NXTERM_DEVNO 0 #endif /* NX Console Device */ -#ifndef CONFIG_EXAMPLES_NXCON_MINOR -# define CONFIG_EXAMPLES_NXCON_MINOR 0 +#ifndef CONFIG_EXAMPLES_NXTERM_MINOR +# define CONFIG_EXAMPLES_NXTERM_MINOR 0 #endif -#ifndef CONFIG_EXAMPLES_NXCON_DEVNAME -# define CONFIG_EXAMPLES_NXCON_DEVNAME "/dev/nxterm0" +#ifndef CONFIG_EXAMPLES_NXTERM_DEVNAME +# define CONFIG_EXAMPLES_NXTERM_DEVNAME "/dev/nxterm0" #endif /* NxTerm task */ diff --git a/examples/nxterm/nxterm_main.c b/examples/nxterm/nxterm_main.c index c44f5fd9a..7db53e801 100644 --- a/examples/nxterm/nxterm_main.c +++ b/examples/nxterm/nxterm_main.c @@ -110,7 +110,7 @@ static int nxterm_initialize(void) /* Set the client task priority */ - param.sched_priority = CONFIG_EXAMPLES_NXCON_CLIENTPRIO; + param.sched_priority = CONFIG_EXAMPLES_NXTERM_CLIENTPRIO; ret = sched_setparam(0, ¶m); if (ret < 0) { @@ -121,8 +121,8 @@ static int nxterm_initialize(void) /* Start the server task */ printf("nxterm_initialize: Starting nxterm_server task\n"); - servrid = task_create("NX Server", CONFIG_EXAMPLES_NXCON_SERVERPRIO, - CONFIG_EXAMPLES_NXCON_STACKSIZE, nxterm_server, NULL); + servrid = task_create("NX Server", CONFIG_EXAMPLES_NXTERM_SERVERPRIO, + CONFIG_EXAMPLES_NXTERM_STACKSIZE, nxterm_server, NULL); if (servrid < 0) { printf("nxterm_initialize: Failed to create nxterm_server task: %d\n", errno); @@ -146,9 +146,9 @@ static int nxterm_initialize(void) */ (void)pthread_attr_init(&attr); - param.sched_priority = CONFIG_EXAMPLES_NXCON_LISTENERPRIO; + param.sched_priority = CONFIG_EXAMPLES_NXTERM_LISTENERPRIO; (void)pthread_attr_setschedparam(&attr, ¶m); - (void)pthread_attr_setstacksize(&attr, CONFIG_EXAMPLES_NXCON_STACKSIZE); + (void)pthread_attr_setstacksize(&attr, CONFIG_EXAMPLES_NXTERM_STACKSIZE); ret = pthread_create(&thread, &attr, nxterm_listener, NULL); if (ret != 0) @@ -267,8 +267,8 @@ int nxterm_main(int argc, char **argv) /* Set the background to the configured background color */ - printf("nxterm_main: Set background color=%d\n", CONFIG_EXAMPLES_NXCON_BGCOLOR); - color = CONFIG_EXAMPLES_NXCON_BGCOLOR; + printf("nxterm_main: Set background color=%d\n", CONFIG_EXAMPLES_NXTERM_BGCOLOR); + color = CONFIG_EXAMPLES_NXTERM_BGCOLOR; ret = nx_setbgcolor(g_nxterm_vars.hnx, &color); if (ret < 0) { @@ -333,7 +333,7 @@ int nxterm_main(int argc, char **argv) /* Open the toolbar */ printf("nxterm_main: Add toolbar to window\n"); - ret = nxtk_opentoolbar(g_nxterm_vars.hwnd, CONFIG_EXAMPLES_NXCON_TOOLBAR_HEIGHT, &g_nxtoolcb, NULL); + ret = nxtk_opentoolbar(g_nxterm_vars.hwnd, CONFIG_EXAMPLES_NXTERM_TOOLBAR_HEIGHT, &g_nxtoolcb, NULL); if (ret < 0) { printf("nxterm_main: nxtk_opentoolbar failed: %d\n", errno); @@ -347,11 +347,11 @@ int nxterm_main(int argc, char **argv) /* NxTerm Configuration ************************************************/ /* Use the window to create an NX console */ - g_nxterm_vars.wndo.wcolor[0] = CONFIG_EXAMPLES_NXCON_WCOLOR; - g_nxterm_vars.wndo.fcolor[0] = CONFIG_EXAMPLES_NXCON_FONTCOLOR; - g_nxterm_vars.wndo.fontid = CONFIG_EXAMPLES_NXCON_FONTID; + g_nxterm_vars.wndo.wcolor[0] = CONFIG_EXAMPLES_NXTERM_WCOLOR; + g_nxterm_vars.wndo.fcolor[0] = CONFIG_EXAMPLES_NXTERM_FONTCOLOR; + g_nxterm_vars.wndo.fontid = CONFIG_EXAMPLES_NXTERM_FONTID; - g_nxterm_vars.hdrvr = nxtk_register(g_nxterm_vars.hwnd, &g_nxterm_vars.wndo, CONFIG_EXAMPLES_NXCON_MINOR); + g_nxterm_vars.hdrvr = nxtk_register(g_nxterm_vars.hwnd, &g_nxterm_vars.wndo, CONFIG_EXAMPLES_NXTERM_MINOR); if (!g_nxterm_vars.hdrvr) { printf("nxterm_main: nxtk_register failed: %d\n", errno); @@ -360,11 +360,11 @@ int nxterm_main(int argc, char **argv) /* Open the NxTerm driver */ - fd = open(CONFIG_EXAMPLES_NXCON_DEVNAME, O_WRONLY); + fd = open(CONFIG_EXAMPLES_NXTERM_DEVNAME, O_WRONLY); if (fd < 0) { printf("nxterm_main: open %s read-only failed: %d\n", - CONFIG_EXAMPLES_NXCON_DEVNAME, errno); + CONFIG_EXAMPLES_NXTERM_DEVNAME, errno); goto errout_with_driver; } diff --git a/examples/nxterm/nxterm_server.c b/examples/nxterm/nxterm_server.c index 1be10e17b..50867a29c 100644 --- a/examples/nxterm/nxterm_server.c +++ b/examples/nxterm/nxterm_server.c @@ -88,7 +88,7 @@ int nxterm_server(int argc, char *argv[]) FAR NX_DRIVERTYPE *dev; int ret; -#if defined(CONFIG_EXAMPLES_NXCON_EXTERNINIT) +#if defined(CONFIG_EXAMPLES_NXTERM_EXTERNINIT) struct boardioc_graphics_s devinfo; int ret; @@ -96,14 +96,14 @@ int nxterm_server(int argc, char *argv[]) printf("nxterm_server: Initializing external graphics device\n"); - devinfo.devno = CONFIG_EXAMPLES_NXCON_DEVNO; + devinfo.devno = CONFIG_EXAMPLES_NXTERM_DEVNO; devinfo.dev = NULL; ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { printf("nxterm_server: boardctl failed, devno=%d: %d\n", - CONFIG_EXAMPLES_NXCON_DEVNO, errno); + CONFIG_EXAMPLES_NXTERM_DEVNO, errno); return ERROR; } @@ -122,11 +122,11 @@ int nxterm_server(int argc, char *argv[]) /* Get the device instance */ - dev = board_lcd_getdev(CONFIG_EXAMPLES_NXCON_DEVNO); + dev = board_lcd_getdev(CONFIG_EXAMPLES_NXTERM_DEVNO); if (!dev) { printf("nxterm_server: board_lcd_getdev failed, devno=%d\n", - CONFIG_EXAMPLES_NXCON_DEVNO); + CONFIG_EXAMPLES_NXTERM_DEVNO); return 2; } @@ -144,10 +144,10 @@ int nxterm_server(int argc, char *argv[]) return 1; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXCON_VPLANE); + dev = up_fbgetvplane(CONFIG_EXAMPLES_NXTERM_VPLANE); if (!dev) { - printf("nxterm_server: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXCON_VPLANE); + printf("nxterm_server: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXTERM_VPLANE); return 2; } #endif diff --git a/examples/nxterm/nxterm_toolbar.c b/examples/nxterm/nxterm_toolbar.c index a34e7cebd..5dfe2947b 100644 --- a/examples/nxterm/nxterm_toolbar.c +++ b/examples/nxterm/nxterm_toolbar.c @@ -121,7 +121,7 @@ static void nxtool_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, more ? "true" : "false"); - color[0] = CONFIG_EXAMPLES_NXCON_TBCOLOR; + color[0] = CONFIG_EXAMPLES_NXTERM_TBCOLOR; ret = nxtk_filltoolbar(hwnd, rect, color); if (ret < 0) { diff --git a/examples/nxterm/nxterm_wndo.c b/examples/nxterm/nxterm_wndo.c index 9b9edff77..83095b3ea 100644 --- a/examples/nxterm/nxterm_wndo.c +++ b/examples/nxterm/nxterm_wndo.c @@ -133,7 +133,7 @@ static void nxwndo_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, { /* If the driver has not been opened, then just redraw the window color */ - wcolor[0] = CONFIG_EXAMPLES_NXCON_WCOLOR; + wcolor[0] = CONFIG_EXAMPLES_NXTERM_WCOLOR; (void)nxtk_fillwindow(hwnd, rect, wcolor); } } diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c index 9b685f90d..ef5286a85 100644 --- a/netutils/dhcpd/dhcpd.c +++ b/netutils/dhcpd/dhcpd.c @@ -771,7 +771,7 @@ static int dhcpd_addoption32(uint8_t code, uint32_t value) * Name: dhcp_addoption32p ****************************************************************************/ -#if HAVE_DNSIP +#ifdef HAVE_DSNIP static int dhcp_addoption32p(uint8_t code, FAR uint8_t *value) { uint8_t option[6]; @@ -1005,7 +1005,7 @@ static int dhcpd_sendpacket(int bbroadcast) static inline int dhcpd_sendoffer(in_addr_t ipaddr, uint32_t leasetime) { in_addr_t netaddr; -#if HAVE_DNSIP +#ifdef HAVE_DSNIP uint32_t dnsaddr; dnsaddr = htonl(CONFIG_NETUTILS_DHCPD_DNSIP); #endif @@ -1025,13 +1025,13 @@ static inline int dhcpd_sendoffer(in_addr_t ipaddr, uint32_t leasetime) /* Add the leasetime to the response options */ dhcpd_addoption32(DHCP_OPTION_LEASE_TIME, htonl(leasetime)); -#if HAVE_NETMASK +#ifdef HAVE_NETMASK dhcpd_addoption32(DHCP_OPTION_SUBNET_MASK, htonl(CONFIG_NETUTILS_DHCPD_NETMASK)); #endif -#if HAVE_ROUTERIP +#ifdef HAVE_ROUTERIP dhcpd_addoption32(DHCP_OPTION_ROUTER, htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP)); #endif -#if HAVE_DNSIP +#ifdef HAVE_DSNIP dhcp_addoption32p(DHCP_OPTION_DNS_SERVER, (FAR uint8_t*)&dnsaddr); #endif @@ -1065,7 +1065,7 @@ int dhcpd_sendack(in_addr_t ipaddr) { uint32_t leasetime = CONFIG_NETUTILS_DHCPD_LEASETIME; in_addr_t netaddr; -#if HAVE_DNSIP +#ifdef HAVE_DSNIP uint32_t dnsaddr; dnsaddr = htonl(CONFIG_NETUTILS_DHCPD_DNSIP); #endif @@ -1087,13 +1087,13 @@ int dhcpd_sendack(in_addr_t ipaddr) /* Add the lease time to the response */ dhcpd_addoption32(DHCP_OPTION_LEASE_TIME, htonl(leasetime)); -#if HAVE_NETMASK +#ifdef HAVE_NETMASK dhcpd_addoption32(DHCP_OPTION_SUBNET_MASK, htonl(CONFIG_NETUTILS_DHCPD_NETMASK)); #endif -#if HAVE_ROUTERIP +#ifdef HAVE_ROUTERIP dhcpd_addoption32(DHCP_OPTION_ROUTER, htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP)); #endif -#if HAVE_DNSIP +#ifdef HAVE_DSNIP dhcp_addoption32p(DHCP_OPTION_DNS_SERVER, (FAR uint8_t*)&dnsaddr); #endif