summaryrefslogtreecommitdiff
path: root/drivers/alsa
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:41:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 21:57:34 +0200
commit0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch)
tree198d4ff7665d89307f6ca2469fa38620a9eb1672 /drivers/alsa
parent07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff)
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
Diffstat (limited to 'drivers/alsa')
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index 895a746b20..414b0c28e0 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -252,8 +252,9 @@ Array AudioDriverALSA::get_device_list() {
void **hints;
- if (snd_device_name_hint(-1, "pcm", &hints) < 0)
+ if (snd_device_name_hint(-1, "pcm", &hints) < 0) {
return list;
+ }
for (void **n = hints; *n != nullptr; n++) {
char *name = snd_device_name_get_hint(*n, "NAME");
@@ -267,10 +268,12 @@ Array AudioDriverALSA::get_device_list() {
}
}
- if (desc != nullptr)
+ if (desc != nullptr) {
free(desc);
- if (name != nullptr)
+ }
+ if (name != nullptr) {
free(name);
+ }
}
snd_device_name_free_hint(hints);
@@ -288,14 +291,16 @@ void AudioDriverALSA::set_device(String device) {
}
void AudioDriverALSA::lock() {
- if (!thread)
+ if (!thread) {
return;
+ }
mutex.lock();
}
void AudioDriverALSA::unlock() {
- if (!thread)
+ if (!thread) {
return;
+ }
mutex.unlock();
}