[Ada] Import binder globals as constant

gcc/ada/

	* libgnarl/s-intman__android.adb, libgnarl/s-intman__lynxos.adb,
	libgnarl/s-intman__posix.adb, libgnarl/s-intman__qnx.adb,
	libgnarl/s-intman__solaris.adb, libgnarl/s-intman__susv3.adb,
	libgnarl/s-taprob.adb, libgnarl/s-taprop__hpux-dce.adb,
	libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb,
	libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb,
	libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb,
	libgnarl/s-taskin.adb, libgnarl/s-tasque.adb,
	libgnarl/s-tpoben.adb, libgnat/a-calend.adb,
	libgnat/a-excach.adb, libgnat/a-except.adb, libgnat/a-tags.adb,
	libgnat/a-textio.adb, libgnat/a-witeio.adb,
	libgnat/a-ztexio.adb, libgnat/g-binenv.adb,
	libgnat/s-parame.adb, libgnat/s-parame__vxworks.adb,
	libgnat/s-stratt.adb, libgnat/s-trasym__dwarf.adb: Mark imported
	binder globals as constant.
This commit is contained in:
Ghjuvan Lacambre 2021-09-29 15:48:49 +02:00 committed by Pierre-Marie de Rodat
parent 736f9bed34
commit 4075bdcf80
29 changed files with 44 additions and 53 deletions

View File

@ -68,7 +68,7 @@ package body System.Interrupt_Management is
Exception_Interrupts : constant Interrupt_List :=
(SIGFPE, SIGILL, SIGSEGV, SIGBUS);
Unreserve_All_Interrupts : Interfaces.C.int;
Unreserve_All_Interrupts : constant Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");

View File

@ -68,7 +68,7 @@ package body System.Interrupt_Management is
Exception_Interrupts : constant Interrupt_List :=
(SIGFPE, SIGILL, SIGSEGV, SIGBUS);
Unreserve_All_Interrupts : Interfaces.C.int;
Unreserve_All_Interrupts : constant Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");

View File

@ -68,7 +68,7 @@ package body System.Interrupt_Management is
Exception_Interrupts : constant Interrupt_List :=
(SIGFPE, SIGILL, SIGSEGV, SIGBUS);
Unreserve_All_Interrupts : Interfaces.C.int;
Unreserve_All_Interrupts : constant Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");

View File

@ -68,7 +68,7 @@ package body System.Interrupt_Management is
Exception_Interrupts : constant Interrupt_List :=
(SIGFPE, SIGILL, SIGSEGV, SIGBUS);
Unreserve_All_Interrupts : Interfaces.C.int;
Unreserve_All_Interrupts : constant Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");

View File

@ -47,7 +47,7 @@ package body System.Interrupt_Management is
Exception_Interrupts : constant Interrupt_List :=
(SIGFPE, SIGILL, SIGSEGV, SIGBUS);
Unreserve_All_Interrupts : Interfaces.C.int;
Unreserve_All_Interrupts : constant Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");

View File

@ -56,7 +56,7 @@ package body System.Interrupt_Management is
use Interfaces.C;
use System.OS_Interface;
Unreserve_All_Interrupts : Interfaces.C.int;
Unreserve_All_Interrupts : constant Interfaces.C.int;
pragma Import
(C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");

View File

@ -47,7 +47,7 @@ package body System.Tasking.Protected_Objects is
-- Local Data --
----------------
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
-------------------------

View File

@ -87,10 +87,10 @@ package body System.Task_Primitives.Operations is
Unblocked_Signal_Mask : aliased sigset_t;
-- The set of signals that should unblocked in all tasks
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
-- Note: the reason that Locking_Policy is not needed is that this

View File

@ -84,13 +84,13 @@ package body System.Task_Primitives.Operations is
Next_Serial_Number : Task_Serial_Number := 100;
-- We start at 100 (reserve some special values for using in error checks)
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Foreign_Task_Elaborated : aliased Boolean := True;

View File

@ -109,10 +109,10 @@ package body System.Task_Primitives.Operations is
-- a time; it is used to execute in mutual exclusion from all other tasks.
-- Used to protect All_Tasks_List
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
function Get_Policy (Prio : System.Any_Priority) return Character;

View File

@ -83,7 +83,7 @@ package body System.Task_Primitives.Operations is
Environment_Task_Id : Task_Id;
-- A variable to hold Task_Id for the environment task
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
-- Value of the pragma Locking_Policy:
-- 'C' for Ceiling_Locking
@ -99,10 +99,10 @@ package body System.Task_Primitives.Operations is
-- We start at 100, to reserve some special values for
-- using in error checking.
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
Foreign_Task_Elaborated : aliased Boolean := True;

View File

@ -83,7 +83,7 @@ package body System.Task_Primitives.Operations is
Environment_Task_Id : Task_Id;
-- A variable to hold Task_Id for the environment task
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
-- Value of the pragma Locking_Policy:
-- 'C' for Ceiling_Locking
@ -99,10 +99,10 @@ package body System.Task_Primitives.Operations is
-- We start at 100, to reserve some special values for
-- using in error checking.
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
Foreign_Task_Elaborated : aliased Boolean := True;

View File

@ -128,13 +128,13 @@ package body System.Task_Primitives.Operations is
-- External Configuration Values --
-----------------------------------
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
Foreign_Task_Elaborated : aliased Boolean := True;

View File

@ -88,13 +88,13 @@ package body System.Task_Primitives.Operations is
-- The followings are internal configuration constants needed
Dispatching_Policy : Character;
Dispatching_Policy : constant Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
Foreign_Task_Elaborated : aliased Boolean := True;
-- Used to identified fake tasks (i.e., non-Ada Threads)
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
Mutex_Protocol : Priority_Type;
@ -104,7 +104,7 @@ package body System.Task_Primitives.Operations is
-- time; it is used to execute in mutual exclusion from all other tasks.
-- Used to protect All_Tasks_List
Time_Slice_Val : Integer;
Time_Slice_Val : constant Integer;
pragma Import (C, Time_Slice_Val, "__gl_time_slice_val");
Null_Thread_Id : constant Thread_Id := 0;

View File

@ -173,13 +173,13 @@ package body System.Tasking is
Main_Task_Image : constant String := "main_task";
-- Image of environment task
Main_Priority : Integer;
Main_Priority : constant Integer;
pragma Import (C, Main_Priority, "__gl_main_priority");
-- Priority for main task. Note that this is of type Integer, not Priority,
-- because we use the value -1 to indicate the default main priority, and
-- that is of course not in Priority'range.
Main_CPU : Integer;
Main_CPU : constant Integer;
pragma Import (C, Main_CPU, "__gl_main_cpu");
-- Affinity for main task. Note that this is of type Integer, not
-- CPU_Range, because we use the value -1 to indicate the unassigned

View File

@ -44,7 +44,7 @@ package body System.Tasking.Queuing is
-- Entry Queues implemented as doubly linked list
Queuing_Policy : Character;
Queuing_Policy : constant Character;
pragma Import (C, Queuing_Policy, "__gl_queuing_policy");
Priority_Queuing : constant Boolean := Queuing_Policy = 'P';

View File

@ -58,7 +58,7 @@ package body System.Tasking.Protected_Objects.Entries is
-- Local Data --
----------------
Locking_Policy : Character;
Locking_Policy : constant Character;
pragma Import (C, Locking_Policy, "__gl_locking_policy");
--------------

View File

@ -149,7 +149,7 @@ is
-- Leap seconds control --
--------------------------
Flag : Integer;
Flag : constant Integer;
pragma Import (C, Flag, "__gl_leap_seconds_support");
-- This imported value is used to determine whether the compilation had
-- binder flag "-y" present which enables leap seconds. A value of zero

View File

@ -41,7 +41,7 @@ pragma Warnings (On);
separate (Ada.Exceptions)
procedure Call_Chain (Excep : EOA) is
Exception_Tracebacks : Integer;
Exception_Tracebacks : constant Integer;
pragma Import (C, Exception_Tracebacks, "__gl_exception_tracebacks");
-- Boolean indicating whether tracebacks should be stored in exception
-- occurrences.

View File

@ -1760,7 +1760,7 @@ package body Ada.Exceptions is
-- Wide_Exception_Name --
-------------------------
WC_Encoding : Character;
WC_Encoding : constant Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
-- Encoding method for source, as exported by binder

View File

@ -1032,7 +1032,7 @@ package body Ada.Tags is
-- Wide_Expanded_Name --
------------------------
WC_Encoding : Character;
WC_Encoding : constant Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
-- Encoding method for source, as exported by binder

View File

@ -67,7 +67,7 @@ is
use type System.CRTL.size_t;
WC_Encoding : Character;
WC_Encoding : constant Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
-- Default wide character encoding

View File

@ -55,7 +55,7 @@ package body Ada.Wide_Text_IO is
use type System.CRTL.size_t;
WC_Encoding : Character;
WC_Encoding : constant Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
-- Default wide character encoding

View File

@ -55,7 +55,7 @@ package body Ada.Wide_Wide_Text_IO is
use type System.CRTL.size_t;
WC_Encoding : Character;
WC_Encoding : constant Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
-- Default wide character encoding

View File

@ -40,7 +40,7 @@ package body GNAT.Bind_Environment is
function Get (Key : String) return String is
use type System.Address;
Bind_Env_Addr : System.Address;
Bind_Env_Addr : constant System.Address;
pragma Import (C, Bind_Env_Addr, "__gl_bind_env_addr");
-- Variable provided by init.c/s-init.ads, and initialized by
-- the binder generated file.

View File

@ -55,7 +55,7 @@ package body System.Parameters is
------------------------
function Default_Stack_Size return Size_Type is
Default_Stack_Size : Integer;
Default_Stack_Size : constant Integer;
pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
begin
if Default_Stack_Size = -1 then

View File

@ -53,7 +53,7 @@ package body System.Parameters is
------------------------
function Default_Stack_Size return Size_Type is
Default_Stack_Size : Integer;
Default_Stack_Size : constant Integer;
pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
begin
if Default_Stack_Size = -1 then

View File

@ -36,13 +36,13 @@ with System.Stream_Attributes.XDR;
package body System.Stream_Attributes is
XDR_Flag : Integer;
pragma Import (C, XDR_Flag, "__gl_xdr_stream");
XDR_Stream : constant Integer;
pragma Import (C, XDR_Stream, "__gl_xdr_stream");
-- This imported value is used to determine whether the build had the
-- binder switch "-xdr" present which enables XDR streaming and sets this
-- flag to 1.
function XDR_Support return Boolean;
function XDR_Support return Boolean is (XDR_Stream = 1);
pragma Inline (XDR_Support);
-- Return True if XDR streaming should be used. Note that 128-bit integers
-- are not supported by the XDR protocol and will raise Device_Error.
@ -141,15 +141,6 @@ package body System.Stream_Attributes is
function To_WC is new UC (S_WC, Wide_Character);
function To_WWC is new UC (S_WWC, Wide_Wide_Character);
-----------------
-- XDR_Support --
-----------------
function XDR_Support return Boolean is
begin
return XDR_Flag = 1;
end XDR_Support;
-----------------
-- Block_IO_OK --
-----------------

View File

@ -691,7 +691,7 @@ package body System.Traceback.Symbolic is
return Symbolic_Traceback (E, Suppress_Hex => True);
end Symbolic_Traceback_No_Hex;
Exception_Tracebacks_Symbolic : Integer;
Exception_Tracebacks_Symbolic : constant Integer;
pragma Import
(C,
Exception_Tracebacks_Symbolic,