aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-05-08 16:54:26 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2025-05-08 16:54:26 +1200
commit866bd03532013b163ec55d0814c4bf562b9c5cac (patch)
tree8d33b52f9cdb376d6ab118e238a6c82aca8c79a2
parent375802cb41f9189707c8742e6f802c78d934f0a5 (diff)
Constants marked constant, redundant with clauses removedHEADmaster
-rw-r--r--example/format_options.adb2
-rw-r--r--example/info_list.adb2
-rw-r--r--src/libao.adb21
3 files changed, 13 insertions, 12 deletions
diff --git a/example/format_options.adb b/example/format_options.adb
index 352d3d5..fe8c380 100644
--- a/example/format_options.adb
+++ b/example/format_options.adb
@@ -20,7 +20,7 @@ procedure Format_Options is
My_Options : Libao.Option_List;
- My_Format : Libao.Sample_Format := Libao.Create
+ My_Format : constant Libao.Sample_Format := Libao.Create
(Bits => 16,
Rate => 44100,
Channels => 4,
diff --git a/example/info_list.adb b/example/info_list.adb
index 5dcdcf0..0605f96 100644
--- a/example/info_list.adb
+++ b/example/info_list.adb
@@ -30,7 +30,7 @@ procedure Info_List is
return String
renames Ada.Strings.Fixed."*";
- My_Information : Libao.Info_Array := Libao.Driver_Info_List;
+ My_Information : constant Libao.Info_Array := Libao.Driver_Info_List;
begin
diff --git a/src/libao.adb b/src/libao.adb
index 0d7f7ba..63688dc 100644
--- a/src/libao.adb
+++ b/src/libao.adb
@@ -13,7 +13,7 @@ with
Ada.Strings.Fixed,
Ada.Strings.Maps,
Interfaces.C.Strings,
- System.Storage_Elements;
+ System;
use type
@@ -285,7 +285,7 @@ package body Libao is
procedure Do_Close
(Ptr : in Storage.Integer_Address)
is
- Result : Interfaces.C.int := ao_close (Ptr);
+ Result : constant Interfaces.C.int := ao_close (Ptr);
begin
if Result = 0 then
raise Close_Device_Error;
@@ -366,7 +366,7 @@ package body Libao is
(Attributes : in Info)
return Output_Kind
is
- Value : Interfaces.C.int := info_kind_get (Attributes.Ptr);
+ Value : constant Interfaces.C.int := info_kind_get (Attributes.Ptr);
begin
if Value = type_live then
return Live_Output;
@@ -395,7 +395,7 @@ package body Libao is
(Attributes : in Info)
return Endianness
is
- Value : Interfaces.C.int := info_preferred_byte_format_get (Attributes.Ptr);
+ Value : constant Interfaces.C.int := info_preferred_byte_format_get (Attributes.Ptr);
begin
if Value = sample_little_endian then
return Little_Endian;
@@ -516,7 +516,7 @@ package body Libao is
Channel_Matrix : in Mnemonic_Array)
return Sample_Format is
begin
- return This : Sample_Format := (Ada.Finalization.Controlled with
+ return This : constant Sample_Format := (Ada.Finalization.Controlled with
C_Struct =>
(Bits => Interfaces.C.int (Bits),
Rate => Interfaces.C.int (Rate),
@@ -568,7 +568,7 @@ package body Libao is
(Format : in Sample_Format)
return Mnemonic_Array
is
- Input : String := Interfaces.C.Strings.Value (Format.C_Struct.Matrix);
+ Input : constant String := Interfaces.C.Strings.Value (Format.C_Struct.Matrix);
Result : Mnemonic_Array (1 .. SFix.Count (Input, SMap.To_Set (',')) + 1);
First : Positive := 1;
Last : Natural;
@@ -630,7 +630,7 @@ package body Libao is
Format : in Sample_Format'Class;
Options : in Option_List'Class)
is
- Result : Storage.Integer_Address := ao_open_live
+ Result : constant Storage.Integer_Address := ao_open_live
(Driver_ID => Interfaces.C.int (Driver_ID),
Format => Storage.To_Integer (Format.C_Struct'Address),
Options => Head_Pointer (Options.Ptr_List));
@@ -668,7 +668,7 @@ package body Libao is
Options : in Option_List'Class;
Overwrite : in Boolean := False)
is
- Result : Storage.Integer_Address := ao_open_file
+ Result : constant Storage.Integer_Address := ao_open_file
(Driver_ID => Interfaces.C.int (Driver_ID),
Filename => Interfaces.C.To_C (Filename),
Overwrite => Boolean'Pos (Overwrite),
@@ -706,7 +706,7 @@ package body Libao is
(Output : in Device;
Samples : in Data_Buffer)
is
- Result : Interfaces.C.int := ao_play
+ Result : constant Interfaces.C.int := ao_play
(Output_Device => Output.Ptr,
Samples => Storage.To_Integer (Samples'Address),
Num_Bytes => Interfaces.Unsigned_32 (Samples'Length));
@@ -801,7 +801,8 @@ package body Libao is
(Ident : in Driver_ID_Number)
return String
is
- Result : Interfaces.C.Strings.chars_ptr := ao_file_extension (Interfaces.C.int (Ident));
+ Result : constant Interfaces.C.Strings.chars_ptr :=
+ ao_file_extension (Interfaces.C.int (Ident));
begin
if Result = Interfaces.C.Strings.Null_Ptr then
return "";