Skip to content

goto considered useful#6714

Merged
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:goto_considered_useful
May 10, 2025
Merged

goto considered useful#6714
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:goto_considered_useful

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

The continue statement in these error checks had no effect because the error checks are macros implemented in a do ... while (false) loop. So, use goto. There is precedent with other instances of OpenAL_ErrorCheck in the code.

This may fix the issue where sound would occasionally randomly stop, requiring a pause or a screen change to get it back. This would be difficult to verify though.

Thanks to Coverity for flagging this situation!

The `continue` statement in these error checks had no effect because the error checks are macros implemented in a `do` ... `while (false)` loop.  So, use `goto`.  There is precedent with other instances of `OpenAL_ErrorCheck` in the code.

This may fix the issue where sound would occasionally randomly stop, requiring a pause or a screen change to get it back.  This would be difficult to verify though.

Thanks to Coverity for flagging this situation!
@Goober5000 Goober5000 added coverity An issue flagged by Coverity fix A fix for bugs, not-a-bugs, and/or regressions. sound A feature or issue specific to music and sound labels May 8, 2025
@Goober5000 Goober5000 merged commit 11b085c into scp-fs2open:master May 10, 2025
16 checks passed
@Goober5000 Goober5000 deleted the goto_considered_useful branch May 10, 2025 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coverity An issue flagged by Coverity fix A fix for bugs, not-a-bugs, and/or regressions. sound A feature or issue specific to music and sound

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants