From e7c9d6b5f6f4a96f69bdd5fac8fc3840aabd56b6 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 13 May 2020 21:41:05 +0200 Subject: synth-values: tentatively try to fix warnings. For #1308 --- src/synth/synth-values.adb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/synth/synth-values.adb b/src/synth/synth-values.adb index e515d6a46..3266f8508 100644 --- a/src/synth/synth-values.adb +++ b/src/synth/synth-values.adb @@ -297,18 +297,22 @@ package body Synth.Values is return Res; end Unshare; - type Heap_Index_Ptr is access all Heap_Index; - function To_Heap_Index_Ptr is - new Ada.Unchecked_Conversion (Memory_Ptr, Heap_Index_Ptr); - - procedure Write_Access (Mem : Memory_Ptr; Val : Heap_Index) is + procedure Write_Access (Mem : Memory_Ptr; Val : Heap_Index) + is + V : Heap_Index; + for V'Address use Mem.all'Address; + pragma Import (Ada, V); begin - To_Heap_Index_Ptr (Mem).all := Val; + V := Val; end Write_Access; - function Read_Access (Mem : Memory_Ptr) return Heap_Index is + function Read_Access (Mem : Memory_Ptr) return Heap_Index + is + V : Heap_Index; + for V'Address use Mem.all'Address; + pragma Import (Ada, V); begin - return To_Heap_Index_Ptr (Mem).all; + return V; end Read_Access; function Read_Access (Mt : Memtyp) return Heap_Index is -- cgit v1.2.3