From 909af806c753228e9ae279432993c93e9180b54f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Jan 2014 13:30:22 -0600 Subject: Changes to get PX4 config to build. Also some warning removal --- apps/examples/mount/ramdisk.c | 10 +++++----- apps/examples/usbterm/usbterm_main.c | 4 ++-- apps/nshlib/nsh_command.c | 6 +++--- apps/nshlib/nsh_dbgcmds.c | 12 +++++++----- apps/nshlib/nsh_fscmds.c | 5 +++-- apps/nshlib/nsh_init.c | 4 +++- 6 files changed, 23 insertions(+), 18 deletions(-) (limited to 'apps') diff --git a/apps/examples/mount/ramdisk.c b/apps/examples/mount/ramdisk.c index 2b9ffd79e..213a35cc9 100644 --- a/apps/examples/mount/ramdisk.c +++ b/apps/examples/mount/ramdisk.c @@ -97,7 +97,7 @@ static struct fat_format_s g_fmt = FAT_FORMAT_INITIALIZER; int create_ramdisk(void) { - char *pbuffer; + FAR char *pbuffer; int ret; /* Allocate a buffer to hold the file system image. */ @@ -113,10 +113,10 @@ int create_ramdisk(void) /* Register a RAMDISK device to manage this RAM image */ ret = ramdisk_register(CONFIG_EXAMPLES_MOUNT_RAMDEVNO, - pbuffer, - CONFIG_EXAMPLES_MOUNT_NSECTORS, - CONFIG_EXAMPLES_MOUNT_SECTORSIZE, - true); + (FAR uint8_t *)pbuffer, + CONFIG_EXAMPLES_MOUNT_NSECTORS, + CONFIG_EXAMPLES_MOUNT_SECTORSIZE, + true); if (ret < 0) { printf("create_ramdisk: Failed to register ramdisk at %s: %d\n", diff --git a/apps/examples/usbterm/usbterm_main.c b/apps/examples/usbterm/usbterm_main.c index 747a52978..4bf4a3888 100644 --- a/apps/examples/usbterm/usbterm_main.c +++ b/apps/examples/usbterm/usbterm_main.c @@ -119,14 +119,14 @@ static void dumptrace(void) #endif /**************************************************************************** - * Name: dumptrace + * Name: usbterm_listener * * Description: * Entry point for the listener thread. * ****************************************************************************/ -FAR void *usbterm_listener(FAR void *parameter) +static FAR void *usbterm_listener(FAR void *parameter) { message("usbterm_listener: Waiting for remote input\n"); for (;;) 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 * * 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 * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,8 @@ #include +#include + #include "nsh.h" /**************************************************************************** -- cgit v1.2.3