Skip to content

Commit 337bce3

Browse files
committed
Minor changes to make compatible with No_Dynamic_Accessibility_Checks
Change-Id: I5a1d6226afb1000bbe57db46be0a66322c31f858 TN: TA25-001
1 parent 6d195c0 commit 337bce3

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

sax/sax-pointers.adb

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- XML/Ada - An XML suite for Ada95 --
33
-- --
4-
-- Copyright (C) 2007-2017, AdaCore --
4+
-- Copyright (C) 2007-2021, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the Free --
@@ -67,8 +67,11 @@ package body Sax.Pointers is
6767

6868
function Allocate (Data : access Encapsulated'Class) return Pointer is
6969
begin
70-
return
71-
(Ada.Finalization.Controlled with Root_Encapsulated_Access (Data));
70+
if Data = null then
71+
return (Ada.Finalization.Controlled with null);
72+
else
73+
return (Ada.Finalization.Controlled with Data.all'Access);
74+
end if;
7275
end Allocate;
7376

7477
---------

sax/sax-state_machines.adb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- XML/Ada - An XML suite for Ada95 --
33
-- --
4-
-- Copyright (C) 2010-2017, AdaCore --
4+
-- Copyright (C) 2010-2021, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the Free --
@@ -1437,7 +1437,7 @@ package body Sax.State_Machines is
14371437
Start_At : State := Start_State)
14381438
is
14391439
begin
1440-
Self.NFA := NFA_Access (On);
1440+
Self.NFA := On.all'Access;
14411441
Self.First_Active := No_Matcher_State;
14421442
Init (Self.Active);
14431443
Mark_Active (Self, Self.First_Active, Start_At);

schema/schema-readers.adb

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- XML/Ada - An XML suite for Ada95 --
33
-- --
4-
-- Copyright (C) 2003-2017, AdaCore --
4+
-- Copyright (C) 2003-2021, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the Free --
@@ -439,7 +439,7 @@ package body Schema.Readers is
439439
is
440440
pragma Unreferenced (Public_Id, System_Id);
441441
H : constant Validating_Reader_Access :=
442-
Validating_Reader_Access (Handler);
442+
Validating_Reader (Handler.all)'Access;
443443
begin
444444
Add_Notation (Get_NFA (H.Grammar), Find_Symbol (H.all, Name));
445445
end Hook_Notation_Decl;
@@ -454,7 +454,7 @@ package body Schema.Readers is
454454
Atts : access Sax_Attribute_List)
455455
is
456456
H : constant Validating_Reader_Access :=
457-
Validating_Reader_Access (Handler);
457+
Validating_Reader (Handler.all)'Access;
458458
No_Index : constant Integer := Get_Index
459459
(Atts.all, H.XML_Instance_URI, H.No_Namespace_Schema_Location);
460460
Location_Index : constant Integer := Get_Index
@@ -971,7 +971,7 @@ package body Schema.Readers is
971971
Elem : Element_Access)
972972
is
973973
H : constant Validating_Reader_Access :=
974-
Validating_Reader_Access (Handler);
974+
Validating_Reader (Handler.all)'Access;
975975
Success : Boolean;
976976
Through_Any : Boolean;
977977
Through_Process : Process_Contents_Type;
@@ -1051,7 +1051,7 @@ package body Schema.Readers is
10511051
(Handler : access Sax_Reader'Class;
10521052
Ch : Unicode.CES.Byte_Sequence) is
10531053
begin
1054-
Internal_Characters (Validating_Reader_Access (Handler), Ch);
1054+
Internal_Characters (Validating_Reader (Handler.all)'Access, Ch);
10551055
end Hook_Characters;
10561056

10571057
-------------------------------
@@ -1063,7 +1063,7 @@ package body Schema.Readers is
10631063
Ch : Unicode.CES.Byte_Sequence)
10641064
is
10651065
H : constant Validating_Reader_Access :=
1066-
Validating_Reader_Access (Handler);
1066+
Validating_Reader (Handler.all)'Access;
10671067
NFA : constant Schema_NFA_Access := Get_NFA (H.Grammar);
10681068
S : State;
10691069
Descr : access Type_Descr;

0 commit comments

Comments
 (0)