Index: include/ChangeLog

2003-09-15  Andrew Cagney  <cagney@redhat.com>

	* floatformat.h (floatformat_to_double): Make input buffer constant.
	(floatformat_from_double, floatformat_is_valid): Ditto.

Index: libiberty/ChangeLog
2003-09-15  Andrew Cagney  <cagney@redhat.com>

	* floatformat.c (get_field): Make "data" constant.
	(floatformat_is_valid, floatformat_to_double): Make "from"
	constant, fix casts.
	(floatformat_from_double): Make "from" constant.

From-SVN: r71422
This commit is contained in:
Andrew Cagney 2003-09-16 01:51:07 +00:00 committed by Andrew Cagney
parent 602a82f3cf
commit c9fbef12be
4 changed files with 22 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2003-09-15 Andrew Cagney <cagney@redhat.com>
* floatformat.h (floatformat_to_double): Make input buffer constant.
(floatformat_from_double, floatformat_is_valid): Ditto.
2003-09-15 Andrew Cagney <cagney@redhat.com> 2003-09-15 Andrew Cagney <cagney@redhat.com>
* floatformat.h (struct floatformat): Make "exp_bias" signed. * floatformat.h (struct floatformat): Make "exp_bias" signed.

View File

@ -113,18 +113,18 @@ extern const struct floatformat floatformat_ia64_quad_little;
Store the double in *TO. */ Store the double in *TO. */
extern void extern void
floatformat_to_double PARAMS ((const struct floatformat *, char *, double *)); floatformat_to_double PARAMS ((const struct floatformat *, const char *, double *));
/* The converse: convert the double *FROM to FMT /* The converse: convert the double *FROM to FMT
and store where TO points. */ and store where TO points. */
extern void extern void
floatformat_from_double PARAMS ((const struct floatformat *, floatformat_from_double PARAMS ((const struct floatformat *,
double *, char *)); const double *, char *));
/* Return non-zero iff the data at FROM is a valid number in format FMT. */ /* Return non-zero iff the data at FROM is a valid number in format FMT. */
extern int extern int
floatformat_is_valid PARAMS ((const struct floatformat *fmt, char *from)); floatformat_is_valid PARAMS ((const struct floatformat *fmt, const char *from));
#endif /* defined (FLOATFORMAT_H) */ #endif /* defined (FLOATFORMAT_H) */

View File

@ -1,3 +1,10 @@
2003-09-15 Andrew Cagney <cagney@redhat.com>
* floatformat.c (get_field): Make "data" constant.
(floatformat_is_valid, floatformat_to_double): Make "from"
constant, fix casts.
(floatformat_from_double): Make "from" constant.
2003-09-15 Daniel Jacobowitz <drow@mvista.com> 2003-09-15 Daniel Jacobowitz <drow@mvista.com>
* floatformat.c (floatformat_is_valid): New function. * floatformat.c (floatformat_is_valid): New function.

View File

@ -143,7 +143,7 @@ const struct floatformat floatformat_ia64_quad_little =
"floatformat_ia64_quad_little" "floatformat_ia64_quad_little"
}; };
static unsigned long get_field PARAMS ((unsigned char *, static unsigned long get_field PARAMS ((const unsigned char *,
enum floatformat_byteorders, enum floatformat_byteorders,
unsigned int, unsigned int,
unsigned int, unsigned int,
@ -153,7 +153,7 @@ static unsigned long get_field PARAMS ((unsigned char *,
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 (data, order, total_len, start, len) get_field (data, order, total_len, start, len)
unsigned char *data; const unsigned char *data;
enum floatformat_byteorders order; enum floatformat_byteorders order;
unsigned int total_len; unsigned int total_len;
unsigned int start; unsigned int start;
@ -207,10 +207,10 @@ get_field (data, order, total_len, start, len)
void void
floatformat_to_double (fmt, from, to) floatformat_to_double (fmt, from, to)
const struct floatformat *fmt; const struct floatformat *fmt;
char *from; const char *from;
double *to; double *to;
{ {
unsigned char *ufrom = (unsigned char *)from; const unsigned char *ufrom = (const unsigned char *)from;
double dto; double dto;
long exponent; long exponent;
unsigned long mant; unsigned long mant;
@ -331,7 +331,7 @@ put_field (data, order, total_len, start, len, stuff_to_put)
void void
floatformat_from_double (fmt, from, to) floatformat_from_double (fmt, from, to)
const struct floatformat *fmt; const struct floatformat *fmt;
double *from; const double *from;
char *to; char *to;
{ {
double dfrom; double dfrom;
@ -409,7 +409,7 @@ floatformat_from_double (fmt, from, to)
int int
floatformat_is_valid (fmt, from) floatformat_is_valid (fmt, from)
const struct floatformat *fmt; const struct floatformat *fmt;
char *from; const char *from;
{ {
if (fmt == &floatformat_i387_ext) if (fmt == &floatformat_i387_ext)
{ {
@ -419,7 +419,7 @@ floatformat_is_valid (fmt, from)
if the exponent is zero can it be zero, and then it must if the exponent is zero can it be zero, and then it must
be zero. */ be zero. */
unsigned long exponent, int_bit; unsigned long exponent, int_bit;
unsigned char *ufrom = (unsigned char *) from; const unsigned char *ufrom = (const unsigned char *) from;
exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize, exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
fmt->exp_start, fmt->exp_len); fmt->exp_start, fmt->exp_len);