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-commands.adb | 131 ++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 66 deletions(-) (limited to 'src/libsndfile-commands.adb') diff --git a/src/libsndfile-commands.adb b/src/libsndfile-commands.adb index 61e5f48..1939cd7 100644 --- a/src/libsndfile-commands.adb +++ b/src/libsndfile-commands.adb @@ -11,8 +11,7 @@ with Ada.Assertions, Ada.Strings.Fixed, - Interfaces.C.Strings, - System; + Interfaces.C.Strings; use type @@ -225,33 +224,33 @@ package body Libsndfile.Commands is ------------------------ function sf_command - (File : in System.Address; + (File : in Storage.Integer_Address; Cmd : in Interfaces.C.int; - Data : in System.Address; + Data : in Storage.Integer_Address; Size : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sf_command, "sf_command"); function asfc_get_current_sf_info - (File : in System.Address; + (File : in Storage.Integer_Address; Info : out C_File_Info) return Interfaces.C.int; pragma Import (C, asfc_get_current_sf_info, "asfc_get_current_sf_info"); function asfc_file_truncate - (File : in System.Address; + (File : in Storage.Integer_Address; Pos : in Interfaces.Integer_64) return Interfaces.C.int; pragma Import (C, asfc_file_truncate, "asfc_file_truncate"); function asfc_set_raw_start_offset - (File : in System.Address; + (File : in Storage.Integer_Address; Pos : in Interfaces.Integer_64) return Interfaces.C.int; pragma Import (C, asfc_set_raw_start_offset, "asfc_set_raw_start_offset"); function asfc_get_embed_file_info - (File : in System.Address; + (File : in Storage.Integer_Address; Info : in out C_Embedded_Info) return Interfaces.C.int; pragma Import (C, asfc_get_embed_file_info, "asfc_get_embed_file_info"); @@ -416,9 +415,9 @@ package body Libsndfile.Commands is return Natural is begin return Natural (sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_lib_version, - Buffer'Address, + Storage.To_Integer (Buffer'Address), Buffer'Length)); end Get_Library_String; @@ -430,7 +429,7 @@ package body Libsndfile.Commands is return Natural (sf_command (File.Ptr, sfc_get_log_info, - Buffer'Address, + Storage.To_Integer (Buffer'Address), Buffer'Length)); end Get_Log_Info; @@ -460,7 +459,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_calc_signal_max, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then Raise_Error (Code); @@ -480,7 +479,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_calc_norm_signal_max, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then Raise_Error (Code); @@ -501,7 +500,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_calc_max_all_channels, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT * File.Chans); if Code /= 0 then Raise_Error (Code); @@ -522,7 +521,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_calc_norm_max_all_channels, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT * File.Chans); if Code /= 0 then Raise_Error (Code); @@ -542,7 +541,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_signal_max, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -563,7 +562,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_max_all_channels, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT * File.Chans); if Code = sf_false then raise Command_Error; @@ -583,7 +582,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_norm_float, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Normed_Float; @@ -596,7 +595,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_norm_double, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Normed_Double; @@ -609,7 +608,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_norm_float, - System.Null_Address, + Null_Pointer, 0); if Code = sf_true then return True; @@ -629,7 +628,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_norm_double, - System.Null_Address, + Null_Pointer, 0); if Code = sf_true then return True; @@ -649,7 +648,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_scale_float_int_read, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Scale_Float_Integer_Read; @@ -662,7 +661,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_scale_int_float_write, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Scale_Integer_Float_Write; @@ -672,9 +671,9 @@ package body Libsndfile.Commands is Result, Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_simple_format_count, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT); if Result < 0 then raise Program_Error; @@ -694,9 +693,9 @@ package body Libsndfile.Commands is Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_simple_format, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Format_Info'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then raise Command_Error; @@ -716,9 +715,9 @@ package body Libsndfile.Commands is Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_format_info, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Format_Info'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then raise Command_Error; @@ -747,9 +746,9 @@ package body Libsndfile.Commands is Result, Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_format_major_count, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT); return Natural (Result); end Get_Format_Major_Count; @@ -765,9 +764,9 @@ package body Libsndfile.Commands is Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_format_major, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Format_Info'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then raise Command_Error; @@ -782,9 +781,9 @@ package body Libsndfile.Commands is Result, Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_format_subtype_count, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT); return Natural (Result); end Get_Format_Subtype_Count; @@ -800,9 +799,9 @@ package body Libsndfile.Commands is Code : Interfaces.C.int; begin Code := sf_command - (System.Null_Address, + (Null_Pointer, sfc_get_format_subtype, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Format_Info'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then raise Command_Error; @@ -820,7 +819,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_add_peak_chunk, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Add_Peak_Chunk; @@ -832,7 +831,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_update_header_now, - System.Null_Address, + Null_Pointer, 0); end Update_Header_Now; @@ -845,7 +844,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_update_header_auto, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Update_Header_Auto; @@ -882,7 +881,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_clipping, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end Set_Clipping; @@ -895,7 +894,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_clipping, - System.Null_Address, + Null_Pointer, 0); if Code = sf_true then return True; @@ -932,7 +931,7 @@ package body Libsndfile.Commands is Result := sf_command (File.Ptr, sfc_wavex_get_ambisonic, - System.Null_Address, + Null_Pointer, 0); if Result = 0 then return Ambisonic_Unsupported; @@ -962,7 +961,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_wavex_set_ambisonic, - System.Null_Address, + Null_Pointer, My_Value); if Code = 0 then raise Command_Error; @@ -982,7 +981,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_vbr_encoding_quality, - My_Value'Address, + Storage.To_Integer (My_Value'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1002,7 +1001,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_ogg_page_latency_ms, - My_Value'Address, + Storage.To_Integer (My_Value'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT); if Code /= 0 then raise Command_Error; @@ -1019,7 +1018,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_ogg_stream_serialno, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.Integer_32'Size / Interfaces.C.CHAR_BIT); if Code = 0 then return Integer (Result); @@ -1039,7 +1038,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_compression_level, - My_Value'Address, + Storage.To_Integer (My_Value'Address), Interfaces.C.double'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1057,7 +1056,7 @@ package body Libsndfile.Commands is Result := sf_command (File.Ptr, sfc_raw_data_needs_endswap, - System.Null_Address, + Null_Pointer, 0); if Result = sf_true then return True; @@ -1078,7 +1077,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_broadcast_info, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Broadcast_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_true then return Result : Broadcast_Info do @@ -1125,7 +1124,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_broadcast_info, - C_Data'Address, + Storage.To_Integer (C_Data'Address), C_Broadcast_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1145,7 +1144,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_channel_map_info, - Raw'Address, + Storage.To_Integer (Raw'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT * File.Chans); if Code = sf_false then raise Command_Error; @@ -1175,7 +1174,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_channel_map_info, - My_Value'Address, + Storage.To_Integer (My_Value'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT * File.Chans); if Code = sf_false then raise Command_Error; @@ -1194,7 +1193,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_cart_info, - Raw'Address, + Storage.To_Integer (Raw'Address), Raw'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1270,7 +1269,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_cart_info, - C_Data'Address, + Storage.To_Integer (C_Data'Address), C_Data'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1289,7 +1288,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_loop_info, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Loop_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1320,7 +1319,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_instrument, - Result.C_Data'Address, + Storage.To_Integer (Result.C_Data'Address), C_Instrument_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1340,7 +1339,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_instrument, - Info.C_Data'Address, + Storage.To_Integer (Info.C_Data'Address), C_Instrument_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1359,7 +1358,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_cue_count, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.Unsigned_32'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1380,7 +1379,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_cue, - Raw'Address, + Storage.To_Integer (Raw'Address), C_Cue_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1429,7 +1428,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_cue, - C_Data'Address, + Storage.To_Integer (C_Data'Address), C_Cue_Info'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1447,7 +1446,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_rf64_auto_downgrade, - System.Null_Address, + Null_Pointer, (if Value then sf_true else sf_false)); end RF64_Auto_Downgrade; @@ -1460,7 +1459,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_get_original_samplerate, - Result'Address, + Storage.To_Integer (Result'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT); if Code = sf_true then return Natural (Result); @@ -1479,7 +1478,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_original_samplerate, - My_Value'Address, + Storage.To_Integer (My_Value'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; @@ -1497,7 +1496,7 @@ package body Libsndfile.Commands is Result := sf_command (File.Ptr, sfc_get_bitrate_mode, - System.Null_Address, + Null_Pointer, 0); if Result = sf_bitrate_mode_constant then return Constant_Mode; @@ -1525,7 +1524,7 @@ package body Libsndfile.Commands is Code := sf_command (File.Ptr, sfc_set_bitrate_mode, - My_Value'Address, + Storage.To_Integer (My_Value'Address), Interfaces.C.int'Size / Interfaces.C.CHAR_BIT); if Code = sf_false then raise Command_Error; -- cgit