2005-01-28 Andrew Cagney <cagney@gnu.org>
* doublest.c (floatformat_is_negative, floatformat_is_nan) (floatformat_mantissa, get_field): Make the buffer a const bfd_byte, simplify.
This commit is contained in:
parent
f6bcefefe8
commit
108d6ead32
3 changed files with 22 additions and 17 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-01-28 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
|
* doublest.c (floatformat_is_negative, floatformat_is_nan)
|
||||||
|
(floatformat_mantissa, get_field): Make the buffer a const
|
||||||
|
bfd_byte, simplify.
|
||||||
|
|
||||||
2005-01-27 Andrew Cagney <cagney@gnu.org>
|
2005-01-27 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
* value.h (struct value): Change type of contents to bfd_byte.
|
* value.h (struct value): Change type of contents to bfd_byte.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Floating point routines for GDB, the GNU debugger.
|
/* Floating point routines for GDB, the GNU debugger.
|
||||||
|
|
||||||
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||||
1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free Software
|
1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -44,14 +44,10 @@
|
||||||
can convert to doublest will need. */
|
can convert to doublest will need. */
|
||||||
#define FLOATFORMAT_LARGEST_BYTES 16
|
#define FLOATFORMAT_LARGEST_BYTES 16
|
||||||
|
|
||||||
static unsigned long get_field (unsigned char *,
|
|
||||||
enum floatformat_byteorders,
|
|
||||||
unsigned int, unsigned int, unsigned int);
|
|
||||||
|
|
||||||
/* Extract a field which starts at START and is LEN bytes long. DATA and
|
/* Extract a field which starts at START and is LEN bytes long. DATA and
|
||||||
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
|
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
|
||||||
static unsigned long
|
static unsigned long
|
||||||
get_field (unsigned char *data, enum floatformat_byteorders order,
|
get_field (const bfd_byte *data, enum floatformat_byteorders order,
|
||||||
unsigned int total_len, unsigned int start, unsigned int len)
|
unsigned int total_len, unsigned int start, unsigned int len)
|
||||||
{
|
{
|
||||||
unsigned long result;
|
unsigned long result;
|
||||||
|
@ -475,9 +471,9 @@ convert_doublest_to_floatformat (CONST struct floatformat *fmt,
|
||||||
format is described by FMT) is negative. */
|
format is described by FMT) is negative. */
|
||||||
|
|
||||||
int
|
int
|
||||||
floatformat_is_negative (const struct floatformat *fmt, char *val)
|
floatformat_is_negative (const struct floatformat *fmt,
|
||||||
|
const bfd_byte *uval)
|
||||||
{
|
{
|
||||||
unsigned char *uval = (unsigned char *) val;
|
|
||||||
enum floatformat_byteorders order;
|
enum floatformat_byteorders order;
|
||||||
unsigned char newfrom[FLOATFORMAT_LARGEST_BYTES];
|
unsigned char newfrom[FLOATFORMAT_LARGEST_BYTES];
|
||||||
|
|
||||||
|
@ -496,9 +492,9 @@ floatformat_is_negative (const struct floatformat *fmt, char *val)
|
||||||
/* Check if VAL is "not a number" (NaN) for FMT. */
|
/* Check if VAL is "not a number" (NaN) for FMT. */
|
||||||
|
|
||||||
int
|
int
|
||||||
floatformat_is_nan (const struct floatformat *fmt, char *val)
|
floatformat_is_nan (const struct floatformat *fmt,
|
||||||
|
const bfd_byte *uval)
|
||||||
{
|
{
|
||||||
unsigned char *uval = (unsigned char *) val;
|
|
||||||
long exponent;
|
long exponent;
|
||||||
unsigned long mant;
|
unsigned long mant;
|
||||||
unsigned int mant_bits, mant_off;
|
unsigned int mant_bits, mant_off;
|
||||||
|
@ -552,8 +548,9 @@ floatformat_is_nan (const struct floatformat *fmt, char *val)
|
||||||
point number whose format is described by FMT) into a hexadecimal
|
point number whose format is described by FMT) into a hexadecimal
|
||||||
and store it in a static string. Return a pointer to that string. */
|
and store it in a static string. Return a pointer to that string. */
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
floatformat_mantissa (const struct floatformat *fmt, char *val)
|
floatformat_mantissa (const struct floatformat *fmt,
|
||||||
|
const bfd_byte *val)
|
||||||
{
|
{
|
||||||
unsigned char *uval = (unsigned char *) val;
|
unsigned char *uval = (unsigned char *) val;
|
||||||
unsigned long mant;
|
unsigned long mant;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* Floating point definitions for GDB.
|
/* Floating point definitions for GDB.
|
||||||
|
|
||||||
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||||
1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation,
|
1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005 Free Software
|
||||||
Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
|
@ -59,9 +59,11 @@ extern void floatformat_to_doublest (const struct floatformat *,
|
||||||
extern void floatformat_from_doublest (const struct floatformat *,
|
extern void floatformat_from_doublest (const struct floatformat *,
|
||||||
const DOUBLEST *in, void *out);
|
const DOUBLEST *in, void *out);
|
||||||
|
|
||||||
extern int floatformat_is_negative (const struct floatformat *, char *);
|
extern int floatformat_is_negative (const struct floatformat *,
|
||||||
extern int floatformat_is_nan (const struct floatformat *, char *);
|
const bfd_byte *);
|
||||||
extern char *floatformat_mantissa (const struct floatformat *, char *);
|
extern int floatformat_is_nan (const struct floatformat *, const bfd_byte *);
|
||||||
|
extern const char *floatformat_mantissa (const struct floatformat *,
|
||||||
|
const bfd_byte *);
|
||||||
|
|
||||||
/* These functions have been replaced by extract_typed_floating and
|
/* These functions have been replaced by extract_typed_floating and
|
||||||
store_typed_floating.
|
store_typed_floating.
|
||||||
|
|
Loading…
Reference in a new issue