aboutsummaryrefslogtreecommitdiff
path: root/gdb/doublest.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-07-29 19:33:22 +0000
committerAndrew Cagney <cagney@redhat.com>2004-07-29 19:33:22 +0000
commitc35f4ffcade07bba900aa312c2d0c2242113c5d4 (patch)
treee390333b017573517e5a1a7e3fcb2700c655831b /gdb/doublest.c
parent624a44a3c41144731bebbdbe1c3994ed868951e3 (diff)
downloadgdb-c35f4ffcade07bba900aa312c2d0c2242113c5d4.zip
gdb-c35f4ffcade07bba900aa312c2d0c2242113c5d4.tar.gz
gdb-c35f4ffcade07bba900aa312c2d0c2242113c5d4.tar.bz2
2004-07-29 Andrew Cagney <cagney@gnu.org>
* config/pa/xm-linux.h: Do not include "floatformat.h". (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) (HOST_LONG_DOUBLE_FORMAT): Delete macros. * config/i386/xm-i386.h: Do not include "floatformat.h". (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) (HOST_LONG_DOUBLE_FORMAT): Delete macros. * doublest.c (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) (HOST_LONG_DOUBLE_FORMAT): Delete macros. Use GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT and GDB_HOST_LONG_DOUBLE_FORMAT instead. * configure.in (GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT) (GDB_HOST_LONG_DOUBLE_FORMAT): Define. * configure, config.in: Regenerate. * configure.host (gdb_host_float_format, gdb_host_double_format) (gdb_host_long_double_format): Set according to the host.
Diffstat (limited to 'gdb/doublest.c')
-rw-r--r--gdb/doublest.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/gdb/doublest.c b/gdb/doublest.c
index 3f283e1..10f4dfb 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -91,10 +91,17 @@ get_field (unsigned char *data, enum floatformat_byteorders order,
{
result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
cur_bitshift += FLOATFORMAT_CHAR_BIT;
- if (order == floatformat_little || order == floatformat_littlebyte_bigword)
- ++cur_byte;
- else
- --cur_byte;
+ switch (order)
+ {
+ case floatformat_little:
+ ++cur_byte;
+ break;
+ case floatformat_big:
+ --cur_byte;
+ break;
+ case floatformat_littlebyte_bigword:
+ break;
+ }
}
if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
/* Mask out bits which are not part of the field */
@@ -554,19 +561,9 @@ floatformat_mantissa (const struct floatformat *fmt, char *val)
increase precision as necessary. Otherwise, we call the conversion
routine and let it do the dirty work. */
-#ifndef HOST_FLOAT_FORMAT
-#define HOST_FLOAT_FORMAT 0
-#endif
-#ifndef HOST_DOUBLE_FORMAT
-#define HOST_DOUBLE_FORMAT 0
-#endif
-#ifndef HOST_LONG_DOUBLE_FORMAT
-#define HOST_LONG_DOUBLE_FORMAT 0
-#endif
-
-static const struct floatformat *host_float_format = HOST_FLOAT_FORMAT;
-static const struct floatformat *host_double_format = HOST_DOUBLE_FORMAT;
-static const struct floatformat *host_long_double_format = HOST_LONG_DOUBLE_FORMAT;
+static const struct floatformat *host_float_format = GDB_HOST_FLOAT_FORMAT;
+static const struct floatformat *host_double_format = GDB_HOST_DOUBLE_FORMAT;
+static const struct floatformat *host_long_double_format = GDB_HOST_LONG_DOUBLE_FORMAT;
void
floatformat_to_doublest (const struct floatformat *fmt,