From 3181961ad2eefb3a6d9151db99661411792d4097 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Tue, 8 Oct 2024 16:47:13 +1300 Subject: Changed System.Address to Integer_Address --- src/libsndfile.adb | 62 +++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) (limited to 'src/libsndfile.adb') diff --git a/src/libsndfile.adb b/src/libsndfile.adb index e5b76b0..7cc9837 100644 --- a/src/libsndfile.adb +++ b/src/libsndfile.adb @@ -10,16 +10,14 @@ pragma Ada_2012; with Ada.Assertions, - Interfaces.C.Strings, - System; + Interfaces.C.Strings; use type Interfaces.Integer_64, Interfaces.Unsigned_8, Interfaces.C.int, - Interfaces.C.Strings.chars_ptr, - System.Address; + Interfaces.C.Strings.chars_ptr; package body Libsndfile is @@ -281,7 +279,7 @@ package body Libsndfile is (Path : in Interfaces.C.char_array; Mode : in Interfaces.C.int; Sfinfo : in out C_File_Info) - return System.Address; + return Storage.Integer_Address; pragma Import (C, asf_open, "asf_open"); function asf_format_check @@ -290,7 +288,7 @@ package body Libsndfile is pragma Import (C, asf_format_check, "asf_format_check"); function asf_seek - (Sndfile : in System.Address; + (Sndfile : in Storage.Integer_Address; Frames : in Interfaces.Integer_64; Whence : in Interfaces.C.int) return Interfaces.Integer_64; @@ -298,16 +296,16 @@ package body Libsndfile is pragma Inline (asf_seek); function sf_close - (File : in System.Address) + (File : in Storage.Integer_Address) return Interfaces.C.int; pragma Import (C, sf_close, "sf_close"); procedure sf_write_sync - (File : in System.Address); + (File : in Storage.Integer_Address); pragma Import (C, sf_write_sync, "sf_write_sync"); function asf_readf_short - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : out C_Short_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -315,7 +313,7 @@ package body Libsndfile is pragma Inline (asf_readf_short); function asf_readf_int - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : out C_Integer_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -323,7 +321,7 @@ package body Libsndfile is pragma Inline (asf_readf_int); function asf_readf_float - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : out C_Float_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -331,7 +329,7 @@ package body Libsndfile is pragma Inline (asf_readf_float); function asf_readf_double - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : out C_Double_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -339,7 +337,7 @@ package body Libsndfile is pragma Inline (asf_readf_double); function asf_writef_short - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : in C_Short_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -347,7 +345,7 @@ package body Libsndfile is pragma Inline (asf_writef_short); function asf_writef_int - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : in C_Integer_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -355,7 +353,7 @@ package body Libsndfile is pragma Inline (asf_writef_int); function asf_writef_float - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : in C_Float_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -363,7 +361,7 @@ package body Libsndfile is pragma Inline (asf_writef_float); function asf_writef_double - (File : in System.Address; + (File : in Storage.Integer_Address; DPtr : in C_Double_Data; Items : in Interfaces.Integer_64) return Interfaces.Integer_64; @@ -371,29 +369,29 @@ package body Libsndfile is pragma Inline (asf_writef_double); function asf_read_raw - (File : in System.Address; - DPtr : in System.Address; + (File : in Storage.Integer_Address; + DPtr : in Storage.Integer_Address; Bytes : in Interfaces.Integer_64) return Interfaces.Integer_64; pragma Import (C, asf_read_raw, "asf_read_raw"); pragma Inline (asf_read_raw); function asf_write_raw - (File : in System.Address; - DPtr : in System.Address; + (File : in Storage.Integer_Address; + DPtr : in Storage.Integer_Address; Bytes : in Interfaces.Integer_64) return Interfaces.Integer_64; pragma Import (C, asf_write_raw, "asf_write_raw"); pragma Inline (asf_write_raw); function sf_get_string - (File : in System.Address; + (File : in Storage.Integer_Address; Kind : in Interfaces.C.int) return Interfaces.C.Strings.chars_ptr; pragma Import (C, sf_get_string, "sf_get_string"); function sf_set_string - (File : in System.Address; + (File : in Storage.Integer_Address; Kind : in Interfaces.C.int; Str : in Interfaces.C.char_array) return Interfaces.C.int; @@ -404,7 +402,7 @@ package body Libsndfile is pragma Import (C, sf_version_string, "sf_version_string"); function sf_current_byterate - (File : in System.Address) + (File : in Storage.Integer_Address) return Interfaces.C.int; pragma Import (C, sf_current_byterate, "sf_current_byterate"); @@ -786,7 +784,7 @@ package body Libsndfile is (File : in Sound_File) return Boolean is begin - return File.Ptr /= System.Null_Address; + return File.Ptr /= Null_Pointer; end Is_Open; @@ -806,10 +804,10 @@ package body Libsndfile is when Read_Only => sfm_read, when Write_Only => sfm_write, when Read_Write => sfm_rdwr); - Result : System.Address; + Result : Storage.Integer_Address; begin Result := asf_open (Interfaces.C.To_C (Name), Mode_Int, Info.Data); - if Result = System.Null_Address then + if Result = Null_Pointer then Raise_Error (sf_error (Result)); raise Program_Error; else @@ -875,7 +873,7 @@ package body Libsndfile is if Result /= 0 then Raise_Error (Result); else - File.Ptr := System.Null_Address; + File.Ptr := Null_Pointer; end if; end Close; @@ -1004,7 +1002,10 @@ package body Libsndfile is return Count_Type is begin Ada.Assertions.Assert (Character'Size = 8); - return Count_Type (asf_read_raw (File.Ptr, Data'Address, Interfaces.Integer_64 (Bytes))); + return Count_Type (asf_read_raw + (File.Ptr, + Storage.To_Integer (Data'Address), + Interfaces.Integer_64 (Bytes))); end Read_Raw; function Write_Raw @@ -1014,7 +1015,10 @@ package body Libsndfile is return Count_Type is begin Ada.Assertions.Assert (Character'Size = 8); - return Count_Type (asf_write_raw (File.Ptr, Data'Address, Interfaces.Integer_64 (Bytes))); + return Count_Type (asf_write_raw + (File.Ptr, + Storage.To_Integer (Data'Address), + Interfaces.Integer_64 (Bytes))); end Write_Raw; function Get_Meta -- cgit