[Ada] Continuation of "Get rid of more references to Universal_Integer"
2020-06-04 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-atopar.adb, libgnat/s-atopex.adb: Use Object_Size instead of Size, otherwise many derived types will be rejected (e.g. a type with a 14 bits 'Size and a 16 bits 'Object_Size).
This commit is contained in:
parent
8b3bf48a31
commit
bbe376e136
@ -88,7 +88,7 @@ package body System.Atomic_Operations.Arithmetic is
|
||||
pragma Warnings (On);
|
||||
|
||||
begin
|
||||
case Atomic_Type'Size is
|
||||
case Atomic_Type'Object_Size is
|
||||
when 8 => return Atomic_Fetch_Add_1 (Item'Address, Value);
|
||||
when 16 => return Atomic_Fetch_Add_2 (Item'Address, Value);
|
||||
when 32 => return Atomic_Fetch_Add_4 (Item'Address, Value);
|
||||
@ -125,7 +125,7 @@ package body System.Atomic_Operations.Arithmetic is
|
||||
pragma Warnings (On);
|
||||
|
||||
begin
|
||||
case Atomic_Type'Size is
|
||||
case Atomic_Type'Object_Size is
|
||||
when 8 => return Atomic_Fetch_Sub_1 (Item'Address, Value);
|
||||
when 16 => return Atomic_Fetch_Sub_2 (Item'Address, Value);
|
||||
when 32 => return Atomic_Fetch_Sub_4 (Item'Address, Value);
|
||||
@ -142,7 +142,7 @@ package body System.Atomic_Operations.Arithmetic is
|
||||
pragma Unreferenced (Item);
|
||||
use type Interfaces.C.size_t;
|
||||
begin
|
||||
return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Size / 8));
|
||||
return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Object_Size / 8));
|
||||
end Is_Lock_Free;
|
||||
|
||||
end System.Atomic_Operations.Arithmetic;
|
||||
|
@ -66,7 +66,7 @@ package body System.Atomic_Operations.Exchange is
|
||||
pragma Warnings (On);
|
||||
|
||||
begin
|
||||
case Atomic_Type'Size is
|
||||
case Atomic_Type'Object_Size is
|
||||
when 8 => return Atomic_Exchange_1 (Item'Address, Value);
|
||||
when 16 => return Atomic_Exchange_2 (Item'Address, Value);
|
||||
when 32 => return Atomic_Exchange_4 (Item'Address, Value);
|
||||
@ -124,7 +124,7 @@ package body System.Atomic_Operations.Exchange is
|
||||
pragma Warnings (On);
|
||||
|
||||
begin
|
||||
case Atomic_Type'Size is
|
||||
case Atomic_Type'Object_Size is
|
||||
when 8 =>
|
||||
return Boolean
|
||||
(Atomic_Compare_Exchange_1
|
||||
@ -154,7 +154,7 @@ package body System.Atomic_Operations.Exchange is
|
||||
pragma Unreferenced (Item);
|
||||
use type Interfaces.C.size_t;
|
||||
begin
|
||||
return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Size / 8));
|
||||
return Boolean (Atomic_Always_Lock_Free (Atomic_Type'Object_Size / 8));
|
||||
end Is_Lock_Free;
|
||||
|
||||
end System.Atomic_Operations.Exchange;
|
||||
|
Loading…
Reference in New Issue
Block a user