summaryrefslogtreecommitdiff
path: root/apps/nshlib
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-14 13:30:22 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-14 13:30:22 -0600
commit909af806c753228e9ae279432993c93e9180b54f (patch)
tree943750805050126fae960ac09211e22d8ca2cef5 /apps/nshlib
parent37a1adc0053c37b3bc70379f489f93359724186a (diff)
downloadnuttx-909af806c753228e9ae279432993c93e9180b54f.tar.gz
nuttx-909af806c753228e9ae279432993c93e9180b54f.tar.bz2
nuttx-909af806c753228e9ae279432993c93e9180b54f.zip
Changes to get PX4 config to build. Also some warning removal
Diffstat (limited to 'apps/nshlib')
-rw-r--r--apps/nshlib/nsh_command.c6
-rw-r--r--apps/nshlib/nsh_dbgcmds.c12
-rw-r--r--apps/nshlib/nsh_fscmds.c5
-rw-r--r--apps/nshlib/nsh_init.c4
4 files changed, 16 insertions, 11 deletions
diff --git a/apps/nshlib/nsh_command.c b/apps/nshlib/nsh_command.c
index 7d914075f..faf64bbe5 100644
--- a/apps/nshlib/nsh_command.c
+++ b/apps/nshlib/nsh_command.c
@@ -411,9 +411,9 @@ static const struct cmdmap_s g_cmdmap[] =
#ifndef CONFIG_NSH_DISABLE_HELP
static inline void help_cmdlist(FAR struct nsh_vtbl_s *vtbl)
{
- int i;
- int j;
- int k;
+ unsigned int i;
+ unsigned int j;
+ unsigned int k;
/* Print the command name in NUM_CMD_ROWS rows with CMDS_PER_LINE commands
* on each line.
diff --git a/apps/nshlib/nsh_dbgcmds.c b/apps/nshlib/nsh_dbgcmds.c
index e0bf79de1..15ce9498b 100644
--- a/apps/nshlib/nsh_dbgcmds.c
+++ b/apps/nshlib/nsh_dbgcmds.c
@@ -89,7 +89,7 @@ struct dbgmem_s
* Name: mem_parse
****************************************************************************/
-int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
+static int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
struct dbgmem_s *mem)
{
char *pcvalue = strchr(argv[1], '=');
@@ -148,8 +148,8 @@ int cmd_mb(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct dbgmem_s mem;
volatile uint8_t *ptr;
+ unsigned int i;
int ret;
- int i;
ret = mem_parse(vtbl, argc, argv, &mem);
if (ret == 0)
@@ -202,15 +202,17 @@ int cmd_mh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct dbgmem_s mem;
volatile uint16_t *ptr;
+ unsigned int i;
int ret;
- int i;
ret = mem_parse(vtbl, argc, argv, &mem);
if (ret == 0)
{
/* Loop for the number of requested bytes */
- for (i = 0, ptr = (volatile uint16_t*)mem.dm_addr; i < mem.dm_count; i += 2, ptr++)
+ for (i = 0, ptr = (volatile uint16_t*)mem.dm_addr;
+ i < mem.dm_count;
+ i += 2, ptr++)
{
/* Print the value at the address */
@@ -256,8 +258,8 @@ int cmd_mw(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
struct dbgmem_s mem;
volatile uint32_t *ptr;
+ unsigned int i;
int ret;
- int i;
ret = mem_parse(vtbl, argc, argv, &mem);
if (ret == 0)
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c
index 19fc01afa..0ece652f3 100644
--- a/apps/nshlib/nsh_fscmds.c
+++ b/apps/nshlib/nsh_fscmds.c
@@ -1,7 +1,7 @@
/****************************************************************************
* apps/nshlib/nsh_fscmds.c
*
- * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -1491,7 +1491,7 @@ int cmd_cmp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* A partial read indicates the end of file (usually) */
- if (nbytesread1 < sizeof(buf1))
+ if (nbytesread1 < (size_t)sizeof(buf1))
{
break;
}
@@ -1516,3 +1516,4 @@ errout:
}
#endif
#endif
+
diff --git a/apps/nshlib/nsh_init.c b/apps/nshlib/nsh_init.c
index 7c7e78ea1..96dea72bc 100644
--- a/apps/nshlib/nsh_init.c
+++ b/apps/nshlib/nsh_init.c
@@ -1,7 +1,7 @@
/****************************************************************************
* apps/nshlib/nsh_init.c
*
- * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,8 @@
#include <nuttx/config.h>
+#include <apps/nsh.h>
+
#include "nsh.h"
/****************************************************************************