From 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 16:41:43 +0200 Subject: 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 --- drivers/alsa/audio_driver_alsa.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'drivers/alsa') 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(); } -- cgit v1.2.3