From 5720d72b71c88af98a1dbd52f0cc4d4a9505c011 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 9 Mar 2020 00:13:09 +0800 Subject: [PATCH] apps: Fix the nightly build warning src/cwindowfactory.cxx: In member function 'void Twm4Nx::CWindowFactory::redrawIcons(const nxgl_rect_s*)': src/cwindowfactory.cxx:461:38: warning: 'iconPos.nxgl_point_s::y' may be used uninitialized in this function [-Wmaybe-uninitialized] 461 | iconBounds.pt2.y = iconPos.y + iconSize.h - 1; | ~~~~~~~~^ src/cwindowfactory.cxx:460:38: warning: 'iconPos.nxgl_point_s::x' may be used uninitialized in this function [-Wmaybe-uninitialized] 460 | iconBounds.pt2.x = iconPos.x + iconSize.w - 1; | ~~~~~~~~^ nsh_netcmds.c:424:20: warning: 'nsh_addrconv' defined but not used [-Wunused-function] static inline bool nsh_addrconv(FAR const char *hwstr, ^ nsh_netcmds.c:446:20: warning: 'nsh_sethwaddr' defined but not used [-Wunused-function] static inline void nsh_sethwaddr(FAR const char *ifname, ^ nsh_envcmds.c:94:21: warning: 'nsh_getdirpath' defined but not used [-Wunused-function] static inline char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl, ^ In file included from bas.c:84:0: bas.c: In function 'bas_interpreter': bas_error.h:110:37: warning: left-hand operand of comma expression has no effect [-Wunused-value] #define NOSUCHLINE STATIC+40, _("No such line") ^ bas.c:2425:52: note: in expansion of macro 'NOSUCHLINE' FS_putChars(STDCHANNEL, (NOSUCHLINE)); ^~~~~~~~~~ bas_fs.c:107:22: warning: 'g_vt100_colormap' defined but not used [-Wunused-const-variable=] static const uint8_t g_vt100_colormap[8] = ^~~~~~~~~~~~~~~~ :4048:16: warning: 'input' defined but not used [-Wunused-function] Signed-off-by: Xiang Xiao Change-Id: I62610b4c90e67637250cbd0107c2935c8abc542f --- include/graphics/twm4nx/cwindow.hxx | 10 ++++ interpreters/bas/bas.c | 2 +- interpreters/bas/bas_fs.c | 8 --- interpreters/bas/bas_token.c | 84 ----------------------------- nshlib/nsh_envcmds.c | 2 + nshlib/nsh_netcmds.c | 4 +- 6 files changed, 15 insertions(+), 95 deletions(-) diff --git a/include/graphics/twm4nx/cwindow.hxx b/include/graphics/twm4nx/cwindow.hxx index 26c13b301..807d21d15 100644 --- a/include/graphics/twm4nx/cwindow.hxx +++ b/include/graphics/twm4nx/cwindow.hxx @@ -825,6 +825,11 @@ namespace Twm4Nx { m_iconWidget->getSize(size); } + else + { + size.w = 0; + size.h = 0; + } } /** @@ -842,6 +847,11 @@ namespace Twm4Nx { m_iconWidget->getPos(pos); } + else + { + pos.x = 0; + pos.y = 0; + } } /** diff --git a/interpreters/bas/bas.c b/interpreters/bas/bas.c index f559cafb3..fab2f56ef 100644 --- a/interpreters/bas/bas.c +++ b/interpreters/bas/bas.c @@ -2422,7 +2422,7 @@ void bas_interpreter(void) if (Program_goLine(&g_program, line->u.integer, &where) == (struct Pc *)0) { - FS_putChars(STDCHANNEL, (NOSUCHLINE)); + FS_putChars(STDCHANNEL, _("No such line\n")); } else { diff --git a/interpreters/bas/bas_fs.c b/interpreters/bas/bas_fs.c index 1ac52e4fd..100a8b6e4 100644 --- a/interpreters/bas/bas_fs.c +++ b/interpreters/bas/bas_fs.c @@ -103,14 +103,6 @@ static int g_used; static const int g_open_mode[4] = { 0, O_RDONLY, O_WRONLY, O_RDWR }; static char g_errmsgbuf[80]; -#ifdef CONFIG_INTERPRETER_BAS_VT100 -static const uint8_t g_vt100_colormap[8] = -{ - VT100_BLACK, VT100_BLUE, VT100_GREEN, VT100_CYAN, - VT100_RED, VT100_MAGENTA, VT100_YELLOW, VT100_WHITE -}; -#endif - /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/interpreters/bas/bas_token.c b/interpreters/bas/bas_token.c index 22fbbe572..8e57d0dc7 100644 --- a/interpreters/bas/bas_token.c +++ b/interpreters/bas/bas_token.c @@ -1525,16 +1525,6 @@ static void yy_flex_strncpy (char *,yyconst char *,int); static int yy_flex_strlen (yyconst char *); #endif -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void); -#else -static int input (void); -#endif - -#endif - /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ @@ -4038,80 +4028,6 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch (yy_get_next_buffer()) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if (yywrap()) - return EOF; - - if (! (yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - /** Immediately switch to a different input stream. * @param input_file A readable stream. * diff --git a/nshlib/nsh_envcmds.c b/nshlib/nsh_envcmds.c index 80dd63ea3..dbffd3046 100644 --- a/nshlib/nsh_envcmds.c +++ b/nshlib/nsh_envcmds.c @@ -91,6 +91,7 @@ static inline FAR const char *nsh_getwd(const char *wd) * Name: nsh_getdirpath ****************************************************************************/ +#ifndef CONFIG_DISABLE_ENVIRON static inline char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl, const char *dirpath, const char *relpath) { @@ -125,6 +126,7 @@ static inline char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl, return alloc; } +#endif /**************************************************************************** * Name: nsh_dumpvar diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index ff6919757..c6e42df8c 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -420,7 +420,7 @@ static int nsh_foreach_netdev(nsh_netdev_callback_t callback, * Name: nsh_addrconv ****************************************************************************/ -#ifdef HAVE_HWADDR +#if !defined(CONFIG_NSH_DISABLE_IFCONFIG) && defined(HAVE_HWADDR) static inline bool nsh_addrconv(FAR const char *hwstr, FAR mac_addr_t *macaddr) { @@ -442,7 +442,7 @@ static inline bool nsh_addrconv(FAR const char *hwstr, * Name: nsh_sethwaddr ****************************************************************************/ -#ifdef HAVE_HWADDR +#if !defined(CONFIG_NSH_DISABLE_IFCONFIG) && defined(HAVE_HWADDR) static inline void nsh_sethwaddr(FAR const char *ifname, FAR mac_addr_t *macaddr) {