[rtems commit] psxhdrs: Fix warnings

Joel Sherrill joel at rtems.org
Tue Dec 4 22:56:09 UTC 2018


Module:    rtems
Branch:    master
Commit:    55719bab1391a80fbceceac474f66ac69eb87c65
Changeset: http://git.rtems.org/rtems/commit/?id=55719bab1391a80fbceceac474f66ac69eb87c65

Author:    Joel Sherrill <joel at rtems.org>
Date:      Tue Dec  4 16:55:53 2018 -0600

psxhdrs: Fix warnings

---

 testsuites/psxtests/psxhdrs/dlfcn/dlsym.c          | 32 ++++++++++------------
 testsuites/psxtests/psxhdrs/sys/time/getitimer.c   |  9 ++----
 .../psxtests/psxhdrs/sys/time/gettimeofday.c       | 11 +++-----
 testsuites/psxtests/psxhdrs/sys/time/setitimer.c   |  9 ++----
 4 files changed, 25 insertions(+), 36 deletions(-)

diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c b/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c
index 83b1049..c11a736 100644
--- a/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c
+++ b/testsuites/psxtests/psxhdrs/dlfcn/dlsym.c
@@ -2,7 +2,8 @@
  *  @file
  *  @brief dlsym() API Conformance Test
  */
- /*
+
+/*
  *  COPYRIGHT (c) 2018.
  *  Himanshu Sekhar Nayak
  *
@@ -18,24 +19,21 @@
  *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
-
- #include <dlfcn.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
- int test( void );
+#include <dlfcn.h>
 
- int result = 1;
+int test( void );
 
- int test( void )
- {
-   void *filename;
-   int *iptr;
+int test( void )
+{
+  void *filename;
+  int *iptr;
 
-   filename = dlopen( "mylib.so", RTLD_LOCAL | RTLD_LAZY );
-   iptr = dlsym( filename, "my_function" );
-   result = 0;
+  filename = dlopen( "mylib.so", RTLD_LOCAL | RTLD_LAZY );
+  iptr = dlsym( filename, "my_function" );
 
-   return result;
- }
+  return (iptr != NULL);
+}
diff --git a/testsuites/psxtests/psxhdrs/sys/time/getitimer.c b/testsuites/psxtests/psxhdrs/sys/time/getitimer.c
index aa1ce8b..16ef52e 100644
--- a/testsuites/psxtests/psxhdrs/sys/time/getitimer.c
+++ b/testsuites/psxtests/psxhdrs/sys/time/getitimer.c
@@ -29,13 +29,10 @@ int test(void);
 
 int test(void)
 {
-  int which,callback;
-  struct itimerval timeval;
-  it_interval interval = 0;
-  it_value value = 0;
+  int which = ITIMER_REAL;
+  int callback;
+  struct itimerval timeval = { {0,0}, {0,0} };
 
-  timeval.it_interval = interval;
-  timeval.it_value = value;
   callback = getitimer(which, &timeval);
   return (callback == 0);
 }
diff --git a/testsuites/psxtests/psxhdrs/sys/time/gettimeofday.c b/testsuites/psxtests/psxhdrs/sys/time/gettimeofday.c
index 60a56f3..f27436c 100644
--- a/testsuites/psxtests/psxhdrs/sys/time/gettimeofday.c
+++ b/testsuites/psxtests/psxhdrs/sys/time/gettimeofday.c
@@ -29,13 +29,10 @@ int test(void);
 
 int test(void)
 {
-  int which,callback;
-  struct itimerval timeval;
-  it_interval interval = 0;
-  it_value value = 0;
+  struct timeval tv;
+  struct timezone tz;
+  int callback;
 
-  timeval.it_interval = interval;
-  timeval.it_value = value;
-  callback = gettimeofday(&timeval);
+  callback = gettimeofday(&tv, &tz);
   return (callback == 0);
 }
diff --git a/testsuites/psxtests/psxhdrs/sys/time/setitimer.c b/testsuites/psxtests/psxhdrs/sys/time/setitimer.c
index 32fb4da..fc7588d 100644
--- a/testsuites/psxtests/psxhdrs/sys/time/setitimer.c
+++ b/testsuites/psxtests/psxhdrs/sys/time/setitimer.c
@@ -29,13 +29,10 @@ int test(void);
 
 int test(void)
 {
-  int which,callback;
-  struct itimerval timeval;
-  it_interval interval = 0;
-  it_value value = 0;
+  int which = ITIMER_REAL;
+  int callback;
+  struct itimerval timeval = { {0,0}, {0,0} };
 
-  timeval.it_interval = interval;
-  timeval.it_value = value;
   setitimer(which, &timeval, NULL);
   callback = getitimer(which, &timeval);
   return (callback == 0);



More information about the vc mailing list