[phonemgr] Fix usage of gn_cfg_memory_read() and gn_cfg_phone_load()



commit ba69e2341613bc44e8f2fb4d5241f9386aaa6a13
Author: Daniele Forsi <dforsi src gnome org>
Date:   Thu Feb 23 13:36:03 2012 +0100

    Fix usage of gn_cfg_memory_read() and gn_cfg_phone_load()
    
    Return value is a gn_error.
    Fixes clang warnings:
    ./phonemgr/libgsm/phonemgr-utils.c:525:48: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
            if (gn_cfg_memory_read ((const char **)lines) < 0) {
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
    ./phonemgr/libgsm/phonemgr-utils.c:535:36: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]
            if (gn_cfg_phone_load("", &state) < 0) {
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

 libgsm/phonemgr-utils.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/libgsm/phonemgr-utils.c b/libgsm/phonemgr-utils.c
index a7eb0f2..4e62e10 100644
--- a/libgsm/phonemgr-utils.c
+++ b/libgsm/phonemgr-utils.c
@@ -522,8 +522,11 @@ phonemgr_utils_connect (const char *device, const char *driver, int channel, gbo
 		g_free (config);
 	}
 
-	if (gn_cfg_memory_read ((const char **)lines) < 0) {
-		g_warning ("gn_cfg_memory_read");
+	err = gn_cfg_memory_read ((const char **)lines);
+	if (err != GN_ERR_NONE) {
+		PhoneMgrError perr;
+		g_warning ("gn_cfg_memory_read: %s",
+			   phonemgr_utils_gn_error_to_string (err, &perr));
 		g_strfreev (lines);
 		return NULL;
 	}
@@ -532,8 +535,11 @@ phonemgr_utils_connect (const char *device, const char *driver, int channel, gbo
 	memset (&data, 0, sizeof (data));
 	phonemgr_utils_gn_statemachine_clear (&state);
 
-	if (gn_cfg_phone_load("", &state) < 0) {
-		g_warning ("gn_cfg_phone_load");
+	err = gn_cfg_phone_load ("", &state);
+	if (err != GN_ERR_NONE) {
+		PhoneMgrError perr;
+		g_warning ("gn_cfg_phone_load: %s",
+			   phonemgr_utils_gn_error_to_string (err, &perr));
 		return NULL;
 	}
 



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