Fix strict aliasing warnings.

git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@760 4407c894-4637-0410-b4f5-ada5f102cad1
This commit is contained in:
Kai Tietz 2009-04-13 13:40:05 +00:00
parent fb2ed105b9
commit e0878a7012

View File

@ -51,19 +51,24 @@ THIS SOFTWARE.
#define _4 0
#endif
typedef union lD {
UShort L[5];
long double D;
} lD;
static int
#ifdef KR_headers
__strtopx(s, sp, V) CONST char *s; char **sp; long double *V;
__strtopx(s, sp, V) CONST char *s; char **sp; lD *V;
#else
__strtopx(CONST char *s, char **sp, long double *V)
__strtopx(CONST char *s, char **sp, lD *V)
#endif
{
static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
ULong bits[2];
Long exp;
int k;
UShort *L = (UShort*)V;
*V=0.0L;
UShort *L = & (V->L[0]);
V->D=0.0L;
k = __strtodg(s, sp, &fpi, &exp, bits);
switch(k & STRTOG_Retmask) {
@ -108,9 +113,10 @@ long double
__cdecl
__strtold (const char * __restrict__ src, char ** __restrict__ endptr)
{
long double ret = 0.0;
__strtopx(src, endptr, &ret);
return ret;
lD ret;
ret.D = 0.0L;
__strtopx(src, endptr, &ret);
return ret.D;
}
long double