OSDN Git Service

2010-01-26 Robert Dewar <dewar@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-inmaop-posix.adb
index 5cee625..3a10e73 100644 (file)
@@ -2,13 +2,12 @@
 --                                                                          --
 --                  GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                --
 --                                                                          --
---          S Y S T E M . I N T E R R U P T _ M A N A G E M E N T .         --
---                            O P E R A T I O N S                           --
+--                  SYSTEM.INTERRUPT_MANAGEMENT.OPERATIONS                  --
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
 --             Copyright (C) 1991-1994, Florida State University            --
---                     Copyright (C) 1995-2007, AdaCore                     --
+--                     Copyright (C) 1995-2008, AdaCore                     --
 --                                                                          --
 -- GNARL 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- --
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This is a POSIX-like version of this package.
---  Note: this file can only be used for POSIX compliant systems.
+--  This is a POSIX-like version of this package
+
+--  Note: this file can only be used for POSIX compliant systems
 
 with Interfaces.C;
---  used for int
---           size_t
---           unsigned
 
 with System.OS_Interface;
---  used for various type, constant, and operations
-
 with System.Storage_Elements;
---  used for To_Address
---           Integer_Address
 
 package body System.Interrupt_Management.Operations is
 
@@ -60,8 +53,9 @@ package body System.Interrupt_Management.Operations is
    Initial_Action : array (Signal) of aliased struct_sigaction;
 
    Default_Action : aliased struct_sigaction;
+   pragma Warnings (Off, Default_Action);
 
-   Ignore_Action  : aliased struct_sigaction;
+   Ignore_Action : aliased struct_sigaction;
 
    ----------------------------
    -- Thread_Block_Interrupt --
@@ -77,7 +71,7 @@ package body System.Interrupt_Management.Operations is
       pragma Assert (Result = 0);
       Result := sigaddset (Mask'Access, Signal (Interrupt));
       pragma Assert (Result = 0);
-      Result := pthread_sigmask (SIG_BLOCK, Mask'Unchecked_Access, null);
+      Result := pthread_sigmask (SIG_BLOCK, Mask'Access, null);
       pragma Assert (Result = 0);
    end Thread_Block_Interrupt;
 
@@ -95,7 +89,7 @@ package body System.Interrupt_Management.Operations is
       pragma Assert (Result = 0);
       Result := sigaddset (Mask'Access, Signal (Interrupt));
       pragma Assert (Result = 0);
-      Result := pthread_sigmask (SIG_UNBLOCK, Mask'Unchecked_Access, null);
+      Result := pthread_sigmask (SIG_UNBLOCK, Mask'Access, null);
       pragma Assert (Result = 0);
    end Thread_Unblock_Interrupt;
 
@@ -136,11 +130,11 @@ package body System.Interrupt_Management.Operations is
    --------------------
 
    function Interrupt_Wait
-     (Mask : access Interrupt_Mask)
-      return Interrupt_ID
+     (Mask : access Interrupt_Mask) return Interrupt_ID
    is
       Result : Interfaces.C.int;
       Sig    : aliased Signal;
+
    begin
       Result := sigwait (Mask, Sig'Access);
 
@@ -286,7 +280,7 @@ begin
 
       for Sig in 1 .. Signal'Last loop
          Result := sigaction
-           (Sig, null, Initial_Action (Sig)'Unchecked_Access);
+           (Sig, null, Initial_Action (Sig)'Access);
 
          --  ??? [assert 1]
          --  we can't check Result here since sigaction will fail on
@@ -326,12 +320,12 @@ begin
 
       --  The Keep_Unmasked signals should be unmasked for Environment task
 
-      Result := pthread_sigmask (SIG_UNBLOCK, mask'Unchecked_Access, null);
+      Result := pthread_sigmask (SIG_UNBLOCK, mask'Access, null);
       pragma Assert (Result = 0);
 
       --  Get the signal mask of the Environment Task
 
-      Result := pthread_sigmask (SIG_SETMASK, null, mask'Unchecked_Access);
+      Result := pthread_sigmask (SIG_SETMASK, null, mask'Access);
       pragma Assert (Result = 0);
 
       --  Setup the constants exported