OSDN Git Service

2007-04-20 Vincent Celier <celier@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / urealp.adb
index c1839af..737e4b4 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2003 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -57,9 +57,23 @@ package body Urealp is
       --  Flag set if value is negative
    end record;
 
+   --  The following representation clause ensures that the above record
+   --  has no holes. We do this so that when instances of this record are
+   --  written by Tree_Gen, we do not write uninitialized values to the file.
+
+   for Ureal_Entry use record
+      Num      at  0 range 0 .. 31;
+      Den      at  4 range 0 .. 31;
+      Rbase    at  8 range 0 .. 31;
+      Negative at 12 range 0 .. 31;
+   end record;
+
+   for Ureal_Entry'Size use 16 * 8;
+   --  This ensures that we did not leave out any fields
+
    package Ureals is new Table.Table (
      Table_Component_Type => Ureal_Entry,
-     Table_Index_Type     => Ureal,
+     Table_Index_Type     => Ureal'Base,
      Table_Low_Bound      => Ureal_First_Entry,
      Table_Initial        => Alloc.Ureals_Initial,
      Table_Increment      => Alloc.Ureals_Increment,
@@ -1431,14 +1445,14 @@ package body Urealp is
       return UR_10_36;
    end Ureal_10_36;
 
-   -------------------
-   -- Ureal_M_10_36 --
-   -------------------
+   ----------------
+   -- Ureal_2_80 --
+   ----------------
 
-   function Ureal_M_10_36 return Ureal is
+   function Ureal_2_80 return Ureal is
    begin
-      return UR_M_10_36;
-   end Ureal_M_10_36;
+      return UR_2_80;
+   end Ureal_2_80;
 
    -----------------
    -- Ureal_2_128 --
@@ -1449,14 +1463,14 @@ package body Urealp is
       return UR_2_128;
    end Ureal_2_128;
 
-   ----------------
-   -- Ureal_2_80 --
-   ----------------
+   -------------------
+   -- Ureal_2_M_80 --
+   -------------------
 
-   function Ureal_2_80 return Ureal is
+   function Ureal_2_M_80 return Ureal is
    begin
-      return UR_2_80;
-   end Ureal_2_80;
+      return UR_2_M_80;
+   end Ureal_2_M_80;
 
    -------------------
    -- Ureal_2_M_128 --
@@ -1467,15 +1481,6 @@ package body Urealp is
       return UR_2_M_128;
    end Ureal_2_M_128;
 
-   -------------------
-   -- Ureal_2_M_80 --
-   -------------------
-
-   function Ureal_2_M_80 return Ureal is
-   begin
-      return UR_2_M_80;
-   end Ureal_2_M_80;
-
    ----------------
    -- Ureal_Half --
    ----------------
@@ -1494,6 +1499,15 @@ package body Urealp is
       return UR_M_0;
    end Ureal_M_0;
 
+   -------------------
+   -- Ureal_M_10_36 --
+   -------------------
+
+   function Ureal_M_10_36 return Ureal is
+   begin
+      return UR_M_10_36;
+   end Ureal_M_10_36;
+
    -----------------
    -- Ureal_Tenth --
    -----------------