[rtems-testing commit] rtems-test-template: Use more static declarations

Joel Sherrill joel at rtems.org
Wed Nov 7 17:46:23 UTC 2018


Module:    rtems-testing
Branch:    master
Commit:    b09e155c61b6446fc889b8b63e0beac949334d10
Changeset: http://git.rtems.org/rtems-testing/commit/?id=b09e155c61b6446fc889b8b63e0beac949334d10

Author:    Joel Sherrill <joel at rtems.org>
Date:      Wed Nov  7 11:46:14 2018 -0600

rtems-test-template: Use more static declarations

---

 rtems-test-template/psxtmtest_blocking/init.c             | 13 ++++---------
 rtems-test-template/psxtmtest_init_destroy/init.c         | 13 ++++---------
 rtems-test-template/psxtmtest_single/init.c               | 10 +++-------
 rtems-test-template/psxtmtest_unblocking_nopreempt/init.c | 12 ++++--------
 rtems-test-template/psxtmtest_unblocking_preempt/init.c   | 15 +++++----------
 rtems-test-template/tmtest/init.c                         |  7 ++-----
 6 files changed, 22 insertions(+), 48 deletions(-)

diff --git a/rtems-test-template/psxtmtest_blocking/init.c b/rtems-test-template/psxtmtest_blocking/init.c
index 5cbf5c6..abef9f2 100644
--- a/rtems-test-template/psxtmtest_blocking/init.c
+++ b/rtems-test-template/psxtmtest_blocking/init.c
@@ -24,12 +24,7 @@
 
 #include <pthread.h>
 
-/* forward declarations to avoid warnings */
-void *POSIX_Init(void *argument);
-void *Middle(void *argument);
-void *Low(void *argument);
-
-void *Low(
+static void *Low(
   void *argument
 )
 {
@@ -51,7 +46,7 @@ void *Low(
   return NULL;
 }
 
-void *Middle(
+static void *Middle(
   void *argument
 )
 {
@@ -59,7 +54,7 @@ void *Middle(
   return NULL;
 }
 
-void *POSIX_Init(
+static void *POSIX_Init(
   void *argument
 )
 {
@@ -85,7 +80,7 @@ void *POSIX_Init(
 
 /* configuration information */
 
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
 #define CONFIGURE_MAXIMUM_POSIX_THREADS     OPERATION_COUNT + 2
diff --git a/rtems-test-template/psxtmtest_init_destroy/init.c b/rtems-test-template/psxtmtest_init_destroy/init.c
index 975ce50..f8f1470 100644
--- a/rtems-test-template/psxtmtest_init_destroy/init.c
+++ b/rtems-test-template/psxtmtest_init_destroy/init.c
@@ -24,12 +24,7 @@
 
 const char rtems_test_name[] = "@UPPER@";
 
-/* forward declarations to avoid warnings */
-void *POSIX_Init(void *argument);
-void benchmark_NAME_OF_CREATE_OPERATION(void);
-void benchmark_NAME_OF_DELETE_OPERATION(void);
-
-void benchmark_NAME_OF_CREATE_OPERATION(void)
+static void benchmark_NAME_OF_CREATE_OPERATION(void)
 {
   long end_time;
   int  status;
@@ -50,7 +45,7 @@ void benchmark_NAME_OF_CREATE_OPERATION(void)
 
 }
 
-void benchmark_NAME_OF_DELETE_OPERATION(void)
+static void benchmark_NAME_OF_DELETE_OPERATION(void)
 {
   long end_time;
   int  status;
@@ -71,7 +66,7 @@ void benchmark_NAME_OF_DELETE_OPERATION(void)
 
 }
 
-void *POSIX_Init(
+static void *POSIX_Init(
   void *argument
 )
 {
@@ -89,7 +84,7 @@ void *POSIX_Init(
 
 /* configuration information */
 
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
 /* XXX configure an instance of the object created/destroyed */
diff --git a/rtems-test-template/psxtmtest_single/init.c b/rtems-test-template/psxtmtest_single/init.c
index 0993986..04dceee 100644
--- a/rtems-test-template/psxtmtest_single/init.c
+++ b/rtems-test-template/psxtmtest_single/init.c
@@ -24,11 +24,7 @@
 
 const char rtems_test_name[] = "@UPPER@";
 
-/* forward declarations to avoid warnings */
-void *POSIX_Init(void *argument);
-void benchmark_NAME_OF_OPERATION(void);
-
-void benchmark_NAME_OF_OPERATION(void)
+static void benchmark_NAME_OF_OPERATION(void)
 {
   long end_time;
   int  status;
@@ -49,7 +45,7 @@ void benchmark_NAME_OF_OPERATION(void)
 
 }
 
-void *POSIX_Init(
+static void *POSIX_Init(
   void *argument
 )
 {
@@ -66,7 +62,7 @@ void *POSIX_Init(
 
 /* configuration information */
 
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
 #define CONFIGURE_MAXIMUM_POSIX_THREADS     1
diff --git a/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c b/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c
index 30ae952..ee03db2 100644
--- a/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c
+++ b/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c
@@ -26,13 +26,9 @@
 
 const char rtems_test_name[] = "@UPPER@";
 
-/* forward declarations to avoid warnings */
-void *POSIX_Init(void *argument);
-void *Blocker(void *argument);
+static pthread_mutex_t MutexId;
 
-pthread_mutex_t MutexId;
-
-void *Blocker(
+static void *Blocker(
   void *argument
 )
 {
@@ -44,7 +40,7 @@ void *Blocker(
   return NULL;
 }
 
-void *POSIX_Init(
+static void *POSIX_Init(
   void *argument
 )
 {
@@ -98,7 +94,7 @@ void *POSIX_Init(
 
 /* configuration information */
 
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
 #define CONFIGURE_MAXIMUM_POSIX_THREADS     2
diff --git a/rtems-test-template/psxtmtest_unblocking_preempt/init.c b/rtems-test-template/psxtmtest_unblocking_preempt/init.c
index 25873ce..c865d80 100644
--- a/rtems-test-template/psxtmtest_unblocking_preempt/init.c
+++ b/rtems-test-template/psxtmtest_unblocking_preempt/init.c
@@ -26,14 +26,9 @@
 
 const char rtems_test_name[] = "@UPPER@";""
 
-/* forward declarations to avoid warnings */
-void *POSIX_Init(void *argument);
-void *Middle(void *argument);
-void *Low(void *argument);
+static pthread_mutex_t MutexId;
 
-pthread_mutex_t MutexId;
-
-void *Low(
+static void *Low(
   void *argument
 )
 {
@@ -58,7 +53,7 @@ void *Low(
   return NULL;
 }
 
-void *Middle(
+static void *Middle(
   void *argument
 )
 {
@@ -79,7 +74,7 @@ void *Middle(
   return NULL;
 }
 
-void *POSIX_Init(
+static void *POSIX_Init(
   void *argument
 )
 {
@@ -154,7 +149,7 @@ void *POSIX_Init(
 
 /* configuration information */
 
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
 #define CONFIGURE_MAXIMUM_POSIX_THREADS     OPERATION_COUNT + 2
diff --git a/rtems-test-template/tmtest/init.c b/rtems-test-template/tmtest/init.c
index 7b71494..62ab244 100644
--- a/rtems-test-template/tmtest/init.c
+++ b/rtems-test-template/tmtest/init.c
@@ -17,10 +17,7 @@
 #include <timesys.h>
 #include "test_support.h"
 
-/* forward declarations to avoid warnings */
-rtems_task Init(rtems_task_argument argument);
-
-rtems_task Init(
+static rtems_task Init(
   rtems_task_argument argument
 )
 {
@@ -35,7 +32,7 @@ rtems_task Init(
 
 /* configuration information */
 
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
 #define CONFIGURE_MAXIMUM_TASKS             1



More information about the vc mailing list