* gdb.texinfo (Help): Fix formatting of examples.
[deliverable/binutils-gdb.git] / gdb / doublest.c
index eb39f450534294c6d0c6114bbdbd5ad615babb0d..3b640f5519d0331f29492f9013130ad6d76d6b89 100644 (file)
@@ -1,7 +1,7 @@
 /* Floating point routines for GDB, the GNU debugger.
 
-   Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+   Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -689,19 +689,19 @@ floatformat_from_length (int len)
 {
   const struct floatformat *format;
   if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
-    format = TARGET_FLOAT_FORMAT;
+    format = TARGET_FLOAT_FORMAT[TARGET_BYTE_ORDER];
   else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
-    format = TARGET_DOUBLE_FORMAT;
+    format = TARGET_DOUBLE_FORMAT[TARGET_BYTE_ORDER];
   else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
-    format = TARGET_LONG_DOUBLE_FORMAT;
+    format = TARGET_LONG_DOUBLE_FORMAT[TARGET_BYTE_ORDER];
   /* On i386 the 'long double' type takes 96 bits,
      while the real number of used bits is only 80,
      both in processor and in memory.  
      The code below accepts the real bit size.  */ 
   else if ((TARGET_LONG_DOUBLE_FORMAT != NULL) 
           && (len * TARGET_CHAR_BIT ==
-               TARGET_LONG_DOUBLE_FORMAT->totalsize))
-    format = TARGET_LONG_DOUBLE_FORMAT;
+               TARGET_LONG_DOUBLE_FORMAT[0]->totalsize))
+    format = TARGET_LONG_DOUBLE_FORMAT[TARGET_BYTE_ORDER];
   else
     format = NULL;
   if (format == NULL)
@@ -715,7 +715,7 @@ floatformat_from_type (const struct type *type)
 {
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
   if (TYPE_FLOATFORMAT (type) != NULL)
-    return TYPE_FLOATFORMAT (type);
+    return TYPE_FLOATFORMAT (type)[TARGET_BYTE_ORDER];
   else
     return floatformat_from_length (TYPE_LENGTH (type));
 }
@@ -776,7 +776,8 @@ extract_typed_floating (const void *addr, const struct type *type)
        specific code? stabs?) so handle that here as a special case.  */
     return extract_floating_by_length (addr, TYPE_LENGTH (type));
 
-  floatformat_to_doublest (TYPE_FLOATFORMAT (type), addr, &retval);
+  floatformat_to_doublest (TYPE_FLOATFORMAT (type)[TARGET_BYTE_ORDER],
+                          addr, &retval);
   return retval;
 }
 
@@ -813,7 +814,8 @@ store_typed_floating (void *addr, const struct type *type, DOUBLEST val)
        specific code? stabs?) so handle that here as a special case.  */
     store_floating_by_length (addr, TYPE_LENGTH (type), val);
   else
-    floatformat_from_doublest (TYPE_FLOATFORMAT (type), &val, addr);
+    floatformat_from_doublest (TYPE_FLOATFORMAT (type)[TARGET_BYTE_ORDER],
+                              &val, addr);
 }
 
 /* Convert a floating-point number of type FROM_TYPE from a
This page took 0.024752 seconds and 4 git commands to generate.