Skip to content

Commit 98d1e86

Browse files
committed
Rename component of record to avoid compile error with GCC 12
Signed-off-by: onox <denkpadje@gmail.com>
1 parent 5aa9690 commit 98d1e86

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/canberra.adb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ package body Canberra is
157157
end Decrement_Ref;
158158
end Sound_Status;
159159

160-
function Status (Object : Sound) return Status_Type is (Object.Status.Status);
160+
function Status (Object : Sound) return Status_Type is (Object.Sound_Status.Status);
161161

162162
procedure Await_Finish_Playing (Object : Sound) is
163163
begin
164-
Object.Status.Wait_For_Completion;
164+
Object.Sound_Status.Wait_For_Completion;
165165
end Await_Finish_Playing;
166166

167167
function Belongs_To (Object : Sound; Subject : Context'Class) return Boolean
@@ -234,7 +234,7 @@ package body Canberra is
234234
Event_Sound : Sound;
235235
begin
236236
Object.Play (Event_ID, Event_Sound, Event, Event_ID);
237-
Event_Sound.Status.Wait_For_Completion;
237+
Event_Sound.Sound_Status.Wait_For_Completion;
238238
end Play;
239239

240240
procedure Play_Internal
@@ -260,19 +260,19 @@ package body Canberra is
260260
when Music => "music"));
261261
Set_Property (Properties, "media.name", (if Name'Length > 0 then Name else Property_Value));
262262

263-
The_Sound.Status.Increment_Ref;
264-
The_Sound.Status.Set_Status (Playing);
263+
The_Sound.Sound_Status.Increment_Ref;
264+
The_Sound.Sound_Status.Set_Status (Playing);
265265

266266
Error := API.Play_Full
267267
(Object.Handle,
268268
Object.Next_ID,
269269
Properties,
270270
On_Finish'Access,
271-
The_Sound.Status);
271+
The_Sound.Sound_Status);
272272

273273
if Error /= API.Success then
274-
The_Sound.Status.Set_Status (Failed);
275-
The_Sound.Status.Decrement_Ref (Is_Zero);
274+
The_Sound.Sound_Status.Set_Status (Failed);
275+
The_Sound.Sound_Status.Decrement_Ref (Is_Zero);
276276
end if;
277277

278278
Raise_Error_If_No_Success (API.Destroy (Properties));
@@ -355,16 +355,16 @@ package body Canberra is
355355

356356
overriding procedure Initialize (Object : in out Sound) is
357357
begin
358-
Object.Status := new Sound_Status;
359-
Object.Status.Increment_Ref;
358+
Object.Sound_Status := new Sound_Status;
359+
Object.Sound_Status.Increment_Ref;
360360
end Initialize;
361361

362362
overriding procedure Finalize (Object : in out Sound) is
363363
Is_Zero : Boolean;
364364
begin
365-
Object.Status.Decrement_Ref (Is_Zero);
365+
Object.Sound_Status.Decrement_Ref (Is_Zero);
366366
if Is_Zero then
367-
Free (Object.Status);
367+
Free (Object.Sound_Status);
368368
end if;
369369
end Finalize;
370370

src/canberra.ads

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ private
134134

135135
Identifier : ID := ID'Last;
136136

137-
Status : Sound_Status_Access := null;
137+
Sound_Status : Sound_Status_Access := null;
138138
end record
139-
with Type_Invariant => Sound.Status /= null;
139+
with Type_Invariant => Sound.Sound_Status /= null;
140140

141141
overriding procedure Initialize (Object : in out Sound);
142142

0 commit comments

Comments
 (0)