* dfp.c (decimal_convert): Call match_endianness before and after
authorJoseph Myers <joseph@codesourcery.com>
Fri, 27 Jun 2008 20:15:01 +0000 (20:15 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 27 Jun 2008 20:15:01 +0000 (20:15 +0000)
conversion.

gdb/ChangeLog
gdb/dfp.c

index 43d3851f97079a510f42265cd8a4051d0326ce6a..25b8de39bac3d0d240dc09ecf3ace88037c9617c 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-27  Joseph Myers  <joseph@codesourcery.com>
+
+       * dfp.c (decimal_convert): Call match_endianness before and after
+       conversion.
+
 2008-06-27  Jonathan Larmour  <jifl@eCosCentric.com>
 
        * remote.c (remote_insert_breakpoint): Ensure that if Z0
index fff82880742472c7ddcb511b906a66642617aebc..9816d272e89bf8350737b5f9346d5d20bf5a8ea0 100644 (file)
--- a/gdb/dfp.c
+++ b/gdb/dfp.c
@@ -395,7 +395,12 @@ decimal_convert (const gdb_byte *from, int len_from, gdb_byte *to,
                 int len_to)
 {
   decNumber number;
+  gdb_byte dec[16];
+
+  match_endianness (from, len_from, dec);
+
+  decimal_to_number (dec, len_from, &number);
+  decimal_from_number (&number, dec, len_to);
 
-  decimal_to_number (from, len_from, &number);
-  decimal_from_number (&number, to, len_to);
+  match_endianness (dec, len_to, to);
 }