From 6c2de6052d450fa36338ed0c082647b9d535a928 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 11 May 2012 14:12:11 -0500 Subject: psxtests - Eliminate missing prototype warnings --- testsuites/psxtests/psx11/task.c | 23 ++++++--- testsuites/psxtests/psx15/init.c | 3 ++ testsuites/psxtests/psx16/init.c | 10 ++-- testsuites/psxtests/psxaio01/init.c | 4 ++ testsuites/psxtests/psxaio02/init.c | 4 ++ testsuites/psxtests/psxaio03/init.c | 4 ++ testsuites/psxtests/psxalarm01/init.c | 5 +- testsuites/psxtests/psxautoinit01/init.c | 5 +- testsuites/psxtests/psxautoinit02/init.c | 5 +- testsuites/psxtests/psxbarrier01/main.c | 7 +-- testsuites/psxtests/psxcancel/init.c | 6 +++ testsuites/psxtests/psxcancel01/init.c | 21 +++++++- testsuites/psxtests/psxchroot01/main.c | 4 +- testsuites/psxtests/psxchroot01/test.c | 5 +- testsuites/psxtests/psxclassic01/init.c | 16 ++++-- testsuites/psxtests/psxcleanup01/init.c | 7 ++- testsuites/psxtests/psxclock/init.c | 4 +- testsuites/psxtests/psxcond01/init.c | 6 ++- testsuites/psxtests/psxeintr_join/init.c | 11 +++- testsuites/psxtests/psxfatal_support/system.h | 17 +++++-- testsuites/psxtests/psxfchx01/init.c | 5 +- testsuites/psxtests/psxfile01/main.c | 8 +-- testsuites/psxtests/psxfile01/test.c | 15 ++++-- testsuites/psxtests/psxfile01/test_cat.c | 13 +++-- testsuites/psxtests/psxfile01/test_extend.c | 14 +++-- testsuites/psxtests/psxfile01/test_write.c | 14 +++-- testsuites/psxtests/psxfile02/init.c | 6 ++- testsuites/psxtests/psxfilelock01/init.c | 5 +- testsuites/psxtests/psxid01/init.c | 11 ++-- testsuites/psxtests/psximfs01/init.c | 12 ++++- testsuites/psxtests/psximfs02/init.c | 7 ++- testsuites/psxtests/psxintrcritical01/init.c | 6 ++- testsuites/psxtests/psxitimer/init.c | 5 +- testsuites/psxtests/psxkey01/init.c | 13 ++--- testsuites/psxtests/psxkey02/init.c | 5 +- testsuites/psxtests/psxkey03/init.c | 7 ++- testsuites/psxtests/psxmount/main.c | 4 +- testsuites/psxtests/psxmount/test.c | 5 +- testsuites/psxtests/psxmsgq01/init.c | 73 ++++++++++++++++++--------- testsuites/psxtests/psxmsgq01/system.h | 20 ++++---- testsuites/psxtests/psxmsgq02/init.c | 6 ++- testsuites/psxtests/psxmsgq03/init.c | 5 +- testsuites/psxtests/psxmsgq04/init.c | 6 ++- testsuites/psxtests/psxmutexattr01/init.c | 5 +- testsuites/psxtests/psxobj01/init.c | 13 +++-- testsuites/psxtests/psxpasswd01/init.c | 7 ++- testsuites/psxtests/psxpasswd02/init.c | 7 ++- testsuites/psxtests/psxpipe01/init.c | 7 ++- testsuites/psxtests/psxrdwrv/main.c | 8 +-- testsuites/psxtests/psxrdwrv/test.c | 23 ++++++--- testsuites/psxtests/psxreaddir/main.c | 4 +- testsuites/psxtests/psxreaddir/test.c | 22 ++++++-- testsuites/psxtests/psxrwlock01/main.c | 8 +-- testsuites/psxtests/psxrwlock01/test.c | 15 ++++-- testsuites/psxtests/psxsem01/init.c | 5 +- testsuites/psxtests/psxsignal01/init.c | 13 ++++- testsuites/psxtests/psxsignal02/init.c | 8 ++- testsuites/psxtests/psxsignal03/init.c | 9 +++- testsuites/psxtests/psxsignal05/init.c | 7 ++- testsuites/psxtests/psxsignal06/init.c | 11 ++-- testsuites/psxtests/psxspin01/main.c | 16 ++++-- testsuites/psxtests/psxspin01/test.c | 14 +++-- testsuites/psxtests/psxspin02/main.c | 14 +++-- testsuites/psxtests/psxspin02/test.c | 14 +++-- testsuites/psxtests/psxstack01/init.c | 6 ++- testsuites/psxtests/psxstack02/init.c | 10 ++-- testsuites/psxtests/psxstat/main.c | 8 +-- testsuites/psxtests/psxstat/test.c | 42 ++++++++++----- testsuites/psxtests/psxtimes01/init.c | 14 ++--- testsuites/psxtests/psxualarm/init.c | 10 +++- testsuites/psxtests/psxusleep/init.c | 5 +- 71 files changed, 556 insertions(+), 201 deletions(-) diff --git a/testsuites/psxtests/psx11/task.c b/testsuites/psxtests/psx11/task.c index f49f58cf5f..1a0d249857 100644 --- a/testsuites/psxtests/psx11/task.c +++ b/testsuites/psxtests/psx11/task.c @@ -1,14 +1,14 @@ -/* Task_1 +/** + * @file + * + * Task_1 * * This routine serves as a test task. It verifies the basic task * switching capabilities of the executive. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2009. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -24,6 +24,13 @@ #include #include +/* forward declarations to avoid warnings */ +void diff_timespec( + struct timespec *start, + struct timespec *stop, + struct timespec *result +); + void diff_timespec( struct timespec *start, struct timespec *stop, diff --git a/testsuites/psxtests/psx15/init.c b/testsuites/psxtests/psx15/init.c index e60a5bd9b9..cc1f01caa6 100644 --- a/testsuites/psxtests/psx15/init.c +++ b/testsuites/psxtests/psx15/init.c @@ -23,6 +23,9 @@ #include "tmacros.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + /* * This test case shows that post switch extension handlers must cope with * already deleted resources (e.g. _POSIX_signals_Post_switch_extension()). diff --git a/testsuites/psxtests/psx16/init.c b/testsuites/psxtests/psx16/init.c index 1f1ba3b76d..c9227687c5 100644 --- a/testsuites/psxtests/psx16/init.c +++ b/testsuites/psxtests/psx16/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,10 @@ #include "test_support.h" #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void *TestThread(void *argument); + int Index; void *TestThread( @@ -29,9 +33,7 @@ void *TestThread( return argument; } -void *POSIX_Init( - rtems_task_argument argument -) +void *POSIX_Init(void *argument) { int status; pthread_t id; diff --git a/testsuites/psxtests/psxaio01/init.c b/testsuites/psxtests/psxaio01/init.c index 6022aa47eb..5d1857c81a 100644 --- a/testsuites/psxtests/psxaio01/init.c +++ b/testsuites/psxtests/psxaio01/init.c @@ -25,6 +25,10 @@ #define BUFSIZE 512 #define WRONG_FD 404 +/* forward declarations to avoid warnings */ +struct aiocb *create_aiocb(int fd); +void free_aiocb(struct aiocb *aiocbp); + struct aiocb * create_aiocb (int fd) { diff --git a/testsuites/psxtests/psxaio02/init.c b/testsuites/psxtests/psxaio02/init.c index cdf2641b50..614f60a7e4 100644 --- a/testsuites/psxtests/psxaio02/init.c +++ b/testsuites/psxtests/psxaio02/init.c @@ -23,6 +23,10 @@ #include #include +/* forward declarations to avoid warnings */ +struct aiocb *create_aiocb(int fd); +void free_aiocb(struct aiocb *aiocbp); + #define BUFSIZE 32 #define MAX 10 #define WRONG_FD 666 diff --git a/testsuites/psxtests/psxaio03/init.c b/testsuites/psxtests/psxaio03/init.c index a44af6ddd5..80b339b419 100644 --- a/testsuites/psxtests/psxaio03/init.c +++ b/testsuites/psxtests/psxaio03/init.c @@ -24,6 +24,10 @@ #include #include +/* forward declarations to avoid warnings */ +struct aiocb *create_aiocb(int fd); +void free_aiocb(struct aiocb *aiocbp); + #define MAX 6 #define BUFSIZE 128 diff --git a/testsuites/psxtests/psxalarm01/init.c b/testsuites/psxtests/psxalarm01/init.c index 5e388b1700..be3b4a6ef5 100644 --- a/testsuites/psxtests/psxalarm01/init.c +++ b/testsuites/psxtests/psxalarm01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,9 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + volatile int Signal_occurred; volatile int Signal_count; void Signal_handler( int signo ); diff --git a/testsuites/psxtests/psxautoinit01/init.c b/testsuites/psxtests/psxautoinit01/init.c index aad5accc84..11388e15c5 100644 --- a/testsuites/psxtests/psxautoinit01/init.c +++ b/testsuites/psxtests/psxautoinit01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + void *POSIX_Init( void *argument ) diff --git a/testsuites/psxtests/psxautoinit02/init.c b/testsuites/psxtests/psxautoinit02/init.c index 38f643b073..f38e18d02d 100644 --- a/testsuites/psxtests/psxautoinit02/init.c +++ b/testsuites/psxtests/psxautoinit02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + void *POSIX_Init( void *argument ) diff --git a/testsuites/psxtests/psxbarrier01/main.c b/testsuites/psxtests/psxbarrier01/main.c index 5d71fbac52..7c681e7231 100644 --- a/testsuites/psxtests/psxbarrier01/main.c +++ b/testsuites/psxtests/psxbarrier01/main.c @@ -1,7 +1,5 @@ /* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,6 +16,9 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + void test_main( void ); rtems_task Init( diff --git a/testsuites/psxtests/psxcancel/init.c b/testsuites/psxtests/psxcancel/init.c index e365650530..8bb7b41982 100644 --- a/testsuites/psxtests/psxcancel/init.c +++ b/testsuites/psxtests/psxcancel/init.c @@ -22,6 +22,12 @@ #include #endif +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void countTask_cancel_handler(void *ignored); +void *countTaskDeferred(void *ignored); +void *countTaskAsync(void *ignored); + volatile bool countTask_handler; void countTask_cancel_handler(void *ignored) diff --git a/testsuites/psxtests/psxcancel01/init.c b/testsuites/psxtests/psxcancel01/init.c index 5eced3d08d..8a5dfcb327 100644 --- a/testsuites/psxtests/psxcancel01/init.c +++ b/testsuites/psxtests/psxcancel01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,25 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +rtems_timer_service_routine Cancel_duringISR_TSR( + rtems_id ignored_id, + void *ignored_address +); +rtems_timer_service_routine SetState_duringISR_TSR( + rtems_id ignored_id, + void *ignored_address +); +rtems_timer_service_routine SetType_duringISR_TSR( + rtems_id ignored_id, + void *ignored_address +); +void doit( + rtems_timer_service_routine (*TSR)(rtems_id, void *), + const char *method +); + volatile int TSR_occurred; volatile int TSR_status; diff --git a/testsuites/psxtests/psxchroot01/main.c b/testsuites/psxtests/psxchroot01/main.c index c964bcdfe8..64bfa8d806 100644 --- a/testsuites/psxtests/psxchroot01/main.c +++ b/testsuites/psxtests/psxchroot01/main.c @@ -11,7 +11,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +int test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxchroot01/test.c b/testsuites/psxtests/psxchroot01/test.c index 9fec779297..1e3f3ffc91 100644 --- a/testsuites/psxtests/psxchroot01/test.c +++ b/testsuites/psxtests/psxchroot01/test.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * Modifications to support reference counting in the file system are @@ -26,6 +26,9 @@ #include #include +/* forward declarations to avoid warnings */ +int test_main(void); + static void touch( char *file ) { int fd; diff --git a/testsuites/psxtests/psxclassic01/init.c b/testsuites/psxtests/psxclassic01/init.c index 73dde280f6..ba3971ac27 100644 --- a/testsuites/psxtests/psxclassic01/init.c +++ b/testsuites/psxtests/psxclassic01/init.c @@ -1,7 +1,11 @@ -/* - * Based upon user code supplied in conjunction with PR1759 +/** + * @file * - * COPYRIGHT (c) 1989-2011. + * Based upon user code supplied in conjunction with PR1759 + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -24,6 +28,12 @@ int Caught_signo = -1; siginfo_t Caught_siginfo = { -1, -1, }; +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument arg); +void handler(int signo); +void handler_info(int signo, siginfo_t *info, void *context); +rtems_task test_task(rtems_task_argument arg); + void handler(int signo) { Caught_signo = signo; diff --git a/testsuites/psxtests/psxcleanup01/init.c b/testsuites/psxtests/psxcleanup01/init.c index 44877c0dcd..e142240aed 100644 --- a/testsuites/psxtests/psxcleanup01/init.c +++ b/testsuites/psxtests/psxcleanup01/init.c @@ -1,6 +1,5 @@ /* - * - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +15,10 @@ #include "pmacros.h" #include /* thread facilities */ +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void cleaner(void *arg); + void cleaner(void *arg) { puts( "clean was not supposed to run" ); diff --git a/testsuites/psxtests/psxclock/init.c b/testsuites/psxtests/psxclock/init.c index dfec9ddb0f..16b3c3c6d3 100644 --- a/testsuites/psxtests/psxclock/init.c +++ b/testsuites/psxtests/psxclock/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +17,8 @@ #include "pmacros.h" #include "pritime.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); void check_enosys(int status); void check_enosys(int status) diff --git a/testsuites/psxtests/psxcond01/init.c b/testsuites/psxtests/psxcond01/init.c index d3bf678758..f87eca2236 100644 --- a/testsuites/psxtests/psxcond01/init.c +++ b/testsuites/psxtests/psxcond01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,10 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void *BlockingThread(void *argument); + pthread_cond_t Condition; pthread_mutex_t Mutex1; pthread_mutex_t Mutex2; diff --git a/testsuites/psxtests/psxeintr_join/init.c b/testsuites/psxtests/psxeintr_join/init.c index 7987de5139..62a358361b 100644 --- a/testsuites/psxtests/psxeintr_join/init.c +++ b/testsuites/psxtests/psxeintr_join/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -23,6 +23,13 @@ #define SIG_SUSPEND SIGUSR1 #define SIG_THR_RESTART SIGUSR2 +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +static void print_sig_mask(const char * str); +void GC_suspend_handler(int sig); +void GC_restart_handler(int sig); +void *run(void *arg); + sem_t GC_suspend_ack_sem; static void print_sig_mask( const char * str ) @@ -53,7 +60,7 @@ void GC_restart_handler( int sig ) puts( "run in GC_restart_handler" ); } -void* run( void *arg ) +void *run( void *arg ) { int status; pthread_t id = *(pthread_t *)arg; diff --git a/testsuites/psxtests/psxfatal_support/system.h b/testsuites/psxtests/psxfatal_support/system.h index 2f50c28239..d791b19a89 100644 --- a/testsuites/psxtests/psxfatal_support/system.h +++ b/testsuites/psxtests/psxfatal_support/system.h @@ -1,9 +1,11 @@ -/* system.h +/** * * This include file contains information that is included in every * function in the test set. - * - * COPYRIGHT (c) 1989-2009. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,11 +16,20 @@ /* * Some of the fatal error cases require the ability to peek inside RTEMS */ + #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #include #include /* functions */ +void force_error(void); + +void Put_Source(uint32_t source); + +void Put_Error( + uint32_t source, + uint32_t error +); void *POSIX_Init( void *argument diff --git a/testsuites/psxtests/psxfchx01/init.c b/testsuites/psxtests/psxfchx01/init.c index 77844df58c..678a0915be 100644 --- a/testsuites/psxtests/psxfchx01/init.c +++ b/testsuites/psxtests/psxfchx01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -19,6 +19,9 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/psxtests/psxfile01/main.c b/testsuites/psxtests/psxfile01/main.c index 9314a65aa9..f5a5a3edf1 100644 --- a/testsuites/psxtests/psxfile01/main.c +++ b/testsuites/psxtests/psxfile01/main.c @@ -1,7 +1,5 @@ /* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,7 +16,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxfile01/test.c b/testsuites/psxtests/psxfile01/test.c index 6ce62c65c8..20a079277e 100644 --- a/testsuites/psxtests/psxfile01/test.c +++ b/testsuites/psxtests/psxfile01/test.c @@ -1,4 +1,6 @@ -/* +/** + * @file + * * Simple test program to exercise some of the basic functionality of * POSIX Files and Directories Support. * @@ -9,8 +11,10 @@ * / * /dev * /dev/XXX [where XXX includes at least console] - * - * COPYRIGHT (c) 1989-2011. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -40,7 +44,11 @@ #include "primode.h" +/* forward declarations to avoid warnings */ void test_case_reopen_append(void); +void dump_statbuf(struct stat *buf); +void stat_a_file(const char *file); +int test_main(void); char test_write_buffer[ 1024 ]; rtems_filesystem_operations_table IMFS_ops_no_evalformake; @@ -70,7 +78,6 @@ void test_extend( /* * dump_statbuf */ - void dump_statbuf( struct stat *buf ) { int major1; diff --git a/testsuites/psxtests/psxfile01/test_cat.c b/testsuites/psxtests/psxfile01/test_cat.c index a828f8a227..ac291026e0 100644 --- a/testsuites/psxtests/psxfile01/test_cat.c +++ b/testsuites/psxtests/psxfile01/test_cat.c @@ -1,8 +1,12 @@ -/* +/** + * @file + * * A test support function which performs a crude version of * "cat" so you can look at specific parts of a file. - * - * COPYRIGHT (c) 1989-2009. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -26,6 +30,9 @@ #include +/* forward declarations to avoid warnings */ +void test_cat(char *file, int offset_arg, int length); + /* * test_cat routine */ diff --git a/testsuites/psxtests/psxfile01/test_extend.c b/testsuites/psxtests/psxfile01/test_extend.c index 850b10c788..c89bf20d73 100644 --- a/testsuites/psxtests/psxfile01/test_extend.c +++ b/testsuites/psxtests/psxfile01/test_extend.c @@ -1,12 +1,16 @@ -/* +/** + * @file + * * A test support function which extends the file to the specified * length. This handles the implied open(), lseek(), write(), and close() * operations. * * The defined behavior is a seek() followed by a write() extends the file * and zero fills the new length part. - * - * COPYRIGHT (c) 1989-2009. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -30,10 +34,12 @@ #include +/* forward declarations to avoid warnings */ +void test_extend(char *file, off_t offset); + /* * test_extend routine */ - void test_extend( char *file, off_t offset diff --git a/testsuites/psxtests/psxfile01/test_write.c b/testsuites/psxtests/psxfile01/test_write.c index 472d5a950f..3c9344af93 100644 --- a/testsuites/psxtests/psxfile01/test_write.c +++ b/testsuites/psxtests/psxfile01/test_write.c @@ -1,8 +1,12 @@ -/* +/** + * @file + * * A test support function which performs a write() and * handles implied open(), lseek(), write(), and close() operations. - * - * COPYRIGHT (c) 1989-2009. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -25,10 +29,12 @@ #include +/* forward declarations to avoid warnings */ +void test_write(char *file, off_t offset, char *buffer); + /* * test_write routine */ - void test_write( char *file, off_t offset, diff --git a/testsuites/psxtests/psxfile02/init.c b/testsuites/psxtests/psxfile02/init.c index a0341c2f3f..c6639813ca 100644 --- a/testsuites/psxtests/psxfile02/init.c +++ b/testsuites/psxtests/psxfile02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -29,6 +29,10 @@ #include #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void do_with_fd(int fd, const char *description); + void do_with_fd( int fd, const char *description diff --git a/testsuites/psxtests/psxfilelock01/init.c b/testsuites/psxtests/psxfilelock01/init.c index f5826f7f1f..5ea4f7e0f9 100644 --- a/testsuites/psxtests/psxfilelock01/init.c +++ b/testsuites/psxtests/psxfilelock01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include "test_support.h" #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/psxtests/psxid01/init.c b/testsuites/psxtests/psxid01/init.c index 416907c0fe..829732bef9 100644 --- a/testsuites/psxtests/psxid01/init.c +++ b/testsuites/psxtests/psxid01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,6 +18,13 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void test_gid(void); +void test_uid(void); +void test_pid(void); +void test_getlogin(void); + void test_gid(void) { gid_t gid; @@ -125,8 +132,6 @@ void test_getlogin(void) puts( "getlogin_r(buffer, 0) -- ERANGE" ); sc = getlogin_r( &ch, 0 ); rtems_test_assert( sc == ERANGE ); - - } rtems_task Init( diff --git a/testsuites/psxtests/psximfs01/init.c b/testsuites/psxtests/psximfs01/init.c index c24924c653..d507510c3d 100644 --- a/testsuites/psxtests/psximfs01/init.c +++ b/testsuites/psxtests/psximfs01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +21,16 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void open_it(bool readOnly, bool create); +void write_helper(void); +void read_helper(void); +void truncate_helper(void); +void extend_helper(int eno); +void close_it(void); +void unlink_it(void); + int TestFd; uint8_t Buffer[256]; ssize_t TotalWritten; diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c index 6730567a08..10e97bba60 100644 --- a/testsuites/psxtests/psximfs02/init.c +++ b/testsuites/psxtests/psximfs02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -27,7 +27,10 @@ extern int seteuid(uid_t euid); #endif -void IMFS_dump( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void IMFS_dump(void); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/psxtests/psxintrcritical01/init.c b/testsuites/psxtests/psxintrcritical01/init.c index 23057d16a6..8489716447 100644 --- a/testsuites/psxtests/psxintrcritical01/init.c +++ b/testsuites/psxtests/psxintrcritical01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,10 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); + #define TEST_NAME "01" #define TEST_STRING "POSIX Timer" diff --git a/testsuites/psxtests/psxitimer/init.c b/testsuites/psxtests/psxitimer/init.c index 714959b98e..984c9c385e 100644 --- a/testsuites/psxtests/psxitimer/init.c +++ b/testsuites/psxtests/psxitimer/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + void *POSIX_Init( void *argument ) diff --git a/testsuites/psxtests/psxkey01/init.c b/testsuites/psxtests/psxkey01/init.c index a8fd98bed2..dbd73d10f8 100644 --- a/testsuites/psxtests/psxkey01/init.c +++ b/testsuites/psxtests/psxkey01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,18 +16,19 @@ #include #include "tmacros.h" -void Key_destructor( - void *key_data -) +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void Key_destructor(void *key_data); + +void Key_destructor(void *key_data) { } - void *POSIX_Init( void *argument ) { - int status; + int status; puts( "\n\n*** POSIX KEY 01 TEST ***" ); diff --git a/testsuites/psxtests/psxkey02/init.c b/testsuites/psxtests/psxkey02/init.c index e986ffa90c..943dedc85c 100644 --- a/testsuites/psxtests/psxkey02/init.c +++ b/testsuites/psxtests/psxkey02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,9 @@ #include "tmacros.h" #include "pmacros.h" +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + void *POSIX_Init( void *ignored ) diff --git a/testsuites/psxtests/psxkey03/init.c b/testsuites/psxtests/psxkey03/init.c index 9f060a7227..0d12799515 100644 --- a/testsuites/psxtests/psxkey03/init.c +++ b/testsuites/psxtests/psxkey03/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,11 @@ #include "tmacros.h" #include "pmacros.h" +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void destructor(void *value); +void *Test_Thread(void *key_value); + pthread_key_t Key; volatile bool destructor_ran; diff --git a/testsuites/psxtests/psxmount/main.c b/testsuites/psxtests/psxmount/main.c index f689544947..63d95a2c74 100644 --- a/testsuites/psxtests/psxmount/main.c +++ b/testsuites/psxtests/psxmount/main.c @@ -13,7 +13,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxmount/test.c b/testsuites/psxtests/psxmount/test.c index 7c0e8c9c32..1033226a31 100644 --- a/testsuites/psxtests/psxmount/test.c +++ b/testsuites/psxtests/psxmount/test.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * Modifications to support reference counting in the file system are @@ -26,6 +26,9 @@ #include #include +/* forward declarations to avoid warnings */ +int test_main(void); + DIR *directory; DIR *directory2; DIR *directory3; diff --git a/testsuites/psxtests/psxmsgq01/init.c b/testsuites/psxtests/psxmsgq01/init.c index 6a8cdeba89..2591912127 100644 --- a/testsuites/psxtests/psxmsgq01/init.c +++ b/testsuites/psxtests/psxmsgq01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -20,6 +20,46 @@ #include /* signal facilities */ #include "test_support.h" +/* forward declarations to avoid warnings */ +void Start_Test(char *description); +void Validate_attributes(mqd_t mq, int oflag, int msg_count); +char *Build_Queue_Name(int i); +void open_test_queues(void); +void validate_mq_open_error_codes(void); +void validate_mq_unlink_error_codes(void); +void validate_mq_close_error_codes(void); +void validate_mq_getattr_error_codes(void); +void Send_msg_to_que(int que, int msg); +void Show_send_msg_to_que(char *task_name, int que, int msg); +void verify_queues_full(char *task_name); +void verify_queues_empty(char *task_name); +int empty_message_queues(char *task_name); +int fill_message_queues(char *task_name); +void Read_msg_from_que(int que, int msg); +int validate_mq_send_error_codes(void); +void validate_mq_receive_error_codes(void); +void verify_open_functionality(void); +void verify_unlink_functionality(void); +void verify_close_functionality(void); +void verify_timed_send_queue(int que, int is_blocking); +void verify_timed_send(void); +void verify_timed_receive_queue(char *task_name, int que, int is_blocking); +void verify_timed_receive(void); +void wait_for_signal(sigset_t *waitset, int sec, int expect_signal); +void verify_notify(void); +void verify_with_threads(void); +void verify_timedout_mq_timedreceive( + char *task_name, int que, int is_blocking);; +void verify_timedout_mq_timedsend(int que, int is_blocking); +void verify_timed_receive(void); +void validate_mq_setattr(void); +void verify_timedout_mq_timedreceive( + char *task_name, int que, int is_blocking); +void verify_mq_receive(void); +void verify_timedout_mq_timedsend(int que, int is_blocking); +void verify_mq_send(void); +void verify_timed_receive(void); + #define fatal_posix_mqd( _ptr, _msg ) \ if ( (_ptr != (mqd_t) -1) ) { \ check_dispatch_disable_level( 0 ); \ @@ -29,12 +69,12 @@ rtems_test_exit( -1 ); \ } - typedef struct { char msg[ 50 ]; int size; unsigned int priority; -}Test_Message_t; +} Test_Message_t; + Test_Message_t Predefined_Msgs[MAXMSG+1]; Test_Message_t Predefined_Msgs[MAXMSG+1] = { { "12345678", 9, MQ_PRIO_MAX-1 }, /* Max Length Message med */ @@ -93,9 +133,9 @@ void Start_Test( void Validate_attributes( - mqd_t mq, - int oflag, - int msg_count + mqd_t mq, + int oflag, + int msg_count ) { int status; @@ -114,8 +154,8 @@ void Validate_attributes( } #define Get_Queue_Name( i ) Test_q[i].name -char *Build_Queue_Name( int i ) { - +char *Build_Queue_Name(int i) +{ static char Queue_Name[PATH_MAX + 2]; sprintf(Queue_Name,"mq%d", i+1 ); @@ -528,7 +568,6 @@ int empty_message_queues( * Returns the number of messages queued after the test on the * first queue. */ - int validate_mq_send_error_codes(void) { int status; @@ -1374,19 +1413,3 @@ void *Task_5 ( return NULL; /* just so the compiler thinks we returned something */ } - -void *Task_ ( - void *argument -) -{ - - print_current_time( "Task_: ", "" ); - - puts( "Task_: pthread_exit" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ - -} diff --git a/testsuites/psxtests/psxmsgq01/system.h b/testsuites/psxtests/psxmsgq01/system.h index d0d074b31c..f17650829c 100644 --- a/testsuites/psxtests/psxmsgq01/system.h +++ b/testsuites/psxtests/psxmsgq01/system.h @@ -1,9 +1,12 @@ -/* system.h +/** + * @file * * This include file contains information that is included in every * function in the test set. - * - * COPYRIGHT (c) 1989-1999. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -19,13 +22,10 @@ #include #include -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - void *argument -); +void *POSIX_Init(void *argument); +void *Task_1_through_3(void *argument); +void *Task_4(void *argument); +void *Task_5(void *argument); /* configuration information */ diff --git a/testsuites/psxtests/psxmsgq02/init.c b/testsuites/psxtests/psxmsgq02/init.c index fba002e37e..4f5910a675 100644 --- a/testsuites/psxtests/psxmsgq02/init.c +++ b/testsuites/psxtests/psxmsgq02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +21,10 @@ #include #include #include /* signal facilities */ +#include "test_support.h" + +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); pthread_t Init_id; diff --git a/testsuites/psxtests/psxmsgq03/init.c b/testsuites/psxtests/psxmsgq03/init.c index 97b51cdb54..c09131893f 100644 --- a/testsuites/psxtests/psxmsgq03/init.c +++ b/testsuites/psxtests/psxmsgq03/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -20,6 +20,9 @@ #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_timer_service_routine mq_send_timer(rtems_id timer, void *arg); + mqd_t Queue; volatile bool tsr_fired; volatile int tsr_status; diff --git a/testsuites/psxtests/psxmsgq04/init.c b/testsuites/psxtests/psxmsgq04/init.c index a845f2ac9b..6549c3a2e3 100644 --- a/testsuites/psxtests/psxmsgq04/init.c +++ b/testsuites/psxtests/psxmsgq04/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -22,6 +22,9 @@ #include "test_support.h" +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + void *POSIX_Init( void *argument ) @@ -30,7 +33,6 @@ void *POSIX_Init( mqd_t Queue, second_Queue; int sc; Heap_Information_block start; - Heap_Information_block info; size_t to_alloc; void *alloced; bool sb; diff --git a/testsuites/psxtests/psxmutexattr01/init.c b/testsuites/psxtests/psxmutexattr01/init.c index a022e1ca42..3e25d5e204 100644 --- a/testsuites/psxtests/psxmutexattr01/init.c +++ b/testsuites/psxtests/psxmutexattr01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) typedef struct { const char *name; diff --git a/testsuites/psxtests/psxobj01/init.c b/testsuites/psxtests/psxobj01/init.c index 42fa57461c..aee8bf7e52 100644 --- a/testsuites/psxtests/psxobj01/init.c +++ b/testsuites/psxtests/psxobj01/init.c @@ -1,6 +1,10 @@ -/* Odd Object Name/Id Error Cases - * - * COPYRIGHT (c) 1989-2009. +/** + * @file + * Odd Object Name/Id Error Cases + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +19,9 @@ #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/psxtests/psxpasswd01/init.c b/testsuites/psxtests/psxpasswd01/init.c index b7d7475f55..399d5e8f66 100644 --- a/testsuites/psxtests/psxpasswd01/init.c +++ b/testsuites/psxtests/psxpasswd01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +17,11 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void print_passwd(struct passwd *pw); +void print_group(struct group *gr); + void print_passwd( struct passwd *pw ) diff --git a/testsuites/psxtests/psxpasswd02/init.c b/testsuites/psxtests/psxpasswd02/init.c index f9442d29ca..e9563a10d6 100644 --- a/testsuites/psxtests/psxpasswd02/init.c +++ b/testsuites/psxtests/psxpasswd02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +21,11 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void print_passwd(struct passwd *pw); +void print_group(struct group *gr); + void print_passwd( struct passwd *pw ) diff --git a/testsuites/psxtests/psxpipe01/init.c b/testsuites/psxtests/psxpipe01/init.c index c9250e36b8..d2e0381a53 100644 --- a/testsuites/psxtests/psxpipe01/init.c +++ b/testsuites/psxtests/psxpipe01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -20,8 +20,11 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); + rtems_task Init( - rtems_task_argument not_used + rtems_task_argument ignored ) { int fd[2] = {0,0}; diff --git a/testsuites/psxtests/psxrdwrv/main.c b/testsuites/psxtests/psxrdwrv/main.c index d29222955b..29f197c8e8 100644 --- a/testsuites/psxtests/psxrdwrv/main.c +++ b/testsuites/psxtests/psxrdwrv/main.c @@ -1,7 +1,5 @@ /* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,7 +16,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxrdwrv/test.c b/testsuites/psxtests/psxrdwrv/test.c index 9ab555ba84..cedca900a9 100644 --- a/testsuites/psxtests/psxrdwrv/test.c +++ b/testsuites/psxtests/psxrdwrv/test.c @@ -1,10 +1,14 @@ -/* +/** + * @file + * * This test exercises the following routines: * * + readv * + writev - * - * COPYRIGHT (c) 1989-2009. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -39,8 +43,13 @@ #define rtems_test_exit(_s) exit(_s) #endif -#define TESTFILE "testfile1.tst" +/* forward declarations to avoid warnings */ +int test_main(void); +int fillPatternBuffer(void); +int doFunctionalTest(void); +int doErrorTest(void); +#define TESTFILE "testfile1.tst" /* This buffer size is assumed in the iovec initialization below */ #define MAX_BUFFER 1000 @@ -56,7 +65,6 @@ unsigned char ReadBuffer[MAX_BUFFER]; * FALSE if buffer failed to fill * */ - int fillPatternBuffer(void) { int retval = TRUE; @@ -79,8 +87,8 @@ int fillPatternBuffer(void) * FALSE if an operation did not work as expected. * */ - -int doFunctionalTest(void) { +int doFunctionalTest(void) +{ FILE *fp; int fd; struct iovec rdvec[4]; @@ -165,7 +173,6 @@ int doFunctionalTest(void) { * FALSE if an operation did not work as expected. * */ - int doErrorTest(void) { FILE *fp; diff --git a/testsuites/psxtests/psxreaddir/main.c b/testsuites/psxtests/psxreaddir/main.c index c964bcdfe8..ad0a473b2d 100644 --- a/testsuites/psxtests/psxreaddir/main.c +++ b/testsuites/psxtests/psxreaddir/main.c @@ -11,7 +11,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxreaddir/test.c b/testsuites/psxtests/psxreaddir/test.c index 76239de10a..28e62963c7 100644 --- a/testsuites/psxtests/psxreaddir/test.c +++ b/testsuites/psxtests/psxreaddir/test.c @@ -1,4 +1,6 @@ -/* +/** + * @file + * * This is a native test to explore how the readdir() family works. * Newlib supports the following readdir() family members: * @@ -14,8 +16,10 @@ * seekdir() takes an offset which is a byte offset. The Linux * implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1) * record where DIRENT_SIZE seems to be 12 bytes. - * - * COPYRIGHT (c) 1989-2011. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -36,6 +40,17 @@ #include #include +/* forward declarations to avoid warnings */ +int test_main(void); +void printdir(DIR *directory); +void complete_printdir(char *path); +int select1(const struct dirent *entry); +int select2(const struct dirent *entry); +int compare_ascending(const struct dirent **a, const struct dirent **b); +int compare_descending( const struct dirent **a, const struct dirent **b); +void test_across_mount(void); +void test_across_mount(void); + DIR *directory; DIR *directory2; DIR *directory3; @@ -172,7 +187,6 @@ int compare_ascending(const struct dirent **a, const struct dirent **b ) return i; } - int compare_descending( const struct dirent **a, const struct dirent **b ) { int i; diff --git a/testsuites/psxtests/psxrwlock01/main.c b/testsuites/psxtests/psxrwlock01/main.c index 8a04beb474..d1acd288f4 100644 --- a/testsuites/psxtests/psxrwlock01/main.c +++ b/testsuites/psxtests/psxrwlock01/main.c @@ -1,7 +1,5 @@ /* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-2008. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,7 +16,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxrwlock01/test.c b/testsuites/psxtests/psxrwlock01/test.c index 14ce849752..bf16548e86 100644 --- a/testsuites/psxtests/psxrwlock01/test.c +++ b/testsuites/psxtests/psxrwlock01/test.c @@ -1,7 +1,11 @@ -/* - * This test exercises the POSIX RWLock manager. +/** + * @file * - * COPYRIGHT (c) 1989-2010. + * This test exercises the POSIX RWLock manager. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +25,11 @@ /* #define __USE_XOPEN2K XXX already defined on GNU/Linux */ #include +/* forward declarations to avoid warnings */ +void *ReadLockThread(void *arg); +void *WriteLockThread(void *arg); +int test_main(void); + #if !HAVE_DECL_PTHREAD_RWLOCK_UNLOCK /* FIXME: Newlib should provide the decl. */ extern int pthread_rwlock_unlock(pthread_rwlock_t *rwlock); diff --git a/testsuites/psxtests/psxsem01/init.c b/testsuites/psxtests/psxsem01/init.c index 74100409d0..a05a549dcd 100644 --- a/testsuites/psxtests/psxsem01/init.c +++ b/testsuites/psxtests/psxsem01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -20,6 +20,9 @@ #include #include "test_support.h" +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); + #define fatal_posix_sem( _ptr, _msg ) \ if ( (_ptr != SEM_FAILED) ) { \ check_dispatch_disable_level( 0 ); \ diff --git a/testsuites/psxtests/psxsignal01/init.c b/testsuites/psxtests/psxsignal01/init.c index b606f0ac84..8a85bef933 100644 --- a/testsuites/psxtests/psxsignal01/init.c +++ b/testsuites/psxtests/psxsignal01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,17 @@ #include "system.h" #include #include + +/* forward declarations to avoid warnings */ +int test_main(void); +void Handler_1(int signo); +void Signal_handler(int signo); +void Signal_info_handler(int signo, siginfo_t *info, void *context); +rtems_timer_service_routine Signal_duringISR_TSR( + rtems_id ignored_id, + void *ignored_address +); + typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler); extern void _POSIX_signals_Abnormal_termination_handler( int signo ); diff --git a/testsuites/psxtests/psxsignal02/init.c b/testsuites/psxtests/psxsignal02/init.c index d74ec05ab5..5e6a5cc533 100644 --- a/testsuites/psxtests/psxsignal02/init.c +++ b/testsuites/psxtests/psxsignal02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +17,12 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void *Test_Thread(void *arg); +void Signal_handler(int signo); +void Install_Signal_Handler(const char *task_name); + volatile bool Signal_occurred; volatile pthread_t Signal_thread; diff --git a/testsuites/psxtests/psxsignal03/init.c b/testsuites/psxtests/psxsignal03/init.c index f322ce8489..0b6ee77215 100644 --- a/testsuites/psxtests/psxsignal03/init.c +++ b/testsuites/psxtests/psxsignal03/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -45,7 +45,6 @@ #else #error "Test Mode not defined" - #endif #include @@ -54,6 +53,12 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void *Test_Thread(void *arg); +void Signal_handler(int signo, siginfo_t *info, void *arg); +const char *signal_name(int signo); + volatile bool Signal_occurred; volatile pthread_t Signal_thread; diff --git a/testsuites/psxtests/psxsignal05/init.c b/testsuites/psxtests/psxsignal05/init.c index 37318aa925..1556a94118 100644 --- a/testsuites/psxtests/psxsignal05/init.c +++ b/testsuites/psxtests/psxsignal05/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -22,6 +22,11 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void Signal_handler(int signo, siginfo_t *info, void *arg); +const char *signal_name(int signo); + void Signal_handler( int signo, siginfo_t *info, diff --git a/testsuites/psxtests/psxsignal06/init.c b/testsuites/psxtests/psxsignal06/init.c index fb59eb37a7..da2b31e7e0 100644 --- a/testsuites/psxtests/psxsignal06/init.c +++ b/testsuites/psxtests/psxsignal06/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,11 @@ #include #include +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void Handler(int signo); +void *TestThread(void *argument); + pthread_t ThreadId; pthread_cond_t CondVarId; pthread_mutex_t MutexId; @@ -63,9 +68,7 @@ void *TestThread( return NULL; } -void *POSIX_Init( - rtems_task_argument argument -) +void *POSIX_Init(void *argument) { int status; diff --git a/testsuites/psxtests/psxspin01/main.c b/testsuites/psxtests/psxspin01/main.c index 292901d851..26497c1894 100644 --- a/testsuites/psxtests/psxspin01/main.c +++ b/testsuites/psxtests/psxspin01/main.c @@ -1,7 +1,11 @@ -/* - * Simple test program wrapper for Spinlocks +/** + * @file * - * COPYRIGHT (c) 1989-2008. + * Simple test program wrapper for Spinlocks + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,8 +21,10 @@ #include #include - -void test_main( void ); + +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxspin01/test.c b/testsuites/psxtests/psxspin01/test.c index eebde0fc8b..4a0842f2d0 100644 --- a/testsuites/psxtests/psxspin01/test.c +++ b/testsuites/psxtests/psxspin01/test.c @@ -1,7 +1,11 @@ -/* - * This test exercises the POSIX Spinlock manager. +/** + * @file * - * COPYRIGHT (c) 1989-2009. + * This test exercises the POSIX Spinlock manager. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -22,6 +26,10 @@ #include /* for task creation */ +/* forward declarations to avoid warnings */ +int test_main(void); +rtems_task SpinlockThread(rtems_task_argument arg); + pthread_spinlock_t Spinlock; volatile int mainThreadSpinning; diff --git a/testsuites/psxtests/psxspin02/main.c b/testsuites/psxtests/psxspin02/main.c index 292901d851..d305c1c794 100644 --- a/testsuites/psxtests/psxspin02/main.c +++ b/testsuites/psxtests/psxspin02/main.c @@ -1,7 +1,11 @@ -/* - * Simple test program wrapper for Spinlocks +/** + * @file * - * COPYRIGHT (c) 1989-2008. + * Simple test program wrapper for Spinlocks + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,7 +22,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxspin02/test.c b/testsuites/psxtests/psxspin02/test.c index 5e88d4a7e3..d30ff237e4 100644 --- a/testsuites/psxtests/psxspin02/test.c +++ b/testsuites/psxtests/psxspin02/test.c @@ -1,7 +1,11 @@ -/* - * This test exercises the POSIX Spinlock manager. +/** + * @file * - * COPYRIGHT (c) 1989-2009. + * This test exercises the POSIX Spinlock manager. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -22,6 +26,10 @@ #include /* for task creation */ +/* forward declarations to avoid warnings */ +int test_main(void); +rtems_task SpinlockThread(rtems_task_argument arg); + pthread_spinlock_t Spinlock; rtems_task SpinlockThread(rtems_task_argument arg) diff --git a/testsuites/psxtests/psxstack01/init.c b/testsuites/psxtests/psxstack01/init.c index 26ac338932..aadac4c8db 100644 --- a/testsuites/psxtests/psxstack01/init.c +++ b/testsuites/psxtests/psxstack01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -19,6 +19,10 @@ #include /* for PTHREAD_MINIMUM_STACK_SIZE */ +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void *Test_Thread(void *argument); + void *Stack_Low; void *Stack_High; diff --git a/testsuites/psxtests/psxstack02/init.c b/testsuites/psxtests/psxstack02/init.c index a69dae2c51..603cf21b65 100644 --- a/testsuites/psxtests/psxstack02/init.c +++ b/testsuites/psxtests/psxstack02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +21,10 @@ #include /* for PTHREAD_MINIMUM_STACK_SIZE */ +/* forward declarations to avoid warnings */ +void *POSIX_Init(void *argument); +void *Test_Thread(void *arg); + void *Stack_Low; void *Stack_High; @@ -46,9 +50,7 @@ void *Test_Thread(void *arg) return NULL; } -void *POSIX_Init( - rtems_task_argument argument -) +void *POSIX_Init(void *argument) { #if HAVE_DECL_PTHREAD_ATTR_SETSTACK int sc; diff --git a/testsuites/psxtests/psxstat/main.c b/testsuites/psxtests/psxstat/main.c index f1269408a6..1dbd10b354 100644 --- a/testsuites/psxtests/psxstat/main.c +++ b/testsuites/psxtests/psxstat/main.c @@ -1,7 +1,5 @@ /* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -18,7 +16,9 @@ #include #include -void test_main( void ); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument ignored); +void test_main(void); rtems_task Init( rtems_task_argument ignored diff --git a/testsuites/psxtests/psxstat/test.c b/testsuites/psxtests/psxstat/test.c index 5f5e5d1485..3c35a766eb 100644 --- a/testsuites/psxtests/psxstat/test.c +++ b/testsuites/psxtests/psxstat/test.c @@ -1,11 +1,15 @@ -/* +/** + * @file + * * This test exercises stat() via fstat() and generates as many of the * path evaluation cases as possible. * * This test also exercises lstat() and lchown() when symlinks are * involved. - * - * COPYRIGHT (c) 1989-2010. + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -33,6 +37,27 @@ #include "primode.h" +/* forward declarations to avoid warnings */ +int test_main(void); +void stat_a_file_helper(const char *file, int follow_link); +void stat_a_file(const char *file); +void lstat_a_file(const char *file); +void stat_multiple_files(char **files); +void chown_multiple_files_helper(char **files, int follow_link); +void chown_multiple_files(char **files); +void lchown_multiple_files(char **files); +void make_multiple_files(char **files); +void make_multiple_bad_files(char **files); +void make_multiple_links(char **existing, char **new); +void make_too_many_links(void); +void make_a_symlink(char *existing, char *new); +void make_multiple_symlinks(void); +void make_many_symlinks(char *real_file, int link_count); +void make_multiple_directories(char **files); +void Cause_faults(void); +void Show_Time(void); +void test_statvfs(void); + #define MAXSYMLINK 5 /* There needs to be a better way of getting this. */ #define TIMEOUT_VALUE ( 5 * rtems_clock_get_ticks_per_second() ) @@ -175,7 +200,6 @@ char *Good_relative_paths[] = { /* * Do a stat/lstat on a single file and report the status. */ - void stat_a_file_helper( const char *file, int follow_link @@ -248,7 +272,6 @@ void lstat_a_file( /* * stat() multiple files at a time */ - void stat_multiple_files( char **files ) @@ -324,7 +347,6 @@ void lchown_multiple_files( /* * mknod() multiple files at a time */ - void make_multiple_files( char **files ) @@ -384,7 +406,6 @@ void make_multiple_links( rtems_test_assert( status == -1 ); } - void make_too_many_links(void) { int i; @@ -407,7 +428,6 @@ void make_too_many_links(void) } } - void make_a_symlink( char *existing, char *new @@ -475,6 +495,7 @@ void make_too_many_symlinks() } } */ + void make_many_symlinks( char *real_file, int link_count @@ -504,7 +525,6 @@ void make_many_symlinks( /* * mkdir() multiple directories at a time */ - void make_multiple_directories( char **files ) @@ -525,8 +545,6 @@ void make_multiple_directories( /* * Cause faults. */ - - void Cause_faults(void) { int fd; @@ -762,7 +780,7 @@ void Show_Time(void) print_time( " - rtems_clock_get_tod - ", &time, "\n" ); } -void test_statvfs( void ) +void test_statvfs(void) { int status = 0; diff --git a/testsuites/psxtests/psxtimes01/init.c b/testsuites/psxtests/psxtimes01/init.c index d3e6c9c39f..640fe57979 100644 --- a/testsuites/psxtests/psxtimes01/init.c +++ b/testsuites/psxtests/psxtimes01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,14 +16,10 @@ #include #include -clock_t _times_r( - struct _reent *ptr, - struct tms *ptms -); - -clock_t _times( - struct tms *ptms -); +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +clock_t _times_r(struct _reent *ptr, struct tms *ptms); +clock_t _times(struct tms *ptms); rtems_task Init( rtems_task_argument argument diff --git a/testsuites/psxtests/psxualarm/init.c b/testsuites/psxtests/psxualarm/init.c index 833b375596..19c9e442e4 100644 --- a/testsuites/psxtests/psxualarm/init.c +++ b/testsuites/psxtests/psxualarm/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,14 @@ #include #include #include + +/* forward declarations to avoid warnings */ +void Signal_handler(int signo); +rtems_timer_service_routine Signal_duringISR_TSR( + rtems_id ignored_id, + void *ignored_address +); + typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler); extern void _POSIX_signals_Abnormal_termination_handler( int signo ); diff --git a/testsuites/psxtests/psxusleep/init.c b/testsuites/psxtests/psxusleep/init.c index bb58941b81..c57f15e2d8 100644 --- a/testsuites/psxtests/psxusleep/init.c +++ b/testsuites/psxtests/psxusleep/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include #include +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) -- cgit v1.2.3