Remove some warnings

This commit is contained in:
Gregory Nutt 2013-10-01 12:10:09 -06:00
parent f6e948fa04
commit 2050443d5e
3 changed files with 7 additions and 4 deletions

View File

@ -175,10 +175,10 @@ static void nsh_closeifnotclosed(struct console_stdio_s *pstate)
static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, FAR const void *buffer, size_t nbytes)
{
#if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct console_stdio_s *pstate = (FAR struct console_stdio_s *)vtbl;
ssize_t ret;
#if CONFIG_NFILE_DESCRIPTORS > 0
/* The stream is open in a lazy fashion. This is done because the file
* descriptor may be opened on a different task than the stream. The
* actual open will then occur with the first output from the new task.
@ -238,7 +238,6 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, const char *fmt, ...)
#else
va_list ap;
char *str;
int ret;
/* Use avsprintf() to allocate a buffer and fill it with the formatted
* data

View File

@ -104,6 +104,7 @@ typedef int (*direntry_handler_t)(FAR struct nsh_vtbl_s *, const char *,
* Private Data
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
/* Common buffer for file I/O. Note the use of this common buffer precludes
* multiple copies of NSH running concurrently. It should be allocated per
* NSH instance and retained in the "vtbl" as is done for the telnet
@ -111,6 +112,7 @@ typedef int (*direntry_handler_t)(FAR struct nsh_vtbl_s *, const char *,
*/
static char g_iobuffer[IOBUFFERSIZE];
#endif
/****************************************************************************
* Public Data
@ -142,6 +144,7 @@ static void trim_dir(char *arg)
* Name: nsh_getdirpath
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
static char *nsh_getdirpath(const char *path, const char *file)
{
/* Handle the case where all that is left is '/' */
@ -158,6 +161,7 @@ static char *nsh_getdirpath(const char *path, const char *file)
g_iobuffer[PATH_MAX] = '\0';
return strdup(g_iobuffer);
}
#endif
/****************************************************************************
* Name: foreach_direntry

View File

@ -1306,8 +1306,8 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
#if CONFIG_NFILE_STREAMS > 0
FAR char *redirfile = NULL;
int oflags = 0;
#endif
int fd = -1;
#endif
int argc;
int ret;
@ -1654,9 +1654,9 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
else
#endif
{
#if CONFIG_NFILE_STREAMS > 0
uint8_t save[SAVE_SIZE];
#if CONFIG_NFILE_STREAMS > 0
/* Handle redirection of output via a file descriptor */
if (vtbl->np.np_redirect)