[gnome-shell] recorder: Rewrite switch statement
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] recorder: Rewrite switch statement
- Date: Wed, 23 Sep 2015 19:55:43 +0000 (UTC)
commit 82f84416a9d3f2d983e9207cebcae9e11b50b6ff
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Sep 23 20:43:42 2015 +0200
recorder: Rewrite switch statement
Avoid compiler warnings about unhandled enum values by using a
regular if-else statement.
src/shell-recorder.c | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/src/shell-recorder.c b/src/shell-recorder.c
index b28e1e9..e6d4377 100644
--- a/src/shell-recorder.c
+++ b/src/shell-recorder.c
@@ -1182,23 +1182,20 @@ recorder_pipeline_bus_watch (GstBus *bus,
{
RecorderPipeline *pipeline = data;
- switch (message->type)
+ if (message->type == GST_MESSAGE_EOS)
{
- case GST_MESSAGE_EOS:
recorder_pipeline_closed (pipeline);
return FALSE; /* remove watch */
- case GST_MESSAGE_ERROR:
- {
- GError *error;
-
- gst_message_parse_error (message, &error, NULL);
- g_warning ("Error in recording pipeline: %s\n", error->message);
- g_error_free (error);
- recorder_pipeline_closed (pipeline);
- return FALSE; /* remove watch */
- }
- default:
- break;
+ }
+ else if (message->type == GST_MESSAGE_ERROR)
+ {
+ GError *error;
+
+ gst_message_parse_error (message, &error, NULL);
+ g_warning ("Error in recording pipeline: %s\n", error->message);
+ g_error_free (error);
+ recorder_pipeline_closed (pipeline);
+ return FALSE; /* remove watch */
}
/* Leave the watch in place */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]