[maemo-commits] [maemo-commits] r18590 - projects/connectivity/maemo-bluez-compat/trunk/src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jun 3 17:12:16 EEST 2009
Author: jh
Date: 2009-06-03 17:12:14 +0300 (Wed, 03 Jun 2009)
New Revision: 18590

Modified:
   projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.c
   projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.h
Log:
Initial coding style cleanup for the new C-code

Modified: projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.c
===================================================================
--- projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.c	2009-06-03 14:04:15 UTC (rev 18589)
+++ projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.c	2009-06-03 14:12:14 UTC (rev 18590)
@@ -23,16 +23,18 @@
 	GError *error = NULL;
 	const gchar* adapter_path;
 
-	if (!dbus_g_proxy_call(manager, "DefaultAdapter", &error, G_TYPE_INVALID,
-		DBUS_TYPE_G_OBJECT_PATH, &adapter_path, G_TYPE_INVALID)) {
+	if (!dbus_g_proxy_call(manager, "DefaultAdapter", &error,
+				G_TYPE_INVALID,
+				DBUS_TYPE_G_OBJECT_PATH, &adapter_path,
+				G_TYPE_INVALID)) {
 
 		g_debug("Couldn't get DefaultAdapter: %s", error->message);
 		g_error_free(error);
 		return NULL;
 	}
 
-	return dbus_g_proxy_new_for_name(connection, BLUEZ_SERVICE, adapter_path,
-						BLUEZ_ADAPTER_INTERFACE);
+	return dbus_g_proxy_new_for_name(connection, BLUEZ_SERVICE,
+					adapter_path, BLUEZ_ADAPTER_INTERFACE);
 }
 
 void adapter_set_property_string(DBusGProxy* adapter, const gchar* attribute,
@@ -50,6 +52,7 @@
 		g_debug("Couldn't set string Properties: %s", error->message);
 		g_error_free(error);
 	}
+
 	g_value_unset(&g_value);
 }
 
@@ -59,9 +62,12 @@
 	GHashTable *table;
 	GError *error = NULL;
 	GValue *value;
+
 	if (dbus_g_proxy_call(adapter, "GetProperties", &error, G_TYPE_INVALID,
-		dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE),
-		&table, G_TYPE_INVALID) != FALSE) {
+					dbus_g_type_get_map("GHashTable",
+								G_TYPE_STRING,
+								G_TYPE_VALUE),
+					&table, G_TYPE_INVALID) != FALSE) {
 		value = g_hash_table_lookup(table, attribute);
 		return g_value_get_string(value);
 	} else {
@@ -86,6 +92,7 @@
 		g_debug("Couldn't set boolean Properties: %s", error->message);
 		g_error_free(error);
 	}
+
 	g_value_unset(&g_value);
 }
 
@@ -94,14 +101,15 @@
 {
 	GHashTable *table;
 	GError *error = NULL;
-	gboolean ret;
 	GValue *value;
-	if (dbus_g_proxy_call (adapter, "GetProperties", &error, G_TYPE_INVALID,
-			dbus_g_type_get_map ("GHashTable", G_TYPE_STRING,
-			G_TYPE_VALUE), &table, G_TYPE_INVALID) != FALSE) {
+
+	if (dbus_g_proxy_call(adapter, "GetProperties", &error, G_TYPE_INVALID,
+					dbus_g_type_get_map ("GHashTable",
+								G_TYPE_STRING,
+								G_TYPE_VALUE),
+					&table, G_TYPE_INVALID) != FALSE) {
 		value = g_hash_table_lookup(table, attribute);
-		ret = g_value_get_boolean(value);
-		return ret;
+		return g_value_get_boolean(value);
 	} else {
 		g_debug("Couldn't get boolean Properties: %s", error->message);
 		g_error_free(error);
@@ -122,9 +130,9 @@
 				attribute, G_TYPE_VALUE, &g_value,
 				G_TYPE_INVALID, G_TYPE_INVALID) != TRUE) {
 		g_debug("Couldn't set int Properties: %s", error->message);
-		if (error != NULL)
-			g_error_free(error);
+		g_error_free(error);
 	}
+
 	g_value_unset(&g_value);
 }
 
@@ -132,18 +140,18 @@
 {
 	GHashTable *table;
 	GError *error = NULL;
-	guint ret;
 	GValue *value;
+
 	if (dbus_g_proxy_call(adapter, "GetProperties", &error, G_TYPE_INVALID,
-			dbus_g_type_get_map("GHashTable", G_TYPE_STRING,
-			G_TYPE_VALUE), &table, G_TYPE_INVALID) != FALSE) {
+					dbus_g_type_get_map("GHashTable",
+								G_TYPE_STRING,
+								G_TYPE_VALUE),
+					&table, G_TYPE_INVALID) != FALSE) {
 		value = g_hash_table_lookup(table, attribute);
-		ret = g_value_get_uint(value);
-		return ret;
+		return g_value_get_uint(value);
 	} else {
 		g_debug("Couldn't get int Properties: %s", error->message);
-		if (error != NULL)
-			g_error_free(error);
+		g_error_free(error);
 		return 0;
 	}
 }
@@ -153,19 +161,18 @@
 {
 	GHashTable *table;
 	GError *error = NULL;
-	GPtrArray *ret;
 	GValue *value;
+
 	if (dbus_g_proxy_call(adapter, "GetProperties", &error, G_TYPE_INVALID,
-			dbus_g_type_get_map("GHashTable", G_TYPE_STRING,
-			G_TYPE_VALUE), &table, G_TYPE_INVALID) != FALSE) {
+					dbus_g_type_get_map("GHashTable",
+								G_TYPE_STRING,
+								G_TYPE_VALUE),
+					&table, G_TYPE_INVALID) != FALSE) {
 		value = g_hash_table_lookup(table, attribute);
-		ret = g_value_get_boxed(value);
-		return ret;
+		return g_value_get_boxed(value);
 	} else {
 		g_debug("Couldn't get object array Properties: %s",
-			error->message);
-		if (error != NULL)
-			g_error_free(error);
+							error->message);
 		return NULL;
 	}
 }

Modified: projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.h
===================================================================
--- projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.h	2009-06-03 14:04:15 UTC (rev 18589)
+++ projects/connectivity/maemo-bluez-compat/trunk/src/dbus-common.h	2009-06-03 14:12:14 UTC (rev 18590)
@@ -1,4 +1,3 @@
-
 #ifndef DBUS_COMMON_H
 #define DBUS_COMMON_H
 
@@ -9,14 +8,15 @@
 DBusGProxy* manager_get_default_adapter(DBusGProxy *manager,
 					DBusGConnection *connection);
 void adapter_set_property_string(DBusGProxy* adapter, const gchar* attribute,
-					const gchar* value);
+							const gchar* value);
 const gchar* adapter_get_property_string(DBusGProxy* adapter,
 					const gchar* attribute);
-gboolean adapter_get_property_boolean(DBusGProxy* adapter, const gchar* attribute);
+gboolean adapter_get_property_boolean(DBusGProxy* adapter,
+					const gchar* attribute);
 void adapter_set_property_boolean(DBusGProxy* adapter, const gchar* attribute,
-					const gboolean value);
+							const gboolean value);
 void adapter_set_property_uint(DBusGProxy* adapter, const gchar* attribute,
-					guint value);
+								guint value);
 guint adapter_get_property_uint(DBusGProxy* adapter,const gchar* attribute);
 GPtrArray* adapter_get_property_objectpath_array(DBusGProxy* adapter,
 						const gchar* attribute);


More information about the maemo-commits mailing list