[Spice-devel] [PATCH] Amend patch 7/7

Jonathon Jongsma jjongsma at redhat.com
Fri Apr 7 20:06:55 UTC 2017


---
 server/sound.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/sound.c b/server/sound.c
index eb0220f..275248c 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -317,13 +317,17 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s
 static
 const char* spice_audio_data_mode_to_string(gint mode)
 {
-    static const char *str[] = {
+    static const char * const str[] = {
         [ SPICE_AUDIO_DATA_MODE_INVALID ] = "invalid",
         [ SPICE_AUDIO_DATA_MODE_RAW ] = "raw",
         [ SPICE_AUDIO_DATA_MODE_CELT_0_5_1 ] = "celt",
         [ SPICE_AUDIO_DATA_MODE_OPUS ] = "opus",
     };
-    return (mode >= 0 && mode < G_N_ELEMENTS(str)) ? str[mode] : "unknown audio codec";
+    if (mode >= 0 && mode < G_N_ELEMENTS(str)) {
+        return str[mode];
+    }
+
+    return "unknown audio codec";
 }
 
 static bool
-- 
2.9.3



More information about the Spice-devel mailing list