From 854f36c7a928ddf04fb6d150e293cb93d90fbd8e Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 29 Aug 2008 15:36:02 +0000 Subject: [PATCH] Fix Linux sim errors/warning git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@842 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/ChangeLog | 2 ++ nuttx/Documentation/NuttX.html | 4 +++- nuttx/arch/sim/src/Makefile | 7 +++++-- nuttx/arch/sim/src/up_blockdevice.c | 2 +- nuttx/arch/sim/src/up_initialize.c | 9 +++++++++ nuttx/arch/sim/src/up_uipdriver.c | 2 -- nuttx/examples/nsh/nsh_fscmds.c | 6 +++--- nuttx/examples/nsh/nsh_main.c | 5 ++--- nuttx/fs/fat/fs_writefat.c | 2 +- nuttx/tools/configure.sh | 11 ++++++++--- 10 files changed, 34 insertions(+), 16 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index abb52498f..ef687d659 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -422,5 +422,7 @@ * Fix error in stat() when used on the root directory * NSH: Add cd and pwd commands and current working directory to all NSH commands that refer to paths. + * Fix errors and warnings introduced into Linux sim build because of recent + Cygwin-related changes diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index c67009fd0..f01dbd6e2 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: August 23, 2008

+

Last Updated: August 29, 2008

@@ -1056,6 +1056,8 @@ nuttx-0.3.13 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * Fix error in stat() when used on the root directory * NSH: Add cd and pwd commands and current working directory to all NSH commands that refer to paths. + * Fix errors and warnings introduced into Linux sim build because of recent + Cygwin-related changes pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile index 040a9841d..cd51e047a 100644 --- a/nuttx/arch/sim/src/Makefile +++ b/nuttx/arch/sim/src/Makefile @@ -94,8 +94,11 @@ libarch$(LIBEXT): $(NXOBJS) # A partially linked object containing only NuttX code (no interface to host OS) # Change the names of most symbols that conflict with libc symbols. -Linux-names.dat: nuttx-names.dat - @cp $^ $@ +GNU: + @mkdir ./GNU + +GNU/Linux-names.dat: GNU nuttx-names.dat + @cp nuttx-names.dat $@ Cygwin-names.dat: nuttx-names.dat @cat $^ | sed -e "s/^/_/g" >$@ diff --git a/nuttx/arch/sim/src/up_blockdevice.c b/nuttx/arch/sim/src/up_blockdevice.c index 243d8215f..1146e4182 100644 --- a/nuttx/arch/sim/src/up_blockdevice.c +++ b/nuttx/arch/sim/src/up_blockdevice.c @@ -83,5 +83,5 @@ void up_registerblockdevice(void) { - rd_register(0, up_deviceimage(), NSECTORS, LOGICAL_SECTOR_SIZE, TRUE); + rd_register(0, (ubyte*)up_deviceimage(), NSECTORS, LOGICAL_SECTOR_SIZE, TRUE); } diff --git a/nuttx/arch/sim/src/up_initialize.c b/nuttx/arch/sim/src/up_initialize.c index 4f639a88b..fcfe9d24b 100644 --- a/nuttx/arch/sim/src/up_initialize.c +++ b/nuttx/arch/sim/src/up_initialize.c @@ -81,6 +81,15 @@ void up_initialize(void) { + /* The real purpose of the following is to make sure that lib_rawprintf + * is drawn into the link. It is needed by up_tapdev which is linked + * separately. + */ + +#ifdef CONFIG_NET + lib_rawprintf("SIM: Initializing"); +#endif + /* Register devices */ devnull_register(); /* Standard /dev/null */ diff --git a/nuttx/arch/sim/src/up_uipdriver.c b/nuttx/arch/sim/src/up_uipdriver.c index a035d753c..24f8f204e 100644 --- a/nuttx/arch/sim/src/up_uipdriver.c +++ b/nuttx/arch/sim/src/up_uipdriver.c @@ -138,8 +138,6 @@ static int sim_uiptxpoll(struct uip_driver_s *dev) void uipdriver_loop(void) { - int i; - /* tapdev_read will return 0 on a timeout event and >0 on a data received event */ g_sim_dev.d_len = tapdev_read((unsigned char*)g_sim_dev.d_buf, CONFIG_NET_BUFSIZE); diff --git a/nuttx/examples/nsh/nsh_fscmds.c b/nuttx/examples/nsh/nsh_fscmds.c index 8610b157d..b4f5161c1 100644 --- a/nuttx/examples/nsh/nsh_fscmds.c +++ b/nuttx/examples/nsh/nsh_fscmds.c @@ -863,7 +863,7 @@ int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { char *fullpath = nsh_getfullpath(vtbl, argv[1]); - int ret; + int ret = ERROR; if (fullpath) { @@ -886,7 +886,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { char *fullpath = nsh_getfullpath(vtbl, argv[1]); - int ret; + int ret = ERROR; if (fullpath) { @@ -975,7 +975,7 @@ int cmd_sh(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) int cmd_umount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { char *fullpath = nsh_getfullpath(vtbl, argv[1]); - int ret; + int ret = ERROR; if (fullpath) { diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c index e98ee7f2d..cfa280eda 100644 --- a/nuttx/examples/nsh/nsh_main.c +++ b/nuttx/examples/nsh/nsh_main.c @@ -703,7 +703,6 @@ void user_initialize(void) int user_start(int argc, char *argv[]) { int mid_priority; - int ret; /* Set the priority of this task to something in the middle so that 'nice' * can both raise and lower the priority. @@ -756,9 +755,9 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline) FAR char strvtbl[2*sizeof(FAR char*)+3]; FAR char *saveptr; FAR char *cmd; - FAR char *redirfile; + FAR char *redirfile = NULL; int fd = -1; - int oflags; + int oflags = 0; int argc; int ret; diff --git a/nuttx/fs/fat/fs_writefat.c b/nuttx/fs/fat/fs_writefat.c index ee5979ddd..0cffac044 100644 --- a/nuttx/fs/fat/fs_writefat.c +++ b/nuttx/fs/fat/fs_writefat.c @@ -80,7 +80,7 @@ static inline void mkfatfs_initmbr(FAR struct fat_format_s *fmt, /* 8@3: Usually "MSWIN4.1" */ - strcpy(&var->fv_sect[BS_OEMNAME], "NUTTX "); + strcpy((char*)&var->fv_sect[BS_OEMNAME], "NUTTX "); /* 2@11: Bytes per sector: 512, 1024, 2048, 4096 */ diff --git a/nuttx/tools/configure.sh b/nuttx/tools/configure.sh index 5843e4440..094901ebc 100755 --- a/nuttx/tools/configure.sh +++ b/nuttx/tools/configure.sh @@ -1,7 +1,7 @@ #!/bin/bash # configure.sh # -# Copyright (C) 2007 Gregory Nutt. All rights reserved. +# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. -# 3. Neither the name Gregory Nutt nor the names of its contributors may be +# 3. Neither the name NuttX nor the names of its contributors may be # used to endorse or promote products derived from this software # without specific prior written permission. # @@ -52,7 +52,12 @@ BOARDDIR=${TOPDIR}/configs/${BOARD} if [ ! -d "${BOARDDIR}" ]; then echo "Directory ${BOARDDIR} does not exist. Options are:" echo "" - echo `cd ${TOPDIR}/configs ; ls -1 | grep -v CVS | grep -v README.txt` + echo "Select one of the following options for :" + configlist=`find ${TOPDIR}/configs -name defconfig` + for defconfig in $configlist; do + config=`dirname $defconfig | sed -e "s,${TOPDIR}/configs/,,g"` + echo " $config" + done echo "" show_usage fi