summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-11 01:41:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-11 01:41:16 +0000
commit2e7e636f7568558b7f3508ffd5acce55161668ef (patch)
treefec2e364c3df8bd689e794e82309c650584e5376
parent2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-2e7e636f7568558b7f3508ffd5acce55161668ef.tar.bz2
2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* psx01/init.c, psx01/task.c, psx02/init.c, psx02/task.c, psx03/init.c, psx04/init.c, psx04/task1.c, psx04/task3.c, psx05/init.c, psx06/init.c, psx07/init.c, psx08/init.c, psx09/init.c, psx11/task.c, psx12/init.c, psx13/main.c, psx13/test.c, psxbarrier01/test.c, psxcancel/init.c, psxcleanup/psxcleanup.c, psxenosys/init.c, psxmsgq02/init.c, psxtime/main.c, psxtime/test.c, psxtimer01/psxtimer.c, psxtimer02/psxtimer.c: Fix warnings.
-rw-r--r--testsuites/psxtests/ChangeLog10
-rw-r--r--testsuites/psxtests/psx01/init.c12
-rw-r--r--testsuites/psxtests/psx01/task.c8
-rw-r--r--testsuites/psxtests/psx02/init.c3
-rw-r--r--testsuites/psxtests/psx02/task.c8
-rw-r--r--testsuites/psxtests/psx03/init.c3
-rw-r--r--testsuites/psxtests/psx04/init.c27
-rw-r--r--testsuites/psxtests/psx04/task1.c4
-rw-r--r--testsuites/psxtests/psx04/task3.c5
-rw-r--r--testsuites/psxtests/psx05/init.c15
-rw-r--r--testsuites/psxtests/psx06/init.c12
-rw-r--r--testsuites/psxtests/psx07/init.c11
-rw-r--r--testsuites/psxtests/psx08/init.c6
-rw-r--r--testsuites/psxtests/psx09/init.c7
-rw-r--r--testsuites/psxtests/psx11/task.c8
-rw-r--r--testsuites/psxtests/psx12/init.c7
-rw-r--r--testsuites/psxtests/psx13/main.c5
-rw-r--r--testsuites/psxtests/psx13/test.c80
-rw-r--r--testsuites/psxtests/psxbarrier01/test.c5
-rw-r--r--testsuites/psxtests/psxcancel/init.c9
-rw-r--r--testsuites/psxtests/psxcleanup/psxcleanup.c12
-rw-r--r--testsuites/psxtests/psxenosys/init.c4
-rw-r--r--testsuites/psxtests/psxmsgq02/init.c4
-rw-r--r--testsuites/psxtests/psxtime/main.c5
-rw-r--r--testsuites/psxtests/psxtime/test.c11
-rw-r--r--testsuites/psxtests/psxtimer01/psxtimer.c6
-rw-r--r--testsuites/psxtests/psxtimer02/psxtimer.c4
27 files changed, 195 insertions, 96 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog
index cab237840c..b27dab1c3b 100644
--- a/testsuites/psxtests/ChangeLog
+++ b/testsuites/psxtests/ChangeLog
@@ -1,5 +1,15 @@
2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * psx01/init.c, psx01/task.c, psx02/init.c, psx02/task.c, psx03/init.c,
+ psx04/init.c, psx04/task1.c, psx04/task3.c, psx05/init.c,
+ psx06/init.c, psx07/init.c, psx08/init.c, psx09/init.c, psx11/task.c,
+ psx12/init.c, psx13/main.c, psx13/test.c, psxbarrier01/test.c,
+ psxcancel/init.c, psxcleanup/psxcleanup.c, psxenosys/init.c,
+ psxmsgq02/init.c, psxtime/main.c, psxtime/test.c,
+ psxtimer01/psxtimer.c, psxtimer02/psxtimer.c: Fix warnings.
+
+2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* psxhdrs/clock01.c, psxhdrs/clock02.c, psxhdrs/clock03.c,
psxhdrs/clock04.c, psxhdrs/clock05.c, psxhdrs/clock06.c,
psxhdrs/cond01.c, psxhdrs/cond02.c, psxhdrs/cond03.c,
diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c
index 61796ae035..ca56f58df6 100644
--- a/testsuites/psxtests/psx01/init.c
+++ b/testsuites/psxtests/psx01/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -25,7 +25,7 @@ void *POSIX_Init(
pthread_t thread_id;
time_t seconds;
time_t seconds1;
- time_t remaining;
+ unsigned int remaining;
struct tm tm;
struct utsname uts;
useconds_t useconds;
@@ -58,12 +58,12 @@ void *POSIX_Init(
rtems_test_assert( errno == EINVAL );
puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
- status = clock_gettime( -1, &tv );
+ status = clock_gettime( (clockid_t)-1, &tv );
rtems_test_assert( status == -1 );
rtems_test_assert( errno == EINVAL );
puts( "Init: clock_settime - EINVAL (invalid clockid)" );
- status = clock_settime( -1, &tv );
+ status = clock_settime( (clockid_t)-1, &tv );
rtems_test_assert( status == -1 );
rtems_test_assert( errno == EINVAL );
@@ -79,7 +79,7 @@ void *POSIX_Init(
/* exercise clock_getres */
puts( "Init: clock_getres - EINVAL (invalid clockid)" );
- status = clock_getres( -1, &tv );
+ status = clock_getres( (clockid_t) -1, &tv );
rtems_test_assert( status == -1 );
rtems_test_assert( errno == EINVAL );
@@ -195,7 +195,7 @@ void *POSIX_Init(
puts( "Init: usleep - 1.35 seconds" );
useconds = usleep ( 1350000 );
- rtems_test_assert( useconds < 1350000);
+ rtems_test_assert( useconds < 1350000 );
/* print the current real time again */
status = clock_gettime( CLOCK_REALTIME, &tv );
diff --git a/testsuites/psxtests/psx01/task.c b/testsuites/psxtests/psx01/task.c
index 2a9cc379c1..5b8e3801b3 100644
--- a/testsuites/psxtests/psx01/task.c
+++ b/testsuites/psxtests/psx01/task.c
@@ -8,7 +8,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -20,6 +20,8 @@
#include "system.h"
+void Test_init_routine( void );
+
void Test_init_routine( void )
{
puts( "Test_init_routine: invoked" );
@@ -61,11 +63,11 @@ void *Task_1_through_3(
assert( !status );
puts( "Task_1: pthread_equal - first id bad" );
- status = pthread_equal( -1, Task_id );
+ status = pthread_equal( (pthread_t) -1, Task_id );
assert( !status );
puts( "Task_1: pthread_equal - second id bad" );
- status = pthread_equal( Init_id, -1 );
+ status = pthread_equal( Init_id, (pthread_t) -1 );
assert( !status );
/* exercise pthread_once */
diff --git a/testsuites/psxtests/psx02/init.c b/testsuites/psxtests/psx02/init.c
index 57193a39b4..23c36251da 100644
--- a/testsuites/psxtests/psx02/init.c
+++ b/testsuites/psxtests/psx02/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -15,6 +15,7 @@
volatile int Signal_occurred;
volatile int Signal_count;
+void Signal_handler( int signo );
void Signal_handler(
int signo
diff --git a/testsuites/psxtests/psx02/task.c b/testsuites/psxtests/psx02/task.c
index 260d6e63b4..aacc5a7b84 100644
--- a/testsuites/psxtests/psx02/task.c
+++ b/testsuites/psxtests/psx02/task.c
@@ -8,7 +8,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -25,9 +25,9 @@ void *Task_1_through_3(
void *argument
)
{
- int seconds;
- int i;
- int status;
+ unsigned int seconds;
+ int i;
+ int status;
for ( i=0 ; i<5 ; i++ ) {
print_current_time( "Task1: ", "" );
diff --git a/testsuites/psxtests/psx03/init.c b/testsuites/psxtests/psx03/init.c
index 0b6faa0d15..628bdd8010 100644
--- a/testsuites/psxtests/psx03/init.c
+++ b/testsuites/psxtests/psx03/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -16,6 +16,7 @@
volatile int Signal_occurred;
volatile int Signal_count;
+void Signal_handler( int signo );
void Signal_handler(
int signo
diff --git a/testsuites/psxtests/psx04/init.c b/testsuites/psxtests/psx04/init.c
index 98a9cd3dd4..54c7b5bb05 100644
--- a/testsuites/psxtests/psx04/init.c
+++ b/testsuites/psxtests/psx04/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -16,6 +16,12 @@
volatile int Signal_occurred;
volatile int Signal_count;
+void Signal_handler( int signo );
+void Signal_info_handler(
+ int signo,
+ siginfo_t *info,
+ void *context
+);
void Signal_handler(
int signo
@@ -54,6 +60,7 @@ void *POSIX_Init(
void *argument
)
{
+ unsigned int remaining;
int status;
struct sigaction act;
sigset_t mask;
@@ -198,7 +205,7 @@ void *POSIX_Init(
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
puts( "Init: sleep so the other task can block" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* switch to task 1 */
@@ -212,7 +219,7 @@ void *POSIX_Init(
printf( "Init: Signals pending 0x%08x\n", (unsigned int) pending_set );
puts( "Init: sleep so the other task can catch signal" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* switch to task 1 */
@@ -244,17 +251,17 @@ void *POSIX_Init(
/* schedule the alarm */
puts( "Init: Firing alarm in 5 seconds" );
- status = alarm( 5 );
+ remaining = alarm( 5 );
printf( "Init: %d seconds left on previous alarm\n", status );
assert( !status );
puts( "Init: Firing alarm in 2 seconds" );
- status = alarm( 2 );
+ remaining = alarm( 2 );
printf( "Init: %d seconds left on previous alarm\n", status );
assert( status );
puts( "Init: Wait 4 seconds for alarm" );
- status = sleep( 4 );
+ remaining = sleep( 4 );
printf( "Init: %d seconds left in sleep\n", status );
assert( status );
@@ -324,7 +331,7 @@ void *POSIX_Init(
sigaction( SIGUSR1, &act, NULL );
puts( "Init: sleep so the Task_3 can sigqueue SIGUSR1" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* switch to task 1 */
@@ -348,7 +355,7 @@ void *POSIX_Init(
assert( !status );
puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* Send SIGUSR1, Task_3 has issued a sigwait */
@@ -368,7 +375,7 @@ void *POSIX_Init(
assert( !status );
puts( "Init: sleep so the Task_3 can receive SIGUSR1" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* Send SIGUSR1, Task_3 has issued a sigwaitinfo */
@@ -388,7 +395,7 @@ void *POSIX_Init(
assert( !status );
puts( "Init: sleep so the Task_3 can receive SIGUSR2" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* Suspend for signal that has already be sent */
diff --git a/testsuites/psxtests/psx04/task1.c b/testsuites/psxtests/psx04/task1.c
index 930f3cb777..046ece1476 100644
--- a/testsuites/psxtests/psx04/task1.c
+++ b/testsuites/psxtests/psx04/task1.c
@@ -7,7 +7,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -24,7 +24,7 @@ void *Task_1(
void *argument
)
{
- int seconds;
+ unsigned int seconds;
printf( "Task_1: sleeping for 5 seconds\n" );
diff --git a/testsuites/psxtests/psx04/task3.c b/testsuites/psxtests/psx04/task3.c
index 5870e91272..8f3990ef31 100644
--- a/testsuites/psxtests/psx04/task3.c
+++ b/testsuites/psxtests/psx04/task3.c
@@ -7,7 +7,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -24,6 +24,7 @@ void *Task_3(
void *argument
)
{
+ unsigned int remaining;
int status;
int sig;
union sigval value;
@@ -105,7 +106,7 @@ void *Task_3(
assert( !status );
printf( "Task_3: sleep so the Init task can reguest a signal\n" );
- status = sleep( 1 );
+ remaining = sleep( 1 );
assert( !status );
/* end of task 3 */
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index 7bc472b2ee..1cf47aa800 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -19,6 +19,17 @@
void Print_mutexattr(
char *msg,
pthread_mutexattr_t *attr
+);
+
+void calculate_abstimeout(
+ struct timespec *times,
+ uint32_t seconds,
+ uint32_t nanoseconds
+);
+
+void Print_mutexattr(
+ char *msg,
+ pthread_mutexattr_t *attr
)
{
int status;
@@ -89,7 +100,7 @@ void calculate_abstimeout(
while ( times->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
times->tv_sec++;
- times->tv_nsec - TOD_NANOSECONDS_PER_SECOND;
+ times->tv_nsec -= TOD_NANOSECONDS_PER_SECOND;
}
}
diff --git a/testsuites/psxtests/psx06/init.c b/testsuites/psxtests/psx06/init.c
index 863d8baefc..e22f93e57d 100644
--- a/testsuites/psxtests/psx06/init.c
+++ b/testsuites/psxtests/psx06/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -13,8 +13,10 @@
#include "system.h"
#include <errno.h>
+void Key_destructor( void *key_data );
+
void Key_destructor(
- void *key_data
+ void *key_data
)
{
Destructor_invoked++;
@@ -73,15 +75,15 @@ void *POSIX_Init(
assert( status == EAGAIN );
puts( "Init: pthread_setspecific - EINVAL (invalid key)" );
- status = pthread_setspecific( -1, &Data_array[ 0 ] );
+ status = pthread_setspecific( (pthread_t) -1, &Data_array[ 0 ] );
assert( status == EINVAL );
puts( "Init: pthread_getspecific - EINVAL (invalid key)" );
- key_data = pthread_getspecific( -1 );
+ key_data = pthread_getspecific( (pthread_t) -1 );
assert( !key_data );
puts( "Init: pthread_key_delete - EINVAL (invalid key)" );
- status = pthread_key_delete( -1 );
+ status = pthread_key_delete( (pthread_t) -1 );
assert( status == EINVAL );
printf( "Init: Setting the key to %d\n", 0 );
diff --git a/testsuites/psxtests/psx07/init.c b/testsuites/psxtests/psx07/init.c
index de9392bb98..8ebe6ca75c 100644
--- a/testsuites/psxtests/psx07/init.c
+++ b/testsuites/psxtests/psx07/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -17,6 +17,11 @@
void print_schedparam(
char *prefix,
struct sched_param *schedparam
+);
+
+void print_schedparam(
+ char *prefix,
+ struct sched_param *schedparam
)
{
printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority );
@@ -474,7 +479,7 @@ void *POSIX_Init(
fatal_directive_check_status_only( status, EINVAL, "NULL schedparam" );
puts( "Init: pthread_getschedparam - ESRCH (bad thread)" );
- status = pthread_getschedparam( -1, &schedpolicy, &schedparam );
+ status = pthread_getschedparam( (pthread_t) -1, &schedpolicy, &schedparam );
fatal_directive_check_status_only( status, ESRCH, "bad thread" );
puts( "Init: pthread_getschedparam - SUCCESSFUL" );
@@ -506,7 +511,7 @@ void *POSIX_Init(
fatal_directive_check_status_only( status, EINVAL, "invalid policy" );
puts( "Init: pthread_setschedparam - ESRCH (invalid thread)" );
- status = pthread_setschedparam( -1, SCHED_OTHER, &schedparam );
+ status = pthread_setschedparam( (pthread_t) -1, SCHED_OTHER, &schedparam );
fatal_directive_check_status_only( status, ESRCH, "invalid thread" );
/* now get sporadic server errors */
diff --git a/testsuites/psxtests/psx08/init.c b/testsuites/psxtests/psx08/init.c
index eb21f41f75..9f0e2636d5 100644
--- a/testsuites/psxtests/psx08/init.c
+++ b/testsuites/psxtests/psx08/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -32,7 +32,7 @@ void *POSIX_Init(
printf( "Init's ID is 0x%08x\n", Init_id );
puts( "Init: pthread_detach - ESRCH (invalid id)" );
- status = pthread_detach( -1 );
+ status = pthread_detach( (pthread_t) -1 );
assert( status == ESRCH );
/* detach this thread */
@@ -47,7 +47,7 @@ void *POSIX_Init(
assert( !status );
puts( "Init: pthread_join - ESRCH (invalid id)" );
- status = pthread_join( -1, &return_pointer );
+ status = pthread_join( (pthread_t) -1, &return_pointer );
assert( status == ESRCH );
puts( "Init: pthread_join - SUCCESSFUL" );
diff --git a/testsuites/psxtests/psx09/init.c b/testsuites/psxtests/psx09/init.c
index c3454c2984..b840d4bf11 100644
--- a/testsuites/psxtests/psx09/init.c
+++ b/testsuites/psxtests/psx09/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -13,6 +13,11 @@
#include "system.h"
#include <errno.h>
+void print_schedparam(
+ char *prefix,
+ struct sched_param *schedparam
+);
+
int HIGH_PRIORITY;
int MEDIUM_PRIORITY;
int LOW_PRIORITY;
diff --git a/testsuites/psxtests/psx11/task.c b/testsuites/psxtests/psx11/task.c
index 020e686b64..b8863701bf 100644
--- a/testsuites/psxtests/psx11/task.c
+++ b/testsuites/psxtests/psx11/task.c
@@ -8,7 +8,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -26,6 +26,12 @@ void diff_timespec(
struct timespec *start,
struct timespec *stop,
struct timespec *result
+);
+
+void diff_timespec(
+ struct timespec *start,
+ struct timespec *stop,
+ struct timespec *result
)
{
int nsecs_per_sec = 1000000000;
diff --git a/testsuites/psxtests/psx12/init.c b/testsuites/psxtests/psx12/init.c
index b1f32964a8..7ec603e9ca 100644
--- a/testsuites/psxtests/psx12/init.c
+++ b/testsuites/psxtests/psx12/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -16,6 +16,11 @@
void print_schedparam(
char *prefix,
struct sched_param *schedparam
+);
+
+void print_schedparam(
+ char *prefix,
+ struct sched_param *schedparam
)
{
printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority );
diff --git a/testsuites/psxtests/psx13/main.c b/testsuites/psxtests/psx13/main.c
index 4a75d89fbe..01ba974cec 100644
--- a/testsuites/psxtests/psx13/main.c
+++ b/testsuites/psxtests/psx13/main.c
@@ -1,7 +1,7 @@
/*
* Simple test program -- simplified version of sample test hello.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -17,6 +17,9 @@
#include <pmacros.h>
void test_main( void );
+rtems_task Init(
+ rtems_task_argument ignored
+);
rtems_task Init(
rtems_task_argument ignored
diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c
index 5f68577254..e64d029ed5 100644
--- a/testsuites/psxtests/psx13/test.c
+++ b/testsuites/psxtests/psx13/test.c
@@ -15,7 +15,7 @@
* umask - test implemented
* utime - test implemented
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -37,6 +37,18 @@
#include <pmacros.h>
+int InitFiles(void);
+int DeviceLSeekTest(void);
+int DupTest(void);
+int Dup2Test(void);
+int FDataSyncTest(void);
+int UMaskTest(void);
+int UTimeTest(void);
+int PipeTest(void);
+int PathConfTest(void);
+int FPathConfTest(void);
+int FSyncTest(void);
+
/*-------------------------------------------------------------------
* InitFiles function
*
@@ -53,8 +65,8 @@
* ------------------------------------------------------------------
*/
-int InitFiles (void) {
-
+int InitFiles (void)
+{
int count;
FILE *fp1, *fp2, *fp3;
char letter;
@@ -117,8 +129,8 @@ int InitFiles (void) {
* ---------------------------------------------------------------
*/
-int DeviceLSeekTest (void) {
-
+int DeviceLSeekTest (void)
+{
int error = -1, retval = FALSE;
int fd = open ("/dev/console", O_RDONLY);
@@ -133,7 +145,6 @@ int DeviceLSeekTest (void) {
/* assert (retval == TRUE);*/
return (retval);
-
}
/* ---------------------------------------------------------------
@@ -152,8 +163,8 @@ int DeviceLSeekTest (void) {
* ---------------------------------------------------------------
*/
-int DupTest(void) {
-
+int DupTest(void)
+{
int fd1, fd2;
int flags = 0, retval = FALSE;
@@ -179,7 +190,6 @@ int DupTest(void) {
/* assert (retval == TRUE);*/
return (retval);
-
}
/* ---------------------------------------------------------------
@@ -200,8 +210,8 @@ int DupTest(void) {
* ---------------------------------------------------------------
*/
-int Dup2Test(void) {
-
+int Dup2Test(void)
+{
int fd1, fd2;
int flags = 0, retval = FALSE;
@@ -251,7 +261,6 @@ int Dup2Test(void) {
/* assert (retval == TRUE);*/
return (retval);
-
}
/* ---------------------------------------------------------------
@@ -266,14 +275,15 @@ int Dup2Test(void) {
* attempts to fdatasync an invalid file descriptor (-1).
* attempts to fdatasync a perfectly valid fd opened as RDWR
*
- * returns: TRUE if attempt to fdatasync invalid and read-only filed escriptor fail, and fdatasync succeeds on valid fd.
+ * returns: TRUE if attempt to fdatasync invalid and read-only filed
+ * descriptor fail, and fdatasync succeeds on valid fd.
* FALSE otherwise.
*
* ---------------------------------------------------------------
*/
-int FDataSyncTest(void) {
-
+int FDataSyncTest(void)
+{
int fd = -1;
int error = 0, retval = TRUE;
@@ -314,7 +324,6 @@ int FDataSyncTest(void) {
retval = FALSE;
close (fd);
-
}
/* assert (retval == TRUE);*/
@@ -338,11 +347,12 @@ int FDataSyncTest(void) {
* ---------------------------------------------------------------
*/
-int UMaskTest (void) {
-
- int error = 0, retval = FALSE;
+int UMaskTest (void)
+{
+ mode_t error = 0;
+ int retval = FALSE;
- umask (023);
+ umask(023);
error = umask(022);
if (error == 023)
@@ -353,7 +363,6 @@ int UMaskTest (void) {
/* assert (retval == TRUE);*/
return(retval);
-
}
/* ---------------------------------------------------------------
@@ -367,14 +376,15 @@ int UMaskTest (void) {
* actions: set utime for an invalid filename.
* set utime for a valid filename.
*
- * returns: TRUE if time on valid file is set correctly and utime failed on an invaid filename.
+ * returns: TRUE if time on valid file is set correctly and utime failed on
+ * an invalid filename.
* FALSE otherwise.
*
* ---------------------------------------------------------------
*/
-int UTimeTest (void) {
-
+int UTimeTest (void)
+{
int error = 0, retval = FALSE;
struct utimbuf time;
struct stat fstat;
@@ -413,7 +423,6 @@ int UTimeTest (void) {
/* assert (retval == TRUE);*/
return (retval);
-
}
/* ---------------------------------------------------------------
@@ -431,8 +440,8 @@ int UTimeTest (void) {
* ---------------------------------------------------------------
*/
-int PipeTest (void) {
-
+int PipeTest (void)
+{
int error = 0, retval = FALSE;
int fd[2];
@@ -446,7 +455,6 @@ int PipeTest (void) {
/* assert (retval == TRUE);*/
return(retval);
-
}
/* ---------------------------------------------------------------
@@ -465,8 +473,8 @@ int PipeTest (void) {
* ---------------------------------------------------------------
*/
-int PathConfTest (void) {
-
+int PathConfTest (void)
+{
int error = 0, retval = FALSE;
error = pathconf("thisfiledoesnotexist", _PC_LINK_MAX);
@@ -486,7 +494,6 @@ int PathConfTest (void) {
/* assert (retval == TRUE);*/
return(retval);
-
}
/* ---------------------------------------------------------------
@@ -503,8 +510,8 @@ int PathConfTest (void) {
* ---------------------------------------------------------------
*/
-int FPathConfTest (void) {
-
+int FPathConfTest (void)
+{
int error = 0, retval = TRUE;
int fd = -1;
@@ -537,7 +544,6 @@ int FPathConfTest (void) {
/* assert (retval == TRUE);*/
return(retval);
-
}
/* ---------------------------------------------------------------
@@ -556,8 +562,8 @@ int FPathConfTest (void) {
* ---------------------------------------------------------------
*/
-int FSyncTest (void) {
-
+int FSyncTest (void)
+{
int error = 0, retval = FALSE;
int fd = -1;
@@ -581,7 +587,6 @@ int FSyncTest (void) {
/* assert (retval == TRUE);*/
return(retval);
-
}
/* ---------------------------------------------------------------
@@ -593,6 +598,7 @@ int FSyncTest (void) {
*/
#if defined(__rtems__)
+int test_main(void);
int test_main(void)
#else
int main(
diff --git a/testsuites/psxtests/psxbarrier01/test.c b/testsuites/psxtests/psxbarrier01/test.c
index 0500f8a1c5..df290e68b2 100644
--- a/testsuites/psxtests/psxbarrier01/test.c
+++ b/testsuites/psxtests/psxbarrier01/test.c
@@ -1,7 +1,7 @@
/*
* This test exercises the POSIX Barrier manager.
*
- * COPYRIGHT (c) 1989-2006.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -22,6 +22,7 @@
#define NUMBER_THREADS 2
pthread_t ThreadIds[NUMBER_THREADS];
pthread_barrier_t Barrier;
+void *BarrierThread(void *arg);
void *BarrierThread(void *arg)
{
@@ -41,6 +42,8 @@ void *BarrierThread(void *arg)
*/
#if defined(__rtems__)
+int test_main(void);
+
int test_main(void)
#else
int main(
diff --git a/testsuites/psxtests/psxcancel/init.c b/testsuites/psxtests/psxcancel/init.c
index 54d488a2ba..4f2d08d068 100644
--- a/testsuites/psxtests/psxcancel/init.c
+++ b/testsuites/psxtests/psxcancel/init.c
@@ -51,7 +51,11 @@ rtems_task Init( rtems_task_argument argument);
#endif /* __rtems__ */
-void countTaskDeferred() {
+void countTaskAsync(void);
+void countTaskDeferred(void);
+
+void countTaskDeferred(void)
+{
int i=0;
int type,state;
@@ -64,7 +68,8 @@ void countTaskDeferred() {
}
}
-void countTaskAsync() {
+void countTaskAsync(void)
+{
int i=0;
int type,state;
diff --git a/testsuites/psxtests/psxcleanup/psxcleanup.c b/testsuites/psxtests/psxcleanup/psxcleanup.c
index 88e0069c3e..b1bc0a94f8 100644
--- a/testsuites/psxtests/psxcleanup/psxcleanup.c
+++ b/testsuites/psxtests/psxcleanup/psxcleanup.c
@@ -38,6 +38,16 @@ volatile bool reader_cleanup_ran;
volatile bool release_read_lock_ran;
volatile bool writer_cleanup_ran;
+void waiting_reader_cleanup(void *arg);
+void lock_for_read(void *arg);
+void release_read_lock(void *arg);
+void waiting_writer_cleanup(void *arg);
+void lock_for_write(lock_t *l);
+void release_write_lock(void *arg);
+void initialize_lock_t(lock_t *l);
+void *ReaderThread(void *arg);
+void *WriterThread(void *arg);
+
void waiting_reader_cleanup(void *arg)
{
lock_t *l;
@@ -211,7 +221,7 @@ void *WriterThread(void *arg)
* main entry point to the test
*/
-void *POSIX_Init (
+void *POSIX_Init(
void *argument
)
{
diff --git a/testsuites/psxtests/psxenosys/init.c b/testsuites/psxtests/psxenosys/init.c
index 8d95a2be1f..6918e5316d 100644
--- a/testsuites/psxtests/psxenosys/init.c
+++ b/testsuites/psxtests/psxenosys/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -20,6 +20,8 @@
#include <unistd.h>
#include <sched.h>
+void check_enosys(int status);
+
void check_enosys(int status)
{
if ( (status == -1) && (errno == ENOSYS) )
diff --git a/testsuites/psxtests/psxmsgq02/init.c b/testsuites/psxtests/psxmsgq02/init.c
index 5c7b88b98f..e359557e9b 100644
--- a/testsuites/psxtests/psxmsgq02/init.c
+++ b/testsuites/psxtests/psxmsgq02/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -56,7 +56,7 @@ void *POSIX_Init(
attr.mq_msgsize = MSGSIZE;
puts("Init: mq_open - Workspace not available - ENOMEM");
mq = mq_open( Get_Longest_Name(), O_CREAT, 0x777, &attr );
- fatal_posix_service_status_errno( mq, ENOMEM, "no workspace available" );
+ fatal_posix_service_status_errno((int)mq, ENOMEM, "no workspace available");
puts( "*** END OF POSIX MESSAGE QUEUE 02 TEST ***" );
rtems_test_exit( 0 );
diff --git a/testsuites/psxtests/psxtime/main.c b/testsuites/psxtests/psxtime/main.c
index 0d4d506894..59a417a2dc 100644
--- a/testsuites/psxtests/psxtime/main.c
+++ b/testsuites/psxtests/psxtime/main.c
@@ -1,7 +1,7 @@
/*
* Simple test program -- simplified version of sample test hello.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -17,6 +17,9 @@
#include <tmacros.h> /* instantiate buffering code if needed */
void test_main( void );
+rtems_task Init(
+ rtems_task_argument ignored
+);
rtems_task Init(
rtems_task_argument ignored
diff --git a/testsuites/psxtests/psxtime/test.c b/testsuites/psxtests/psxtime/test.c
index 629a102fc3..72d436ae30 100644
--- a/testsuites/psxtests/psxtime/test.c
+++ b/testsuites/psxtests/psxtime/test.c
@@ -2,7 +2,7 @@
* This test exercises the time of day services via the Classic
* and POSIX APIs to make sure they are consistent.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -23,6 +23,11 @@
#include <rtems.h>
#include <rtems/libio.h>
+void test_adjtime(void);
+void check_a_tod(
+ rtems_time_of_day *the_tod
+);
+
/*
* List of dates and times to test.
*/
@@ -86,7 +91,7 @@ void check_a_tod(
} while( i < 6 );
}
-void test_adjtime()
+void test_adjtime(void)
{
int sc;
rtems_status_code status;
@@ -145,6 +150,8 @@ void test_adjtime()
*/
#if defined(__rtems__)
+int test_main(void);
+
int test_main(void)
#else
int main(
diff --git a/testsuites/psxtests/psxtimer01/psxtimer.c b/testsuites/psxtests/psxtimer01/psxtimer.c
index 0ac1fbe8cc..a78c945ee9 100644
--- a/testsuites/psxtests/psxtimer01/psxtimer.c
+++ b/testsuites/psxtests/psxtimer01/psxtimer.c
@@ -12,7 +12,7 @@
*
* Other POSIX facilities such as timers, condition, .. is also used
*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -32,6 +32,10 @@
#include <stdio.h> /* console facilities */
#include <rtems/score/timespec.h>
+void StopTimer(
+ timer_t timer_id,
+ struct itimerspec *timerdata
+);
/* temporal parameters of a task */
diff --git a/testsuites/psxtests/psxtimer02/psxtimer.c b/testsuites/psxtests/psxtimer02/psxtimer.c
index 22355387c7..b660a412c7 100644
--- a/testsuites/psxtests/psxtimer02/psxtimer.c
+++ b/testsuites/psxtests/psxtimer02/psxtimer.c
@@ -12,7 +12,7 @@
*
* Other POSIX facilities such as timers, condition, .. is also used
*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -51,7 +51,7 @@ void *POSIX_Init (
puts( "\n\n*** POSIX Timers Test 02 ***" );
puts( "timer_create - bad clock id - EINVAL" );
- status = timer_create( -1, &event, &timer );
+ status = timer_create( (timer_t) -1, &event, &timer );
fatal_posix_service_status_errno( status, EINVAL, "bad clock id" );
puts( "timer_create - bad timer id pointer - EINVAL" );