common: Fix warning and build failures
diff --git a/common/connman-agent.c b/common/connman-agent.c
index ef9ed1c..49ed0c7 100644
--- a/common/connman-agent.c
+++ b/common/connman-agent.c
@@ -52,22 +52,6 @@
 
 #define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
 
-static GType agent_error_get_type(void)
-{
-	static GType etype = 0;
-	if (etype == 0) {
-		static const GEnumValue values[] = {
-			ENUM_ENTRY(AGENT_ERROR_REJECT, "Rejected"),
-			ENUM_ENTRY(AGENT_ERROR_RETRY, "Retry"),
-			{ 0, 0, 0 }
-		};
-
-		etype = g_enum_register_static("Agent", values);
-	}
-
-	return etype;
-}
-
 typedef struct _ConnmanAgentPrivate ConnmanAgentPrivate;
 
 typedef struct _PendingRequest PendingRequest;
@@ -146,23 +130,11 @@
 	return FALSE;
 }
 
-static gboolean connman_agent_request_input_cb(const GHashTable *reply, gpointer user_data)
-{
-
-	PendingRequest *pendingrequest = user_data;
-
-	dbus_g_method_return(pendingrequest->context, reply);
-
-	g_free(pendingrequest);
-	return FALSE;
-}
-
-gboolean connman_agent_report_error(ConnmanAgent *agent,
-                                    const char *path, const char *error,
-                                    DBusGMethodInvocation *context)
+static gboolean connman_agent_report_error(ConnmanAgent *agent,
+					   const char *path, const char *error,
+					   DBusGMethodInvocation *context)
 {
 	GError *result;
-	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
 
 	debug(agent, "connection %s, reports an error: %s", path, error);
 	result = g_error_new(AGENT_ERROR, AGENT_ERROR_RETRY,
@@ -173,13 +145,12 @@
 	return FALSE;
 }
 
-gboolean connman_agent_request_input(ConnmanAgent *agent,
-                                     const char *path, GHashTable *fields,
-                                     DBusGMethodInvocation *context)
+static gboolean connman_agent_request_input(ConnmanAgent *agent,
+					    const char *path, GHashTable *fields,
+					    DBusGMethodInvocation *context)
 {
 	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
 	const char *sender = dbus_g_method_get_sender(context);
-	char *name = NULL, *type = NULL;
 	char **id = NULL;
 	PendingRequest *pendingrequest = NULL;
 
@@ -202,8 +173,8 @@
 	return FALSE;
 }
 
-gboolean connman_agent_cancel(ConnmanAgent *agent,
-                              DBusGMethodInvocation *context)
+static gboolean connman_agent_cancel(ConnmanAgent *agent,
+				     DBusGMethodInvocation *context)
 {
 	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
 	const char *sender = dbus_g_method_get_sender(context);
@@ -220,8 +191,8 @@
 	return result;
 }
 
-gboolean connman_agent_release(ConnmanAgent *agent,
-                               DBusGMethodInvocation *context)
+static gboolean connman_agent_release(ConnmanAgent *agent,
+				      DBusGMethodInvocation *context)
 {
 	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
 	const char *sender = dbus_g_method_get_sender(context);
@@ -323,10 +294,8 @@
 gboolean connman_agent_register(ConnmanAgent *agent)
 {
 	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
-	DBusGProxy *proxy;
 	GObject *object;
 	GError *error = NULL;
-	gchar *path;
 
 	debug(agent, "register agent %p", agent);
 
@@ -407,20 +376,3 @@
 	priv->cancel_func = func;
 	priv->cancel_data = data;
 }
-
-void connman_agent_set_release_func(ConnmanAgent *agent,
-                                    ConnmanAgentReleaseFunc func, gpointer data)
-{
-	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
-
-	priv->release_func = func;
-	priv->release_data = data;
-}
-
-void connman_agent_set_debug_func(ConnmanAgent *agent, ConnmanAgentDebugFunc func, gpointer data)
-{
-	ConnmanAgentPrivate *priv = CONNMAN_AGENT_GET_PRIVATE(agent);
-
-	priv->debug_func = func;
-	priv->debug_data = data;
-}
diff --git a/common/connman-client.c b/common/connman-client.c
index 94c9df9..c55e25c 100644
--- a/common/connman-client.c
+++ b/common/connman-client.c
@@ -252,7 +252,7 @@
 	return model;
 }
 
-void hash_table_value_string_insert( GHashTable *hash, gpointer key, const char *str )
+static void hash_table_value_string_insert( GHashTable *hash, gpointer key, const char *str )
 {
 	GValue *itemvalue;
 
@@ -301,6 +301,7 @@
 {
 	ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
 	DBusGProxy *proxy;
+	GError *error;
 	GValue value = { 0 };
 
 	DBG("client %p device %s", client, device);
@@ -315,8 +316,8 @@
 	g_value_init(&value, G_TYPE_BOOLEAN);
 	g_value_set_boolean(&value, powered);
 
-	GError *error = NULL;
-	gboolean ret = connman_set_property(proxy, "Powered", &value, &error);
+	error = NULL;
+	connman_set_property(proxy, "Powered", &value, &error);
 	if( error )
 		fprintf (stderr, "error: %s\n", error->message);
 
diff --git a/common/connman-dbus.c b/common/connman-dbus.c
index c4f6ae4..33ac623 100644
--- a/common/connman-dbus.c
+++ b/common/connman-dbus.c
@@ -535,7 +535,7 @@
 static void manager_services(DBusGProxy *proxy, GPtrArray *array,
 					GError *error, gpointer user_data)
 {
-	int i;
+	unsigned int i;
 
 	DBG("proxy %p array %p", proxy, array);
 
@@ -544,6 +544,7 @@
 
 	for (i = 0; i < array->len; i++)
 	{
+		GHashTable *props;
 		GValueArray *item = g_ptr_array_index(array, i);
 
 		DBusGObjectPath *path = (DBusGObjectPath *)g_value_get_boxed(g_value_array_get_nth(item, 0));
@@ -553,7 +554,7 @@
 		if (service_proxy == NULL)
 			continue;
 
-		GHashTable *props = (GHashTable *)g_value_get_boxed(g_value_array_get_nth(item, 1));
+		props = (GHashTable *)g_value_get_boxed(g_value_array_get_nth(item, 1));
 		service_properties(service_proxy, props, user_data);
 	}
 }
@@ -561,7 +562,7 @@
 static void manager_technologies(DBusGProxy *proxy, GPtrArray *array,
 					GError *error, gpointer user_data)
 {
-	int i;
+	unsigned int i;
 
 	DBG("proxy %p array %p", proxy, array);
 
@@ -592,7 +593,7 @@
 {
 	GtkTreeStore *store = user_data;
 	GtkTreeIter iter;
-	int i;
+	unsigned int i;
 
 	DBG("store %p proxy %p array %p", store, proxy, array);