audio: Add braces for statements/fix braces' position
Fix problems about braces:
-braces are necessary for all arms of if/for/while statements
-else should follow close brace '}'
Signed-off-by: Zhang Han <zhanghan64@huawei.com>
Message-id: 20210115012431.79533-1-zhanghan64@huawei.com
Message-Id: <20210115012431.79533-2-zhanghan64@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
diff --git a/audio/audio.c b/audio/audio.c
index 34c9cb9..6734c8a 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -344,8 +344,7 @@
if (info->is_signed || info->is_float) {
memset(buf, 0x00, len * info->bytes_per_frame);
- }
- else {
+ } else {
switch (info->bits) {
case 8:
memset(buf, 0x80, len * info->bytes_per_frame);
@@ -584,8 +583,7 @@
rpos = hw->conv_buf->pos - live;
if (rpos >= 0) {
return rpos;
- }
- else {
+ } else {
return hw->conv_buf->size + rpos;
}
}
@@ -788,10 +786,14 @@
HWVoiceOut *hwo = NULL;
while ((hwo = audio_pcm_hw_find_any_enabled_out(s, hwo))) {
- if (!hwo->poll_mode) return 1;
+ if (!hwo->poll_mode) {
+ return 1;
+ }
}
while ((hwi = audio_pcm_hw_find_any_enabled_in(s, hwi))) {
- if (!hwi->poll_mode) return 1;
+ if (!hwi->poll_mode) {
+ return 1;
+ }
}
return 0;
}
@@ -908,8 +910,7 @@
audio_reset_timer (s);
}
}
- }
- else {
+ } else {
if (hw->enabled) {
int nb_active = 0;
@@ -956,8 +957,7 @@
}
}
sw->total_hw_samples_acquired = hw->total_samples_captured;
- }
- else {
+ } else {
if (hw->enabled) {
int nb_active = 0;
@@ -1532,8 +1532,7 @@
audio_init_nb_voices_in(s, drv);
s->drv = drv;
return 0;
- }
- else {
+ } else {
if (msg) {
dolog("Could not init `%s' audio driver\n", drv->name);
}
@@ -1848,8 +1847,7 @@
if (cap) {
QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
return cap;
- }
- else {
+ } else {
HWVoiceOut *hw;
CaptureVoiceOut *cap;