diff options
-rw-r--r-- | example/read_example.adb | 4 | ||||
-rw-r--r-- | src/libsndfile-commands.adb | 74 | ||||
-rw-r--r-- | src/libsndfile-virtual.adb | 12 | ||||
-rw-r--r-- | src/libsndfile.adb | 6 |
4 files changed, 48 insertions, 48 deletions
diff --git a/example/read_example.adb b/example/read_example.adb index 719e7ec..531ed5f 100644 --- a/example/read_example.adb +++ b/example/read_example.adb @@ -52,8 +52,8 @@ begin TIO.New_Line; declare - Channel_Count : Natural := My_Info.Channels; - Test_Frames : Libsndfile.Count_Type := 5; + Channel_Count : constant Natural := My_Info.Channels; + Test_Frames : constant Libsndfile.Count_Type := 5; My_Shorts : Libsndfile.Short_Data (1 .. Natural (Test_Frames) * Channel_Count); My_Integers : Libsndfile.Integer_Data (1 .. Natural (Test_Frames) * Channel_Count); diff --git a/src/libsndfile-commands.adb b/src/libsndfile-commands.adb index 6bdd3cf..5338a7b 100644 --- a/src/libsndfile-commands.adb +++ b/src/libsndfile-commands.adb @@ -10,7 +10,7 @@ pragma Ada_2012; with Ada.Strings.Fixed, - Interfaces.C.Strings; + Interfaces.C; use type @@ -301,7 +301,7 @@ package body Libsndfile.Commands is (Info : in Format_Info) return Major_Format is - Raw : Interfaces.Unsigned_32 := + Raw : constant Interfaces.Unsigned_32 := Interfaces.Unsigned_32 (Info.C_Data.My_Format) and sf_format_typemask; begin return To_Major (Interfaces.C.int (Raw)); @@ -311,7 +311,7 @@ package body Libsndfile.Commands is (Info : in Format_Info) return Minor_Format is - Raw : Interfaces.Unsigned_32 := + Raw : constant Interfaces.Unsigned_32 := Interfaces.Unsigned_32 (Info.C_Data.My_Format) and sf_format_submask; begin return To_Minor (Interfaces.C.int (Raw)); @@ -321,7 +321,7 @@ package body Libsndfile.Commands is (Info : in Format_Info) return Endianness is - Raw : Interfaces.Unsigned_32 := + Raw : constant Interfaces.Unsigned_32 := Interfaces.Unsigned_32 (Info.C_Data.My_Format) and sf_format_endmask; begin return To_Endian (Interfaces.C.int (Raw)); @@ -574,26 +574,26 @@ package body Libsndfile.Commands is (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_norm_float, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Normed_Float; procedure Set_Normed_Double (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_norm_double, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Normed_Double; function Get_Normed_Float @@ -640,34 +640,34 @@ package body Libsndfile.Commands is (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_scale_float_int_read, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Scale_Float_Integer_Read; procedure Set_Scale_Integer_Float_Write (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_scale_int_float_write, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Scale_Integer_Float_Write; function Get_Simple_Format_Count return Natural is - Result, Code : Interfaces.C.int; + Result, Ignore : Interfaces.C.int; begin - Code := sf_command + Ignore := sf_command (Null_Pointer, sfc_get_simple_format_count, Storage.To_Integer (Result'Address), @@ -740,9 +740,9 @@ package body Libsndfile.Commands is function Get_Format_Major_Count return Natural is - Result, Code : Interfaces.C.int; + Result, Ignore : Interfaces.C.int; begin - Code := sf_command + Ignore := sf_command (Null_Pointer, sfc_get_format_major_count, Storage.To_Integer (Result'Address), @@ -775,9 +775,9 @@ package body Libsndfile.Commands is function Get_Format_Subtype_Count return Natural is - Result, Code : Interfaces.C.int; + Result, Ignore : Interfaces.C.int; begin - Code := sf_command + Ignore := sf_command (Null_Pointer, sfc_get_format_subtype_count, Storage.To_Integer (Result'Address), @@ -811,38 +811,38 @@ package body Libsndfile.Commands is (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_add_peak_chunk, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Add_Peak_Chunk; procedure Update_Header_Now (File : in Sound_File) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_update_header_now, Null_Pointer, 0); + begin + null; end Update_Header_Now; procedure Set_Update_Header_Auto (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_update_header_auto, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Update_Header_Auto; procedure File_Truncate @@ -873,13 +873,13 @@ package body Libsndfile.Commands is (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_set_clipping, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end Set_Clipping; function Get_Clipping @@ -1438,13 +1438,13 @@ package body Libsndfile.Commands is (File : in Sound_File; Value : in Boolean) is - Code : Interfaces.C.int; - begin - Code := sf_command + Ignore : Interfaces.C.int := sf_command (File.Ptr, sfc_rf64_auto_downgrade, Null_Pointer, (if Value then sf_true else sf_false)); + begin + null; end RF64_Auto_Downgrade; function Get_Original_Samplerate diff --git a/src/libsndfile-virtual.adb b/src/libsndfile-virtual.adb index 8a54837..1aae30b 100644 --- a/src/libsndfile-virtual.adb +++ b/src/libsndfile-virtual.adb @@ -47,7 +47,7 @@ package body Libsndfile.Virtual is (Data : in Storage.Integer_Address) return Interfaces.Integer_64 is - Virtual : Virt_Conversions.Object_Pointer := + Virtual : constant Virt_Conversions.Object_Pointer := Virt_Conversions.To_Pointer (Storage.To_Address (Data)); begin return Interfaces.Integer_64 (Virtual.My_Length.all); @@ -60,7 +60,7 @@ package body Libsndfile.Virtual is Data : in Storage.Integer_Address) return Interfaces.Integer_64 is - Virtual : Virt_Conversions.Object_Pointer := + Virtual : constant Virt_Conversions.Object_Pointer := Virt_Conversions.To_Pointer (Storage.To_Address (Data)); My_Whence : Seek_From; begin @@ -83,7 +83,7 @@ package body Libsndfile.Virtual is Data : in Storage.Integer_Address) return Interfaces.Integer_64 is - Virtual : Virt_Conversions.Object_Pointer := + Virtual : constant Virt_Conversions.Object_Pointer := Virt_Conversions.To_Pointer (Storage.To_Address (Data)); Buffer : Raw_Data (1 .. Integer (Count)); for Buffer'Address use Storage.To_Address (Ptr); @@ -99,7 +99,7 @@ package body Libsndfile.Virtual is Data : in Storage.Integer_Address) return Interfaces.Integer_64 is - Virtual : Virt_Conversions.Object_Pointer := + Virtual : constant Virt_Conversions.Object_Pointer := Virt_Conversions.To_Pointer (Storage.To_Address (Data)); Buffer : Raw_Data (1 .. Integer (Count)); for Buffer'Address use Storage.To_Address (Ptr); @@ -113,7 +113,7 @@ package body Libsndfile.Virtual is (Data : in Storage.Integer_Address) return Interfaces.Integer_64 is - Virtual : Virt_Conversions.Object_Pointer := + Virtual : constant Virt_Conversions.Object_Pointer := Virt_Conversions.To_Pointer (Storage.To_Address (Data)); begin return Interfaces.Integer_64 (Virtual.My_Tell.all); @@ -136,7 +136,7 @@ package body Libsndfile.Virtual is Write : in Write_Function; Tell : in Tell_Function) is - Mode_Int : Interfaces.C.int := (case Mode is + Mode_Int : constant Interfaces.C.int := (case Mode is when Read_Only => sfm_read, when Write_Only => sfm_write, when Read_Write => sfm_rdwr); diff --git a/src/libsndfile.adb b/src/libsndfile.adb index 25cfd42..80f1d96 100644 --- a/src/libsndfile.adb +++ b/src/libsndfile.adb @@ -799,7 +799,7 @@ package body Libsndfile is Mode : in File_Mode; Info : in out File_Info'Class) is - Mode_Int : Interfaces.C.int := (case Mode is + Mode_Int : constant Interfaces.C.int := (case Mode is when Read_Only => sfm_read, when Write_Only => sfm_write, when Read_Write => sfm_rdwr); @@ -820,7 +820,7 @@ package body Libsndfile is (Info : in File_Info) return Boolean is - Result : Interfaces.C.int := asf_format_check (Info.Data); + Result : constant Interfaces.C.int := asf_format_check (Info.Data); begin if Result = sf_true then return True; @@ -1073,7 +1073,7 @@ package body Libsndfile is (File : in Sound_File) return Natural is - Result : Interfaces.C.int := sf_current_byterate (File.Ptr); + Result : constant Interfaces.C.int := sf_current_byterate (File.Ptr); begin if Result >= 0 then return Natural (Result); |