Fix all compilation warnings
authorAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 28 Jan 2013 23:04:01 +0000 (01:04 +0200)
committerAlexander Kanavin <alex.kanavin@gmail.com>
Mon, 28 Jan 2013 23:04:01 +0000 (01:04 +0200)
src/common/db/gsignond-db-error.c
src/common/db/gsignond-db-secret-database.c
src/common/gsignond-plugin-loader.c
src/daemon/db/gsignond-db-credentials-database.c
src/plugins/password/gsignond-password-plugin.c
test/db/dbtest.c

index 282f337..20995ed 100644 (file)
@@ -52,7 +52,7 @@ gsignond_db_create_error (
 
     error = g_error_new (GSIGNOND_DB_ERROR,
                          code,
-                         msg);
+                         "%s", msg);
     return error;
 }
 
index 0375c0a..da4dedd 100644 (file)
@@ -23,6 +23,7 @@
  * 02110-1301 USA
  */
 #include <sqlite3.h>
+#include <string.h>
 
 #include "gsignond/gsignond-log.h"
 #include "gsignond-db-error.h"
index b746f0e..cd7e2c0 100644 (file)
@@ -41,15 +41,16 @@ gsignond_load_plugin(GSignondConfig* config, gchar* plugin_type)
     g_free(plugin_filename);
     if (plugin_module == NULL) {
         DBG("Plugin couldn't be opened");
-        return;
+        return NULL;
     }
     
     gchar* plugin_get_type = g_strdup_printf("gsignond_%s_plugin_get_type",
         plugin_type);
-    GType (*plugin_get_type_f)(void);
+    gpointer p;
+
     DBG("Resolving symbol %s", plugin_get_type);
     gboolean symfound = g_module_symbol (plugin_module,
-        plugin_get_type, &plugin_get_type_f);
+        plugin_get_type, &p);
     g_free(plugin_get_type);
     g_module_close (plugin_module);
     if (!symfound) {
@@ -58,6 +59,7 @@ gsignond_load_plugin(GSignondConfig* config, gchar* plugin_type)
     }
     
     DBG("Creating plugin object");
+    GType (*plugin_get_type_f)(void) = p;
     GSignondPlugin* plugin = g_object_new(plugin_get_type_f(), NULL);
     if (plugin == NULL) {
         DBG("Plugin couldn't be created");
index 0238f98..213aca2 100644 (file)
@@ -766,7 +766,7 @@ gsignond_db_credentials_database_get_owner_list(
 }
 
 /**
- * gsignond_db_credentials_database_get_owner:
+ * gsignond_db_credentials_database_get_identity_owner:
  *
  * @self: instance of #GSignondDbCredentialsDatabase
  * @identity_id: the id of the identity whose owner is needed
@@ -778,7 +778,7 @@ gsignond_db_credentials_database_get_owner_list(
  * gsignond_identity_info_free
  */
 GSignondSecurityContext *
-gsignond_db_credentials_database_get_owner (
+gsignond_db_credentials_database_get_identity_owner (
                GSignondDbCredentialsDatabase *self,
         const guint32 identity_id)
 {
index 2388d59..d741bcc 100644 (file)
@@ -100,13 +100,11 @@ static void gsignond_password_plugin_user_action_finished (
         gsignond_plugin_error (self, error); 
         g_error_free(error);
     } else {
-        gchar* error_message = g_strdup_printf("userActionFinished error: %d",
-                                               query_error);
         GError* error = g_error_new(GSIGNOND_ERROR, 
                                 GSIGNOND_ERROR_USER_INTERACTION,
-                                error_message);
+                                "userActionFinished error: %d",
+                                query_error);
         gsignond_plugin_error (self, error); 
-        g_free(error_message);
         g_error_free(error);
     }
 }
@@ -192,4 +190,4 @@ gsignond_password_plugin_class_init (GSignondPasswordPluginClass *klass)
     g_object_class_override_property (gobject_class, PROP_TYPE, "type");
     g_object_class_override_property (gobject_class, PROP_MECHANISMS, 
                                       "mechanisms");
-}
\ No newline at end of file
+}
index 1c569f5..04c4b89 100644 (file)
@@ -632,7 +632,7 @@ START_TEST (test_credentials_database)
     fail_if (owners == NULL);
     gsignond_security_context_list_free (owners);
 
-    owner = gsignond_db_credentials_database_get_owner (
+    owner = gsignond_db_credentials_database_get_identity_owner (
             credentials_db, identity_id);
     fail_if (owner == NULL);
     gsignond_security_context_free (owner);