audk/StdLib/LibC/gdtoa
Daryl McDaniel b04aba1773 StdLib: The formatting for double float values, within the gdtoa library, is improper.
When running Enquire.efi, several errors similar to the following are produced:
Maximum exponent = 128
Maximum number = 3.40282347e+38

*** WARNING: Possibly bad output from printf above
    expected value around 3.40282347e38, bit pattern:
    11111111 11111111 01111111 01111111
    sscanf gave           -inf, bit pattern:
    00000000 00000000 10000000 11111111
    difference= inf

Overflow doesn’t seem to generate a trap

The memory allocation tests will also fail, sometimes leaving all available memory consumed.

The correct output in the above example is:
Maximum exponent = 128
Maximum number = 3.40282347e+38
Overflow doesn't seem to generate a trap

The root cause is that all operations on values of Long or ULong type, within the gdtoa library, must be 32-bit operations.  A previous change replaced the Long and ULong definitions with INTN and UINTN, respectively.  While this is correct for a lot of Linux and NetBSD code, it was not correct for this library.

This fix reverts the definitions of ULong and Long back to 32-bit types.
A descriptive comment has also been added to the U union.
Additional white-space has been added to tidy up the definitions of the word0 and word1 macros.

Verified with Enquire.efi and the ISO/IEC C Library compliance Validation Suite.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15765 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-06 18:29:02 +00:00
..
Ipf Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
_strtof.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
_strtold.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
atof.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
dmisc.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
dtoa.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
gdtoa.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
gdtoa.h StdLib: The formatting for double float values, within the gdtoa library, is improper. 2014-08-06 18:29:02 +00:00
gdtoa.inf Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
gdtoaimp.h StdLib: The formatting for double float values, within the gdtoa library, is improper. 2014-08-06 18:29:02 +00:00
gethex.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
gmisc.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
hd_init.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
hexnan.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
ldtoa.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
misc.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
smisc.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
strtod.c EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Python Beta Release. 2012-03-24 01:19:06 +00:00
strtodg.c EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Python Beta Release. 2012-03-24 01:19:06 +00:00
strtof.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
strtold_px.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
strtold_subr.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
strtopx.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
sum.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00
ulp.c Standard Libraries for EDK II. 2011-04-27 21:42:16 +00:00