OSDN Git Service

PR 33870
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-caun32.adb
index 830312f..c028939 100644 (file)
@@ -1,12 +1,12 @@
 ------------------------------------------------------------------------------
 --                                                                          --
---                   GNU ADA RUNTIME LIBRARY COMPONENTS                     --
+--                    GNAT RUN-TIME LIBRARY COMPONENTS                      --
 --                                                                          --
 --      S Y S T E M . C O M P A R E _ A R R A Y _ U N S I G N E D _ 3 2     --
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---             Copyright (C) 2002 Free Software Foundation, Inc.            --
+--          Copyright (C) 2002-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- --
@@ -16,8 +16,8 @@
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
+-- Boston, MA 02110-1301, USA.                                              --
 --                                                                          --
 -- As a special exception,  if other files  instantiate  generics from this --
 -- unit, or you link  this unit with other files  to produce an executable, --
@@ -31,7 +31,9 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with Unchecked_Conversion;
+with System.Address_Operations; use System.Address_Operations;
+
+with Ada.Unchecked_Conversion;
 
 package body System.Compare_Array_Unsigned_32 is
 
@@ -49,8 +51,8 @@ package body System.Compare_Array_Unsigned_32 is
    type WP is access Word;
    type UP is access Uword;
 
-   function W is new Unchecked_Conversion (Address, WP);
-   function U is new Unchecked_Conversion (Address, UP);
+   function W is new Ada.Unchecked_Conversion (Address, WP);
+   function U is new Ada.Unchecked_Conversion (Address, UP);
 
    -----------------------
    -- Compare_Array_U32 --
@@ -60,8 +62,7 @@ package body System.Compare_Array_Unsigned_32 is
      (Left      : System.Address;
       Right     : System.Address;
       Left_Len  : Natural;
-      Right_Len : Natural)
-      return      Integer
+      Right_Len : Natural) return Integer
    is
       Clen : Natural := Natural'Min (Left_Len, Right_Len);
       --  Number of elements left to compare
@@ -73,7 +74,7 @@ package body System.Compare_Array_Unsigned_32 is
    begin
       --  Case of going by aligned words
 
-      if ((Left or Right) and (4 - 1)) = 0 then
+      if ModA (OrA (Left, Right), 4) = 0 then
          while Clen /= 0 loop
             if W (L).all /= W (R).all then
                if W (L).all > W (R).all then
@@ -84,8 +85,8 @@ package body System.Compare_Array_Unsigned_32 is
             end if;
 
             Clen := Clen - 1;
-            L := L + 4;
-            R := R + 4;
+            L := AddA (L, 4);
+            R := AddA (R, 4);
          end loop;
 
       --  Case of going by unaligned words
@@ -101,8 +102,8 @@ package body System.Compare_Array_Unsigned_32 is
             end if;
 
             Clen := Clen - 1;
-            L := L + 4;
-            R := R + 4;
+            L := AddA (L, 4);
+            R := AddA (R, 4);
          end loop;
       end if;