From e517fe682a55aa9dbd98057b621ab46012861d85 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 5 Dec 2018 11:58:59 -0600 Subject: [PATCH] psxhdrs: Fix warnings --- testsuites/psxtests/psxhdrs/dlfcn/dlerror.c | 7 ++-- .../psxtests/psxhdrs/strings/strcasecmp_l.c | 32 +++++++++++-------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c b/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c index 4ba13da61d..7393761de4 100644 --- a/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c +++ b/testsuites/psxtests/psxhdrs/dlfcn/dlerror.c @@ -26,14 +26,11 @@ int test( void ); - int result = 1; - int test( void ) { - char *errstr; + const char *errstr; errstr = dlerror(); - result = 0; - return result; + return (errstr != NULL); } diff --git a/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c b/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c index cdcdff7de2..b1a4c8dcf3 100644 --- a/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c +++ b/testsuites/psxtests/psxhdrs/strings/strcasecmp_l.c @@ -2,6 +2,7 @@ * @file * @brief strcasecmp_l() API Conformance Test */ + /* * COPYRIGHT (c) 2018. * Himanshu Sekhar Nayak @@ -18,22 +19,25 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - #ifdef HAVE_CONFIG_H - #include "config.h" - #endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif - #include - #include +#define _POSIX_C_SOURCE 200809L - int test( void ); +#include +#include - int test( void ) - { - char *string1 = "STRING"; - char *string2 = "string"; - int result; +int test( void ); - result = strcasecmp_l( string1, string2, LC_CTYPE ); +int test( void ) +{ + char *string1 = "STRING"; + char *string2 = "string"; + locale_t locale = NULL; + int result; - return result; - } + result = strcasecmp_l( string1, string2, locale ); + + return result; +}