From 48167a64f8b69015f7eb334c0db580708999dbe2 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 28 Jan 2008 15:45:39 +0000 Subject: Eliminate some Z16F compilation warnings. git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@575 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/examples/ostest/cond.c | 5 ++-- nuttx/examples/ostest/main.c | 60 +++++++++++++++++++++---------------------- nuttx/examples/ostest/mutex.c | 5 ++-- nuttx/include/stdlib.h | 2 +- nuttx/lib/lib_fopen.c | 2 +- nuttx/sched/env_putenv.c | 6 ++--- 6 files changed, 41 insertions(+), 39 deletions(-) (limited to 'nuttx') diff --git a/nuttx/examples/ostest/cond.c b/nuttx/examples/ostest/cond.c index 6214ea9d0..7c59f770e 100644 --- a/nuttx/examples/ostest/cond.c +++ b/nuttx/examples/ostest/cond.c @@ -1,7 +1,7 @@ /*********************************************************************** * cond.c * - * 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. * @@ -183,6 +183,7 @@ static void *thread_signaler(void *parameter) printf("thread_signaler: Terminating\n"); pthread_exit(NULL); + return NULL; /* Non-reachable -- needed for some compilers */ } void cond_test(void) diff --git a/nuttx/examples/ostest/main.c b/nuttx/examples/ostest/main.c index ddf60dafb..c61e94cff 100644 --- a/nuttx/examples/ostest/main.c +++ b/nuttx/examples/ostest/main.c @@ -1,7 +1,7 @@ -/************************************************************ +/**************************************************************************** * main.c * - * 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. * @@ -31,15 +31,15 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Compilation Switches - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include #include @@ -50,9 +50,9 @@ #include #include "ostest.h" -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ #define PRIORITY 100 #define NARGS 4 @@ -64,9 +64,9 @@ # define STACKSIZE 8192 #endif -/************************************************************ +/**************************************************************************** * Private Data - ************************************************************/ + ****************************************************************************/ static const char arg1[] = "Arg1"; static const char arg2[] = "Arg2"; @@ -110,13 +110,13 @@ const char g_putenv_value[] = "Variable1=BadValue3"; #endif -/************************************************************ +/**************************************************************************** * Private Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * Name: show_memory_usage - ************************************************************/ + ****************************************************************************/ #ifndef CONFIG_DISABLE_SIGNALS static void show_memory_usage(struct mallinfo *mmbefore, @@ -134,9 +134,9 @@ static void show_memory_usage(struct mallinfo *mmbefore, # define show_memory_usage(mm1, mm2) #endif -/************************************************************ +/**************************************************************************** * Name: check_test_memory_usage - ************************************************************/ + ****************************************************************************/ #ifndef CONFIG_DISABLE_SIGNALS static void check_test_memory_usage(void) @@ -170,9 +170,9 @@ static void check_test_memory_usage(void) # define check_test_memory_usage() #endif -/************************************************************ +/**************************************************************************** * Name: show_environment - ************************************************************/ + ****************************************************************************/ #ifndef CONFIG_DISABLE_ENVIRON static void show_variable(const char *var_name, const char *exptd_value, boolean var_valid) @@ -219,9 +219,9 @@ static void show_environment(boolean var1_valid, boolean var2_valid, boolean var # define show_environment() #endif -/************************************************************ +/**************************************************************************** * Name: user_main - ************************************************************/ + ****************************************************************************/ static int user_main(int argc, char *argv[]) { @@ -399,9 +399,9 @@ static int user_main(int argc, char *argv[]) return 0; } -/************************************************************ +/**************************************************************************** * Name: stdio_test - ************************************************************/ + ****************************************************************************/ static void stdio_test(void) { @@ -420,22 +420,22 @@ static void stdio_test(void) #endif } -/************************************************************ +/**************************************************************************** * Public Functions - ************************************************************/ + ****************************************************************************/ -/************************************************************ +/**************************************************************************** * user_initialize - ************************************************************/ + ****************************************************************************/ void user_initialize(void) { /* stub */ } -/************************************************************ +/**************************************************************************** * user_start - ************************************************************/ + ****************************************************************************/ int user_start(int argc, char *argv[]) { diff --git a/nuttx/examples/ostest/mutex.c b/nuttx/examples/ostest/mutex.c index 5edf60dba..752f833f2 100644 --- a/nuttx/examples/ostest/mutex.c +++ b/nuttx/examples/ostest/mutex.c @@ -1,7 +1,7 @@ /*********************************************************************** * mutex.c * - * 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. * @@ -86,6 +86,7 @@ static void *thread_func(void *parameter) } } pthread_exit(NULL); + return NULL; /* Non-reachable -- needed for some compilers */ } void mutex_test(void) diff --git a/nuttx/include/stdlib.h b/nuttx/include/stdlib.h index c1eaf28d0..58a07ac2d 100644 --- a/nuttx/include/stdlib.h +++ b/nuttx/include/stdlib.h @@ -106,7 +106,7 @@ EXTERN int rand(void); #ifndef CONFIG_DISABLE_ENIVRON EXTERN FAR char **get_environ_ptr( void ); EXTERN FAR char *getenv(FAR const char *name); -EXTERN int putenv(FAR char *string); +EXTERN int putenv(FAR const char *string); EXTERN int clearenv(void); EXTERN int setenv(const char *name, const char *value, int overwrite); EXTERN int unsetenv(const char *name); diff --git a/nuttx/lib/lib_fopen.c b/nuttx/lib/lib_fopen.c index 438454606..68c3ccdb6 100644 --- a/nuttx/lib/lib_fopen.c +++ b/nuttx/lib/lib_fopen.c @@ -135,7 +135,7 @@ FAR struct file_struct *lib_fdopen(int fd, const char *mode, FAR struct inode *inode = flist->fl_files[fd].f_inode; FILE *stream; int oflags = lib_mode2oflags(mode); - int err; + int err = OK; int i; if (fd < 0 || !flist || !slist) diff --git a/nuttx/sched/env_putenv.c b/nuttx/sched/env_putenv.c index 7ea8ef96b..5049b30d1 100644 --- a/nuttx/sched/env_putenv.c +++ b/nuttx/sched/env_putenv.c @@ -1,7 +1,7 @@ /**************************************************************************** * env_putenv.c * - * 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 Gregory NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -75,7 +75,7 @@ * ****************************************************************************/ -int putenv(char *string) +int putenv(FAR const char *string) { char *pname; char *pequal; -- cgit v1.2.3