[cluttermm] init(): Check clutter_init() result to avoid compiler warning.



commit 31e074365ab34bde32b7b37a580ff58b962c284c
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Apr 9 19:41:06 2014 +0200

    init(): Check clutter_init() result to avoid compiler warning.

 clutter/cluttermm/init.cc |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/clutter/cluttermm/init.cc b/clutter/cluttermm/init.cc
index 87b6846..ced68c8 100644
--- a/clutter/cluttermm/init.cc
+++ b/clutter/cluttermm/init.cc
@@ -40,8 +40,12 @@ void init(int* argc, gchar **argv[])
 {
   common_init();
   GError* error = NULL;
-  clutter_init_with_args(argc, argv, NULL, NULL, NULL, &error);
-  if(error != NULL) Glib::Error::throw_exception(error);
+  const ClutterInitError result = clutter_init_with_args(argc, argv, NULL, NULL, NULL, &error);
+  if(error)
+    Glib::Error::throw_exception(error);
+
+  if(result != CLUTTER_INIT_SUCCESS)
+    throw Glib::Error(); //This should never happen. The GError should always be set.
 }
 
 void init(int& argc, gchar**& argv)


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