diff --git a/nshlib/nsh_dbgcmds.c b/nshlib/nsh_dbgcmds.c index 811a5773e..e9d6d9dab 100644 --- a/nshlib/nsh_dbgcmds.c +++ b/nshlib/nsh_dbgcmds.c @@ -114,7 +114,7 @@ int mem_parse(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, /* Get the address to be accessed */ - mem->dm_addr = (void*)strtol(argv[1], NULL, 16); + mem->dm_addr = (void*)((uintptr_t)strtol(argv[1], NULL, 16)); /* Get the number of bytes to access */ @@ -332,11 +332,11 @@ void nsh_dumpbuffer(FAR struct nsh_vtbl_s *vtbl, const char *msg, #ifndef CONFIG_NSH_DISABLE_XD int cmd_xd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { - char *addr; - char *endptr; - int nbytes; + FAR char *addr; + FAR char *endptr; + int nbytes; - addr = (char*)strtol(argv[1], &endptr, 16); + addr = (char*)((uintptr_t)strtol(argv[1], &endptr, 16)); if (argv[0][0] == '\0' || *endptr != '\0') { return ERROR; diff --git a/nshlib/nsh_ddcmd.c b/nshlib/nsh_ddcmd.c index 404b484a8..11652fe7e 100644 --- a/nshlib/nsh_ddcmd.c +++ b/nshlib/nsh_ddcmd.c @@ -455,7 +455,6 @@ static inline int dd_outfopen(const char *name, struct dd_s *dd) DD_OUTFD = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (DD_OUTFD < 0) { - FAR struct nsh_vtbl_s *vtbl = dd->vtbl; nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO); return ERROR; } diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index 8ae201123..c0dc1713f 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -112,7 +112,9 @@ static const char *g_ttypenames[4] = static void ps_task(FAR _TCB *tcb, FAR void *arg) { struct nsh_vtbl_s *vtbl = (struct nsh_vtbl_s*)arg; +#if CONFIG_MAX_TASK_ARGS > 2 int i; +#endif /* Show task status */ @@ -159,9 +161,9 @@ static void ps_task(FAR _TCB *tcb, FAR void *arg) int cmd_exec(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { char *endptr; - long addr; + uintptr_t addr; - addr = strtol(argv[1], &endptr, 0); + addr = (uintptr_t)strtol(argv[1], &endptr, 0); if (!addr || endptr == argv[1] || *endptr != '\0') { nsh_output(vtbl, g_fmtarginvalid, argv[0]);