* [RFA] Rename decimal_to_double
@ 2008-01-16 14:17 Mark Kettenis
2008-01-16 16:00 ` Thiago Jung Bauermann
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2008-01-16 14:17 UTC (permalink / raw)
To: gdb-patches
This function conflicts with a system function on Solaris:
In file included from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/include/math.h:332,
from ../../../src/gdb/gdb/valarith.c:32:
/usr/include/floatingpoint.h:150: error: conflicting types for 'decimal_to_double'
./../../src/gdb/gdb/dfp.h:36: error: previous declaration of 'decimal_to_double' was here
/usr/include/floatingpoint.h:150: error: conflicting types for 'decimal_to_double'
./../../src/gdb/gdb/dfp.h:36: error: previous declaration of 'decimal_to_double' was here
The attached patch renames the function to decimal_to_doublest to avoid the collision.
ok?
2008-01-16 Mark Kettenis <kettenis@gnu.org>
* dfp.c, dfp.h: Rename decimal_to_double to decimal_to_doublest.
* value.c: All callers changed.
Index: dfp.c
===================================================================
RCS file: /cvs/src/src/gdb/dfp.c,v
retrieving revision 1.5
diff -u -p -r1.5 dfp.c
--- dfp.c 9 Jan 2008 19:27:15 -0000 1.5
+++ dfp.c 16 Jan 2008 14:10:42 -0000
@@ -249,7 +249,7 @@ decimal_from_floating (struct value *fro
/* Converts a decimal float of LEN bytes to a double value. */
DOUBLEST
-decimal_to_double (const gdb_byte *from, int len)
+decimal_to_doublest (const gdb_byte *from, int len)
{
char buffer[MAX_DECIMAL_STRING];
Index: dfp.h
===================================================================
RCS file: /cvs/src/src/gdb/dfp.h,v
retrieving revision 1.3
diff -u -p -r1.3 dfp.h
--- dfp.h 7 Jan 2008 22:33:57 -0000 1.3
+++ dfp.h 16 Jan 2008 14:10:42 -0000
@@ -33,7 +33,7 @@ extern void decimal_to_string (const gdb
extern int decimal_from_string (gdb_byte *, int, const char *);
extern void decimal_from_integral (struct value *from, gdb_byte *to, int len);
extern void decimal_from_floating (struct value *from, gdb_byte *to, int len);
-extern DOUBLEST decimal_to_double (const gdb_byte *from, int len);
+extern DOUBLEST decimal_to_doublest (const gdb_byte *from, int len);
extern void decimal_binop (enum exp_opcode, const gdb_byte *, int,
const gdb_byte *, int, gdb_byte *, int *);
extern int decimal_is_zero (const gdb_byte *x, int len);
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.55
diff -u -p -r1.55 value.c
--- value.c 7 Jan 2008 22:33:57 -0000 1.55
+++ value.c 16 Jan 2008 14:10:42 -0000
@@ -1131,7 +1131,7 @@ unpack_long (struct type *type, const gd
case TYPE_CODE_DECFLOAT:
/* libdecnumber has a function to convert from decimal to integer, but
it doesn't work when the decimal number has a fractional part. */
- return decimal_to_double (valaddr, len);
+ return decimal_to_doublest (valaddr, len);
case TYPE_CODE_PTR:
case TYPE_CODE_REF:
@@ -1191,7 +1191,7 @@ unpack_double (struct type *type, const
return extract_typed_floating (valaddr, type);
}
else if (code == TYPE_CODE_DECFLOAT)
- return decimal_to_double (valaddr, len);
+ return decimal_to_doublest (valaddr, len);
else if (nosign)
{
/* Unsigned -- be sure we compensate for signed LONGEST. */
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFA] Rename decimal_to_double
2008-01-16 14:17 [RFA] Rename decimal_to_double Mark Kettenis
@ 2008-01-16 16:00 ` Thiago Jung Bauermann
2008-01-16 16:17 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Thiago Jung Bauermann @ 2008-01-16 16:00 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Wed, 2008-01-16 at 15:16 +0100, Mark Kettenis wrote:
> The attached patch renames the function to decimal_to_doublest to avoid the collision.
>
> ok?
I wrote that code, but I'm no maintainer. Having said that, it's fine by
me.
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Rename decimal_to_double
2008-01-16 16:00 ` Thiago Jung Bauermann
@ 2008-01-16 16:17 ` Mark Kettenis
0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2008-01-16 16:17 UTC (permalink / raw)
To: bauerman; +Cc: gdb-patches
> From: Thiago Jung Bauermann <bauerman@br.ibm.com>
> Date: Wed, 16 Jan 2008 14:00:18 -0200
>
> On Wed, 2008-01-16 at 15:16 +0100, Mark Kettenis wrote:
> > The attached patch renames the function to decimal_to_doublest to
> > avoid the collision.
> >
> > ok?
>
> I wrote that code, but I'm no maintainer. Having said that, it's fine by
> me.
Gooed enough for me ;). Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-16 16:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-16 14:17 [RFA] Rename decimal_to_double Mark Kettenis
2008-01-16 16:00 ` Thiago Jung Bauermann
2008-01-16 16:17 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox