[gnome-builder/wip/chergert/bug1: 57/101] gdb: use switch for future warnings



commit fb5d3cf40e7307335aac15fb1e2086b07355bb56
Author: Christian Hergert <chergert redhat com>
Date:   Mon Aug 28 12:24:40 2017 -0700

    gdb: use switch for future warnings
    
    In case something new is added, we want a warning.

 plugins/gdb/gbp-gdb-debugger.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/plugins/gdb/gbp-gdb-debugger.c b/plugins/gdb/gbp-gdb-debugger.c
index ab43a57..1ab9424 100644
--- a/plugins/gdb/gbp-gdb-debugger.c
+++ b/plugins/gdb/gbp-gdb-debugger.c
@@ -758,17 +758,26 @@ gbp_gdb_debugger_handle_oob (GbpGdbDebugger           *self,
 
     case GDBWIRE_MI_STREAM:
       {
-        IdeDebuggerStream stream = IDE_DEBUGGER_EVENT_LOG;
+        IdeDebuggerStream stream;
         g_autoptr(GBytes) content = NULL;
         const gchar *data;
         gsize len;
 
-        if (output->variant.oob_record->variant.stream_record->kind == GDBWIRE_MI_CONSOLE)
-          stream = IDE_DEBUGGER_CONSOLE;
-        else if (output->variant.oob_record->variant.stream_record->kind == GDBWIRE_MI_LOG)
-          stream = IDE_DEBUGGER_EVENT_LOG;
-        else if (output->variant.oob_record->variant.stream_record->kind == GDBWIRE_MI_TARGET)
-          stream = IDE_DEBUGGER_TARGET;
+        switch (output->variant.oob_record->variant.stream_record->kind)
+          {
+          case GDBWIRE_MI_CONSOLE:
+            stream = IDE_DEBUGGER_CONSOLE;
+            break;
+
+          case GDBWIRE_MI_TARGET:
+            stream = IDE_DEBUGGER_TARGET;
+            break;
+
+          case GDBWIRE_MI_LOG:
+          default:
+            stream = IDE_DEBUGGER_EVENT_LOG;
+            break;
+          }
 
         data = output->variant.oob_record->variant.stream_record->cstring;
         len = strlen (data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]