From 57792182f7aac79d9e1c8b8f8a5f01c8faf68b7c 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 --- 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 -- 4 files changed, 15 insertions(+), 5 deletions(-) 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);