summaryrefslogtreecommitdiff
path: root/nuttx/examples/ostest
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-15 19:00:40 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-15 19:00:40 +0000
commit08b2e5a5495fb08277274eaaf91c21069e0fbadf (patch)
tree8fd7037b0159064a937714529251eb34ec4f4e73 /nuttx/examples/ostest
parentefcfa33c1fa5728dc7c8dd9fd9f20ed7d8a0b27a (diff)
downloadpx4-nuttx-08b2e5a5495fb08277274eaaf91c21069e0fbadf.tar.gz
px4-nuttx-08b2e5a5495fb08277274eaaf91c21069e0fbadf.tar.bz2
px4-nuttx-08b2e5a5495fb08277274eaaf91c21069e0fbadf.zip
Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2351 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/ostest')
-rw-r--r--nuttx/examples/ostest/barrier.c1
-rw-r--r--nuttx/examples/ostest/main.c22
-rw-r--r--nuttx/examples/ostest/posixtimer.c3
-rw-r--r--nuttx/examples/ostest/prioinherit.c1
-rw-r--r--nuttx/examples/ostest/sem.c3
-rw-r--r--nuttx/examples/ostest/sighand.c9
6 files changed, 19 insertions, 20 deletions
diff --git a/nuttx/examples/ostest/barrier.c b/nuttx/examples/ostest/barrier.c
index 56c0b75b1..c88e1bed1 100644
--- a/nuttx/examples/ostest/barrier.c
+++ b/nuttx/examples/ostest/barrier.c
@@ -37,7 +37,6 @@
* Included Files
****************************************************************************/
-#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
diff --git a/nuttx/examples/ostest/main.c b/nuttx/examples/ostest/main.c
index 22a45dcfc..53be10764 100644
--- a/nuttx/examples/ostest/main.c
+++ b/nuttx/examples/ostest/main.c
@@ -38,6 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
+
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -166,11 +168,11 @@ static void check_test_memory_usage(void)
#endif
/****************************************************************************
- * Name: show_environment
+ * Name: show_variable
****************************************************************************/
#ifndef CONFIG_DISABLE_ENVIRON
-static void show_variable(const char *var_name, const char *exptd_value, boolean var_valid)
+static void show_variable(const char *var_name, const char *exptd_value, bool var_valid)
{
char *actual_value = getenv(var_name);
if (actual_value)
@@ -204,11 +206,11 @@ static void show_variable(const char *var_name, const char *exptd_value, boolean
}
}
-static void show_environment(boolean var1_valid, boolean var2_valid, boolean var3_valid)
+static void show_environment(bool var1_valid, bool var2_valid, bool var3_valid)
{
- show_variable( g_var1_name, g_var1_value, var1_valid);
- show_variable( g_var2_name, g_var2_value, var2_valid);
- show_variable( g_var3_name, g_var3_value, var3_valid);
+ show_variable(g_var1_name, g_var1_value, var1_valid);
+ show_variable(g_var2_name, g_var2_value, var2_valid);
+ show_variable(g_var3_name, g_var3_value, var3_valid);
}
#else
# define show_environment()
@@ -264,14 +266,14 @@ static int user_main(int argc, char *argv[])
/* Check environment variables */
#ifndef CONFIG_DISABLE_ENVIRON
- show_environment(TRUE, TRUE, TRUE);
+ show_environment(true, true, true);
unsetenv(g_var1_name);
- show_environment(FALSE, TRUE, TRUE);
+ show_environment(false, true, true);
check_test_memory_usage();
clearenv();
- show_environment(FALSE, FALSE, FALSE);
+ show_environment(false, false, false);
check_test_memory_usage();
#endif
@@ -497,7 +499,7 @@ int user_start(int argc, char *argv[])
setenv(g_var3_name, g_var3_value, FALSE); /* Variable3=GoodValue3 */
printf("user_start: setenv(%s, %s, FALSE)\n", g_var3_name, g_var3_name);
setenv(g_var3_name, g_bad_value2, FALSE); /* Variable3=GoodValue3 */
- show_environment(TRUE, TRUE, TRUE);
+ show_environment(true, true, true);
#endif
/* Verify that we can spawn a new task */
diff --git a/nuttx/examples/ostest/posixtimer.c b/nuttx/examples/ostest/posixtimer.c
index 84ac25ff2..457b4c1a2 100644
--- a/nuttx/examples/ostest/posixtimer.c
+++ b/nuttx/examples/ostest/posixtimer.c
@@ -1,7 +1,7 @@
/***********************************************************************
* examples/ostest/posixtimer.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,6 @@
* Included Files
**************************************************************************/
-#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <semaphore.h>
diff --git a/nuttx/examples/ostest/prioinherit.c b/nuttx/examples/ostest/prioinherit.c
index 51b9fa49f..bcb8d61f1 100644
--- a/nuttx/examples/ostest/prioinherit.c
+++ b/nuttx/examples/ostest/prioinherit.c
@@ -37,7 +37,6 @@
* Included Files
****************************************************************************/
-#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <semaphore.h>
diff --git a/nuttx/examples/ostest/sem.c b/nuttx/examples/ostest/sem.c
index 847584c38..850cf8040 100644
--- a/nuttx/examples/ostest/sem.c
+++ b/nuttx/examples/ostest/sem.c
@@ -1,7 +1,7 @@
/***********************************************************************
* sem.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,6 @@
*
***********************************************************************/
-#include <sys/types.h>
#include <stdio.h>
#include <pthread.h>
#include <semaphore.h>
diff --git a/nuttx/examples/ostest/sighand.c b/nuttx/examples/ostest/sighand.c
index 223761f1f..46650be1c 100644
--- a/nuttx/examples/ostest/sighand.c
+++ b/nuttx/examples/ostest/sighand.c
@@ -34,6 +34,7 @@
***********************************************************************/
#include <sys/types.h>
+#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <semaphore.h>
@@ -50,8 +51,8 @@
#define SIGVALUE_INT 42
static sem_t sem;
-static boolean sigreceived = FALSE;
-static boolean threadexited = FALSE;
+static bool sigreceived = false;
+static bool threadexited = false;
static void wakeup_action(int signo, siginfo_t *info, void *ucontext)
{
@@ -61,7 +62,7 @@ static void wakeup_action(int signo, siginfo_t *info, void *ucontext)
printf("wakeup_action: Received signal %d\n" , signo);
- sigreceived = TRUE;
+ sigreceived = true;
/* Check signo */
@@ -185,7 +186,7 @@ static int waiter_main(int argc, char *argv[])
fflush(stdout);
#endif
- threadexited = TRUE;
+ threadexited = true;
return 0;
}