2011-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>

* psxhdrs/pthread01.c, psxhdrs/pthread02.c, psxhdrs/pthread03.c,
	psxhdrs/pthread04.c, psxhdrs/pthread05.c, psxhdrs/pthread06.c,
	psxhdrs/pthread07.c, psxhdrs/pthread09.c, psxhdrs/pthread10.c,
	psxhdrs/pthread11.c, psxhdrs/pthread12.c, psxhdrs/pthread13.c,
	psxhdrs/pthread14.c, psxhdrs/pthread15.c, psxhdrs/pthread16.c,
	psxhdrs/pthread17.c, psxhdrs/pthread18.c, psxhdrs/pthread19.c,
	psxhdrs/pthread20.c, psxhdrs/pthread21.c, psxhdrs/pthread22.c,
	psxhdrs/pthread23.c, psxhdrs/pthread24.c, psxhdrs/pthread25.c,
	psxhdrs/pthread26.c, psxhdrs/pthread27.c, psxhdrs/pthread28.c,
	psxhdrs/pthread29.c, psxhdrs/pthread30.c, psxhdrs/pthread34.c,
	psxhdrs/pthread35.c, psxhdrs/pthread36.c, psxhdrs/pthread37.c,
	psxhdrs/pthread38.c, psxhdrs/pthread39.c, psxhdrs/pthread40.c:
	Let test() return values (avoid warnings).
This commit is contained in:
Ralf Corsepius
2011-10-17 11:39:04 +00:00
parent 9620b6189f
commit 6e9634614b
37 changed files with 160 additions and 72 deletions

View File

@@ -1,3 +1,19 @@
2011-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* psxhdrs/pthread01.c, psxhdrs/pthread02.c, psxhdrs/pthread03.c,
psxhdrs/pthread04.c, psxhdrs/pthread05.c, psxhdrs/pthread06.c,
psxhdrs/pthread07.c, psxhdrs/pthread09.c, psxhdrs/pthread10.c,
psxhdrs/pthread11.c, psxhdrs/pthread12.c, psxhdrs/pthread13.c,
psxhdrs/pthread14.c, psxhdrs/pthread15.c, psxhdrs/pthread16.c,
psxhdrs/pthread17.c, psxhdrs/pthread18.c, psxhdrs/pthread19.c,
psxhdrs/pthread20.c, psxhdrs/pthread21.c, psxhdrs/pthread22.c,
psxhdrs/pthread23.c, psxhdrs/pthread24.c, psxhdrs/pthread25.c,
psxhdrs/pthread26.c, psxhdrs/pthread27.c, psxhdrs/pthread28.c,
psxhdrs/pthread29.c, psxhdrs/pthread30.c, psxhdrs/pthread34.c,
psxhdrs/pthread35.c, psxhdrs/pthread36.c, psxhdrs/pthread37.c,
psxhdrs/pthread38.c, psxhdrs/pthread39.c, psxhdrs/pthread40.c:
Let test() return values (avoid warnings).
2011-10-17 Ralf Corsépius <ralf.corsepius@rtems.org> 2011-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* psxhdrs/cond01.c, psxhdrs/cond02.c, psxhdrs/cond03.c, * psxhdrs/cond01.c, psxhdrs/cond02.c, psxhdrs/cond03.c,

View File

@@ -22,12 +22,14 @@
#error "rtems is supposed to have pthread_attr_init" #error "rtems is supposed to have pthread_attr_init"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
int result; int result;
result = pthread_attr_init( &attribute ); result = pthread_attr_init( &attribute );
return result;
} }

View File

@@ -22,12 +22,14 @@
#error "rtems is supposed to have pthread_attr_destroy" #error "rtems is supposed to have pthread_attr_destroy"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
int result; int result;
result = pthread_attr_destroy( &attribute ); result = pthread_attr_destroy( &attribute );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "rtems is supposed to have pthread_attr_setdetachstate" #error "rtems is supposed to have pthread_attr_setdetachstate"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
int state; int state;
@@ -34,4 +34,6 @@ void test( void )
state = PTHREAD_CREATE_JOINABLE; state = PTHREAD_CREATE_JOINABLE;
result = pthread_attr_setdetachstate( &attribute, state ); result = pthread_attr_setdetachstate( &attribute, state );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "rtems is supposed to have pthread_attr_getdetachstate" #error "rtems is supposed to have pthread_attr_getdetachstate"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
int state; int state;
int result; int result;
result = pthread_attr_getdetachstate( &attribute, &state ); result = pthread_attr_getdetachstate( &attribute, &state );
return result;
} }

View File

@@ -27,9 +27,9 @@
#error "rtems is supposed to have pthread_setstacksize" #error "rtems is supposed to have pthread_setstacksize"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
size_t size; size_t size;
@@ -38,4 +38,6 @@ void test( void )
size = PTHREAD_STACK_MIN; size = PTHREAD_STACK_MIN;
result = pthread_attr_setstacksize( &attribute, size ); result = pthread_attr_setstacksize( &attribute, size );
return result;
} }

View File

@@ -26,13 +26,15 @@
#error "rtems is supposed to have pthread_getstacksize" #error "rtems is supposed to have pthread_getstacksize"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
size_t size; size_t size;
int result; int result;
result = pthread_attr_getstacksize( &attribute, &size ); result = pthread_attr_getstacksize( &attribute, &size );
return result;
} }

View File

@@ -22,7 +22,7 @@
#error "rtems is supposed to have pthread_create" #error "rtems is supposed to have pthread_create"
#endif #endif
void test( void ); int test( void );
void *test_task( void * arg ); void *test_task( void * arg );
void *test_task( void *test_task(
@@ -34,7 +34,7 @@ void *test_task(
return NULL; return NULL;
} }
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
pthread_attr_t attribute; pthread_attr_t attribute;
@@ -42,4 +42,6 @@ void test( void )
int result; int result;
result = pthread_create( &thread, &attribute, test_task, arg ); result = pthread_create( &thread, &attribute, test_task, arg );
return result;
} }

View File

@@ -22,11 +22,13 @@
#error "rtems is supposed to have pthread_self" #error "rtems is supposed to have pthread_self"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t self; pthread_t self;
self = pthread_self(); self = pthread_self();
return ( self != 0 );
} }

View File

@@ -22,13 +22,15 @@
#error "rtems is supposed to have pthread_equal" #error "rtems is supposed to have pthread_equal"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t id_1 = 0; pthread_t id_1 = 0;
pthread_t id_2 = 0; pthread_t id_2 = 0;
int result; int result;
result = pthread_equal( id_1, id_2 ); result = pthread_equal( id_1, id_2 );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_setschedparam" #error "RTEMS is supposed to have pthread_setschedparam"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
int policy; int policy;
@@ -54,4 +54,6 @@ void test( void )
#endif #endif
result = pthread_setschedparam( thread, policy, &param ); result = pthread_setschedparam( thread, policy, &param );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_getschedparam" #error "RTEMS is supposed to have pthread_getschedparam"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
int policy; int policy;
@@ -34,4 +34,6 @@ void test( void )
thread = 0; thread = 0;
result = pthread_getschedparam( thread, &policy, &param ); result = pthread_getschedparam( thread, &policy, &param );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_attr_setscope" #error "RTEMS is supposed to have pthread_attr_setscope"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int contentionscope; int contentionscope;
@@ -34,4 +34,6 @@ void test( void )
contentionscope = PTHREAD_SCOPE_PROCESS; contentionscope = PTHREAD_SCOPE_PROCESS;
result = pthread_attr_setscope( &attr, contentionscope ); result = pthread_attr_setscope( &attr, contentionscope );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "RTEMS is supposed to have pthread_attr_getscope" #error "RTEMS is supposed to have pthread_attr_getscope"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int contentionscope; int contentionscope;
int result; int result;
result = pthread_attr_getscope( &attr, &contentionscope ); result = pthread_attr_getscope( &attr, &contentionscope );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_attr_setinheritsched" #error "RTEMS is supposed to have pthread_attr_setinheritsched"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int inheritsched; int inheritsched;
@@ -34,4 +34,6 @@ void test( void )
inheritsched = PTHREAD_EXPLICIT_SCHED; inheritsched = PTHREAD_EXPLICIT_SCHED;
result = pthread_attr_setinheritsched( &attr, inheritsched ); result = pthread_attr_setinheritsched( &attr, inheritsched );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "RTEMS is supposed to have pthread_attr_getinheritsched" #error "RTEMS is supposed to have pthread_attr_getinheritsched"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int inheritsched; int inheritsched;
int result; int result;
result = pthread_attr_getinheritsched( &attr, &inheritsched ); result = pthread_attr_getinheritsched( &attr, &inheritsched );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_attr_setschedpolicy" #error "RTEMS is supposed to have pthread_attr_setschedpolicy"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int policy; int policy;
@@ -38,4 +38,6 @@ void test( void )
#endif #endif
result = pthread_attr_setschedpolicy( &attr, policy ); result = pthread_attr_setschedpolicy( &attr, policy );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "RTEMS is supposed to have pthread_attr_getschedpolicy" #error "RTEMS is supposed to have pthread_attr_getschedpolicy"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int policy; int policy;
int result; int result;
result = pthread_attr_getschedpolicy( &attr, &policy ); result = pthread_attr_getschedpolicy( &attr, &policy );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "RTEMS is supposed to have pthread_attr_setschedparam" #error "RTEMS is supposed to have pthread_attr_setschedparam"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
struct sched_param param; struct sched_param param;
int result; int result;
result = pthread_attr_setschedparam( &attr, &param ); result = pthread_attr_setschedparam( &attr, &param );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "RTEMS is supposed to have pthread_attr_getschedparam" #error "RTEMS is supposed to have pthread_attr_getschedparam"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
struct sched_param param; struct sched_param param;
int result; int result;
result = pthread_attr_getschedparam( &attr, &param ); result = pthread_attr_getschedparam( &attr, &param );
return result;
} }

View File

@@ -22,13 +22,15 @@
#error "rtems is supposed to have pthread_detach" #error "rtems is supposed to have pthread_detach"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
int result; int result;
thread = 0; thread = 0;
result = pthread_detach( thread ); result = pthread_detach( thread );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_setschedparam" #error "RTEMS is supposed to have pthread_setschedparam"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread = 0; pthread_t thread = 0;
int policy; int policy;
@@ -52,4 +52,6 @@ void test( void )
#endif #endif
result = pthread_setschedparam( thread, policy, &param ); result = pthread_setschedparam( thread, policy, &param );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "RTEMS is supposed to have pthread_getschedparam" #error "RTEMS is supposed to have pthread_getschedparam"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread = 0; pthread_t thread = 0;
int policy; int policy;
@@ -32,4 +32,6 @@ void test( void )
int result; int result;
result = pthread_getschedparam( thread, &policy, &param ); result = pthread_getschedparam( thread, &policy, &param );
return result;
} }

View File

@@ -27,9 +27,9 @@
#error "rtems is supposed to have pthread_setstackaddr" #error "rtems is supposed to have pthread_setstackaddr"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
void *stackaddr; void *stackaddr;
@@ -38,4 +38,6 @@ void test( void )
stackaddr = NULL; stackaddr = NULL;
result = pthread_attr_setstackaddr( &attribute, stackaddr ); result = pthread_attr_setstackaddr( &attribute, stackaddr );
return result;
} }

View File

@@ -27,13 +27,15 @@
#error "rtems is supposed to have pthread_getstackaddr" #error "rtems is supposed to have pthread_getstackaddr"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
void *stackaddr; void *stackaddr;
int result; int result;
result = pthread_attr_getstackaddr( &attribute, &stackaddr ); result = pthread_attr_getstackaddr( &attribute, &stackaddr );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "rtems is supposed to have pthread_join" #error "rtems is supposed to have pthread_join"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
void *value_ptr; void *value_ptr;
@@ -33,4 +33,6 @@ void test( void )
thread = 0; thread = 0;
result = pthread_join( thread, &value_ptr ); result = pthread_join( thread, &value_ptr );
return result;
} }

View File

@@ -22,17 +22,19 @@
#error "rtems is supposed to have pthread_once" #error "rtems is supposed to have pthread_once"
#endif #endif
void test( void ); int test( void );
void init_routine( void ); void init_routine( void );
void init_routine( void ) void init_routine( void )
{ {
} }
void test( void ) int test( void )
{ {
pthread_once_t once_control = PTHREAD_ONCE_INIT; pthread_once_t once_control = PTHREAD_ONCE_INIT;
int result; int result;
result = pthread_once( &once_control, init_routine ); result = pthread_once( &once_control, init_routine );
return result;
} }

View File

@@ -22,18 +22,20 @@
#error "rtems is supposed to have pthread_cancel" #error "rtems is supposed to have pthread_cancel"
#endif #endif
void test( void ); int test( void );
void init_routine( void ); void init_routine( void );
void init_routine( void ) void init_routine( void )
{ {
} }
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
int result; int result;
thread = 0; thread = 0;
result = pthread_cancel( thread ); result = pthread_cancel( thread );
return result;
} }

View File

@@ -22,14 +22,14 @@
#error "rtems is supposed to have pthread_setcancelstate" #error "rtems is supposed to have pthread_setcancelstate"
#endif #endif
void test( void ); int test( void );
void init_routine( void ); void init_routine( void );
void init_routine( void ) void init_routine( void )
{ {
} }
void test( void ) int test( void )
{ {
int state; int state;
int oldstate; int oldstate;
@@ -39,4 +39,6 @@ void test( void )
state = PTHREAD_CANCEL_DISABLE; state = PTHREAD_CANCEL_DISABLE;
result = pthread_setcancelstate( state, &oldstate ); result = pthread_setcancelstate( state, &oldstate );
return result;
} }

View File

@@ -22,14 +22,14 @@
#error "rtems is supposed to have pthread_setcanceltype" #error "rtems is supposed to have pthread_setcanceltype"
#endif #endif
void test( void ); int test( void );
void init_routine( void ); void init_routine( void );
void init_routine( void ) void init_routine( void )
{ {
} }
void test( void ) int test( void )
{ {
int type; int type;
int oldtype; int oldtype;
@@ -39,4 +39,6 @@ void test( void )
type = PTHREAD_CANCEL_ASYNCHRONOUS; type = PTHREAD_CANCEL_ASYNCHRONOUS;
result = pthread_setcanceltype( type, &oldtype ); result = pthread_setcanceltype( type, &oldtype );
return result;
} }

View File

@@ -22,9 +22,9 @@
#error "rtems is supposed to have pthread_getcpuclockid" #error "rtems is supposed to have pthread_getcpuclockid"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_t thread; pthread_t thread;
clockid_t clock_id; clockid_t clock_id;
@@ -33,4 +33,6 @@ void test( void )
thread = 0; thread = 0;
result = pthread_getcpuclockid( thread, &clock_id ); result = pthread_getcpuclockid( thread, &clock_id );
return result;
} }

View File

@@ -28,9 +28,9 @@ extern int pthread_attr_setcputime(
#error "rtems is supposed to have pthread_attr_setcputime" #error "rtems is supposed to have pthread_attr_setcputime"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int clock_allowed; int clock_allowed;
@@ -40,4 +40,6 @@ void test( void )
clock_allowed = CLOCK_DISALLOWED; clock_allowed = CLOCK_DISALLOWED;
result = pthread_attr_setcputime( &attr, clock_allowed ); result = pthread_attr_setcputime( &attr, clock_allowed );
return result;
} }

View File

@@ -28,13 +28,15 @@ extern int pthread_attr_getcputime(
#error "rtems is supposed to have pthread_attr_getcputime" #error "rtems is supposed to have pthread_attr_getcputime"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attr; pthread_attr_t attr;
int clock_allowed; int clock_allowed;
int result; int result;
result = pthread_attr_getcputime( &attr, &clock_allowed ); result = pthread_attr_getcputime( &attr, &clock_allowed );
return result;
} }

View File

@@ -28,9 +28,9 @@
#error "rtems is supposed to have pthread_setstackaddr" #error "rtems is supposed to have pthread_setstackaddr"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
void *stackaddr; void *stackaddr;
@@ -41,5 +41,7 @@ void test( void )
stacksize = 1024; stacksize = 1024;
result = pthread_attr_setstack( &attribute, stackaddr, stacksize ); result = pthread_attr_setstack( &attribute, stackaddr, stacksize );
return result;
} }
#endif #endif

View File

@@ -28,9 +28,9 @@
#error "rtems is supposed to have pthread_getstackaddr" #error "rtems is supposed to have pthread_getstackaddr"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
void *stackaddr; void *stackaddr;
@@ -38,5 +38,7 @@ void test( void )
int result; int result;
result = pthread_attr_getstack( &attribute, &stackaddr, &stacksize ); result = pthread_attr_getstack( &attribute, &stackaddr, &stacksize );
return result;
} }
#endif #endif

View File

@@ -24,9 +24,9 @@
#error "rtems is supposed to have pthread_setstacksize" #error "rtems is supposed to have pthread_setstacksize"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
size_t size; size_t size;
@@ -35,5 +35,7 @@ void test( void )
size = PTHREAD_STACK_MIN; size = PTHREAD_STACK_MIN;
result = pthread_attr_setguardsize( &attribute, size ); result = pthread_attr_setguardsize( &attribute, size );
return result;
} }
#endif #endif

View File

@@ -23,14 +23,16 @@
#error "rtems is supposed to have pthread_getstacksize" #error "rtems is supposed to have pthread_getstacksize"
#endif #endif
void test( void ); int test( void );
void test( void ) int test( void )
{ {
pthread_attr_t attribute; pthread_attr_t attribute;
size_t size; size_t size;
int result; int result;
result = pthread_attr_getguardsize( &attribute, &size ); result = pthread_attr_getguardsize( &attribute, &size );
return result;
} }
#endif #endif