aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-08-28 10:21:54 +0200
committerTristan Gingold <tgingold@free.fr>2021-08-28 13:22:31 +0200
commit25c8c64d8c079e52fb4073d88c8927e5eb3359bc (patch)
treeb3306d53194a247ecd2a1094b30982455f58b5f2 /src
parentd17ac5c5afdef5007cf9c805bfd510a97fc3e752 (diff)
downloadghdl-25c8c64d8c079e52fb4073d88c8927e5eb3359bc.tar.gz
ghdl-25c8c64d8c079e52fb4073d88c8927e5eb3359bc.tar.bz2
ghdl-25c8c64d8c079e52fb4073d88c8927e5eb3359bc.zip
synth-memtype: export conversion functions
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-memtype.adb7
-rw-r--r--src/synth/synth-memtype.ads9
2 files changed, 9 insertions, 7 deletions
diff --git a/src/synth/synth-memtype.adb b/src/synth/synth-memtype.adb
index 46f1c308e..7c8943abd 100644
--- a/src/synth/synth-memtype.adb
+++ b/src/synth/synth-memtype.adb
@@ -18,16 +18,9 @@
with System; use System;
with System.Storage_Elements;
-with Ada.Unchecked_Conversion;
package body Synth.Memtype is
- -- For conversions use Address to avoidcompiler warnings about alignment.
- function To_Address is new Ada.Unchecked_Conversion
- (Memory_Ptr, Address);
- function To_Memory_Ptr is new Ada.Unchecked_Conversion
- (Address, Memory_Ptr);
-
function "+" (Base : Memory_Ptr; Off : Size_Type) return Memory_Ptr
is
use System.Storage_Elements;
diff --git a/src/synth/synth-memtype.ads b/src/synth/synth-memtype.ads
index 5fc096e68..ee6f61c38 100644
--- a/src/synth/synth-memtype.ads
+++ b/src/synth/synth-memtype.ads
@@ -16,6 +16,9 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <gnu.org/licenses>.
+with System;
+with Ada.Unchecked_Conversion;
+
with Types; use Types;
with Grt.Types; use Grt.Types;
@@ -28,6 +31,12 @@ package Synth.Memtype is
type Memory_Ptr is access all Memory_Array (Size_Type);
pragma No_Strict_Aliasing (Memory_Ptr);
+ -- For conversions use Address to avoid compiler warnings about alignment.
+ function To_Address is new Ada.Unchecked_Conversion
+ (Memory_Ptr, System.Address);
+ function To_Memory_Ptr is new Ada.Unchecked_Conversion
+ (System.Address, Memory_Ptr);
+
-- Low-level functions.
function "+" (Base : Memory_Ptr; Off : Size_Type) return Memory_Ptr;