From 4b57c3bad4fdcab22a182e6f8ab5168614764045 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: svn://svn.code.sf.net/p/nuttx/code/trunk@842 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog | 2 ++ Documentation/NuttX.html | 4 +++- arch/sim/src/Makefile | 7 +++++-- arch/sim/src/up_blockdevice.c | 2 +- arch/sim/src/up_initialize.c | 9 +++++++++ arch/sim/src/up_uipdriver.c | 2 -- examples/nsh/nsh_fscmds.c | 6 +++--- examples/nsh/nsh_main.c | 5 ++--- fs/fat/fs_writefat.c | 2 +- tools/configure.sh | 11 ++++++++--- 10 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index abb52498f5..ef687d659e 100644 --- a/ChangeLog +++ b/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/Documentation/NuttX.html b/Documentation/NuttX.html index c67009fd0a..f01dbd6e20 100644 --- a/Documentation/NuttX.html +++ b/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/arch/sim/src/Makefile b/arch/sim/src/Makefile index 040a9841d7..cd51e047a6 100644 --- a/arch/sim/src/Makefile +++ b/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/arch/sim/src/up_blockdevice.c b/arch/sim/src/up_blockdevice.c index 243d8215f9..1146e41824 100644 --- a/arch/sim/src/up_blockdevice.c +++ b/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/arch/sim/src/up_initialize.c b/arch/sim/src/up_initialize.c index 4f639a88b6..fcfe9d24b0 100644 --- a/arch/sim/src/up_initialize.c +++ b/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/arch/sim/src/up_uipdriver.c b/arch/sim/src/up_uipdriver.c index a035d753cb..24f8f204ec 100644 --- a/arch/sim/src/up_uipdriver.c +++ b/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/examples/nsh/nsh_fscmds.c b/examples/nsh/nsh_fscmds.c index 8610b157dd..b4f5161c1a 100644 --- a/examples/nsh/nsh_fscmds.c +++ b/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/examples/nsh/nsh_main.c b/examples/nsh/nsh_main.c index e98ee7f2d0..cfa280edab 100644 --- a/examples/nsh/nsh_main.c +++ b/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/fs/fat/fs_writefat.c b/fs/fat/fs_writefat.c index ee5979dddd..0cffac044f 100644 --- a/fs/fat/fs_writefat.c +++ b/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/tools/configure.sh b/tools/configure.sh index 5843e44408..094901ebca 100755 --- a/tools/configure.sh +++ b/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