From 48051a71ce6a6c8976267bf95f2b6521cd09fb65 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Mon, 17 Mar 2003 01:03:43 +0000 Subject: Get rid of some warnings * mingwex/dirent.c (_topendir): Eliminate signed/unsigned warning. * mingwex/strtoimax.c (strtoimax): Likewise. * mingwex/wcstoimax.c (wcstoimax): Likewise. * mingwex/wtoll.c (wtoll): Remove unnecessary ';' * mingwex/fesentenv.c: Include float.h. * mingwex/math/powl.c: Eliminate type punning/strict aliasing warning. * mingwex/math/tanhl.c: Eliminate signed/unsigned warning in constants. * mingwex/math/tgammal.c: Likewise. --- winsup/mingw/ChangeLog | 13 +++++++++++++ winsup/mingw/mingwex/dirent.c | 2 +- winsup/mingw/mingwex/fesetenv.c | 1 + winsup/mingw/mingwex/math/powl.c | 13 +++++++++++-- winsup/mingw/mingwex/math/tanhl.c | 4 ++-- winsup/mingw/mingwex/math/tgammal.c | 6 +++--- winsup/mingw/mingwex/strtoimax.c | 2 +- winsup/mingw/mingwex/wcstoimax.c | 2 +- winsup/mingw/mingwex/wtoll.c | 2 +- 9 files changed, 34 insertions(+), 11 deletions(-) (limited to 'winsup') diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index bd4f66366..69a48f94a 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,16 @@ +2003-03-16 Danny Smith + + * mingwex/dirent.c (_topendir): Eliminate signed/unsigned warning. + * mingwex/strtoimax.c (strtoimax): Likewise. + * mingwex/wcstoimax.c (wcstoimax): Likewise. + * mingwex/wtoll.c (wtoll): Remove unnecessary ';' + * mingwex/fesentenv.c: Include float.h. + * mingwex/math/powl.c: Eliminate type punning/strict aliasing + warning. + * mingwex/math/tanhl.c: Eliminate signed/unsigned warning in + constants. + * mingwex/math/tgammal.c: Likewise. + 2003-03-16 Danny Smith * include/utime.h: New file, forwarding to sys/utime.h. diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c index 91c170619..cdca6de35 100644 --- a/winsup/mingw/mingwex/dirent.c +++ b/winsup/mingw/mingwex/dirent.c @@ -58,7 +58,7 @@ _topendir (const _TCHAR *szPath) /* Attempt to determine if the given path really is a directory. */ rc = GetFileAttributes (szPath); - if (rc == -1) + if (rc == (unsigned int)-1) { /* call GetLastError for more error info */ errno = ENOENT; diff --git a/winsup/mingw/mingwex/fesetenv.c b/winsup/mingw/mingwex/fesetenv.c index b3d5c5f05..1e8090cc3 100644 --- a/winsup/mingw/mingwex/fesetenv.c +++ b/winsup/mingw/mingwex/fesetenv.c @@ -1,4 +1,5 @@ #include +#include /* 7.6.4.3 The fesetenv function establishes the floating-point environment diff --git a/winsup/mingw/mingwex/math/powl.c b/winsup/mingw/mingwex/math/powl.c index f066eeaee..2a09ae1e0 100644 --- a/winsup/mingw/mingwex/math/powl.c +++ b/winsup/mingw/mingwex/math/powl.c @@ -269,8 +269,17 @@ static const unsigned short R[] = { #else #define MNEXP (-NXT*16384.0L) #endif -static const unsigned short L[] = {0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}; -#define LOG2EA (*(long double *)(&L[0])) +static const +union +{ + unsigned short L[6]; + long double ld; +} log2ea = {{0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}}; + +#define LOG2EA (log2ea.ld) +/* +#define LOG2EA 0.44269504088896340735992L +*/ #endif #ifdef MIEEE diff --git a/winsup/mingw/mingwex/math/tanhl.c b/winsup/mingw/mingwex/math/tanhl.c index 3727b3990..d5d86d0ae 100644 --- a/winsup/mingw/mingwex/math/tanhl.c +++ b/winsup/mingw/mingwex/math/tanhl.c @@ -68,13 +68,13 @@ static long double Q[] = { #endif #ifdef IBMPC -static short P[] = { +static unsigned short P[] = { 0xd2a4,0x1b0c,0x8f15,0x8f99,0xbff1, XPD 0x5959,0x9111,0x9cc7,0xf4e2,0xbffe, XPD 0xb576,0xef5e,0x6d57,0xa81b,0xc005, XPD 0xe3be,0xbfbd,0x5cbc,0xa381,0xc009, XPD }; -static short Q[] = { +static unsigned short Q[] = { /*0x0000,0x0000,0x0000,0x8000,0x3fff,*/ 0x687f,0xce24,0xdd6c,0xc084,0x4005, XPD 0x3793,0xc95f,0xfa2f,0xe3b9,0x4009, XPD diff --git a/winsup/mingw/mingwex/math/tgammal.c b/winsup/mingw/mingwex/math/tgammal.c index 682a12e8e..f3fcdd6d5 100644 --- a/winsup/mingw/mingwex/math/tgammal.c +++ b/winsup/mingw/mingwex/math/tgammal.c @@ -88,7 +88,7 @@ static const long double Q[9] = { }; #endif #if IBMPC -static const short P[] = { +static const unsigned short P[] = { 0x434a,0x3f22,0x2bda,0xb0b2,0x3ff0, XPD 0xf5aa,0xe82f,0x335b,0xee2e,0x3ff3, XPD 0xbe6c,0x3757,0xc717,0x861b,0x3ff7, XPD @@ -98,7 +98,7 @@ static const short P[] = { 0x29cf,0x19b3,0x16c8,0xd67a,0x3ffe, XPD 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD }; -static const short Q[] = { +static const unsigned short Q[] = { 0x5473,0x2de8,0x1268,0xea67,0xbfee, XPD 0x334b,0xc2f0,0xa2dd,0xf60e,0x3ff2, XPD 0xbeed,0x1853,0xa691,0xa23d,0xbff5, XPD @@ -182,7 +182,7 @@ static const long double STIR[9] = { }; #endif #if IBMPC -static const short STIR[] = { +static const unsigned short STIR[] = { 0x6ede,0x69f7,0x54e3,0xbb5d,0x3ff4, XPD 0xc395,0x0295,0x4443,0xc64b,0xbfef, XPD 0xba6f,0x7c59,0x5e47,0x9bfb,0xbff4, XPD diff --git a/winsup/mingw/mingwex/strtoimax.c b/winsup/mingw/mingwex/strtoimax.c index 0cf2c01ed..9072d4bbb 100644 --- a/winsup/mingw/mingwex/strtoimax.c +++ b/winsup/mingw/mingwex/strtoimax.c @@ -82,7 +82,7 @@ strtoimax(nptr, endptr, base) accum = n; for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > INTMAX_MAX / base + 2 ) /* major wrap-around */ + if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */ toobig = 1; /* but keep scanning */ else accum = base * accum + n; diff --git a/winsup/mingw/mingwex/wcstoimax.c b/winsup/mingw/mingwex/wcstoimax.c index 4b82b14a2..99bacf463 100644 --- a/winsup/mingw/mingwex/wcstoimax.c +++ b/winsup/mingw/mingwex/wcstoimax.c @@ -89,7 +89,7 @@ wcstoimax(nptr, endptr, base) accum = n; for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > INTMAX_MAX / base + 2 ) /* major wrap-around */ + if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */ toobig = 1; /* but keep scanning */ else accum = base * accum + n; diff --git a/winsup/mingw/mingwex/wtoll.c b/winsup/mingw/mingwex/wtoll.c index 48f856245..0bff278d1 100644 --- a/winsup/mingw/mingwex/wtoll.c +++ b/winsup/mingw/mingwex/wtoll.c @@ -1,3 +1,3 @@ #include long long wtoll(const wchar_t * _w) - { return _wtoi64 (_w); }; + { return _wtoi64 (_w); } -- cgit v1.2.3