[couchdb-glib] Fixed several compilation warnings



commit 0e759ecbf54ac8f25432cae87dc193f90ccf44f8
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Fri Jul 9 12:08:15 2010 +0200

    Fixed several compilation warnings

 couchdb-glib/couchdb-database-info.c    |    2 +-
 couchdb-glib/couchdb-database.c         |    3 +--
 couchdb-glib/couchdb-design-document.c  |    4 +++-
 couchdb-glib/couchdb-document-contact.c |    4 ----
 couchdb-glib/couchdb-document.c         |    4 +---
 couchdb-glib/couchdb-session.c          |    4 ++--
 couchdb-glib/utils.h                    |    1 +
 tests/test-couchdb-glib.c               |    2 +-
 tests/test-list-databases.c             |    4 ++--
 9 files changed, 12 insertions(+), 16 deletions(-)
---
diff --git a/couchdb-glib/couchdb-database-info.c b/couchdb-glib/couchdb-database-info.c
index 0ea93ce..d3c92ce 100644
--- a/couchdb-glib/couchdb-database-info.c
+++ b/couchdb-glib/couchdb-database-info.c
@@ -94,7 +94,7 @@ couchdb_database_info_new (const char *dbname,
 	dbinfo->disk_size = disk_size;
 	dbinfo->disk_format_version = disk_format_version;
 	dbinfo->purge_seq = purge_seq;
-	dbinfo->instance_start_time;
+	dbinfo->instance_start_time = instance_start_time;
 
 	return dbinfo;
 }
diff --git a/couchdb-glib/couchdb-database.c b/couchdb-glib/couchdb-database.c
index 0b429ba..81a12ed 100644
--- a/couchdb-glib/couchdb-database.c
+++ b/couchdb-glib/couchdb-database.c
@@ -348,7 +348,7 @@ couchdb_database_get_design_documents (CouchdbDatabase *database, GError **error
 
 			document = couchdb_design_document_new ();
 			if (document != NULL) {
-				couchdb_document_set_from_json_object (document, obj);
+				couchdb_document_set_from_json_object (COUCHDB_DOCUMENT (document), obj);
 				doclist = g_slist_append (doclist, document);
 			}
 		}
@@ -695,7 +695,6 @@ couchdb_database_delete_document (CouchdbDatabase *database, CouchdbDocument *do
 {
 	const char *id, *revision;
 	char *url;
-	JsonParser *parser;
 	gboolean result = FALSE;
 
 	g_return_val_if_fail (COUCHDB_IS_DATABASE (database), FALSE);
diff --git a/couchdb-glib/couchdb-design-document.c b/couchdb-glib/couchdb-design-document.c
index f5e6966..d332d81 100644
--- a/couchdb-glib/couchdb-design-document.c
+++ b/couchdb-glib/couchdb-design-document.c
@@ -160,7 +160,7 @@ couchdb_design_document_delete_view (CouchdbDesignDocument *document,
 
 	json_object = couchdb_document_get_json_object (COUCHDB_DOCUMENT (document));
 	if (json_object != NULL) {
-		JsonObject *json_views, *this_view;
+		JsonObject *json_views;
 
 		json_views = json_object_get_object_member (json_object, "views");
 		if (json_views != NULL && json_object_has_member (json_views, name))
@@ -223,6 +223,8 @@ couchdb_design_document_set_language (CouchdbDesignDocument *document,
 		case COUCHDB_DESIGN_DOCUMENT_LANGUAGE_PYTHON:
 			json_object_set_string_member (json_object, "language", "python");
 			break;
+		default:
+			break;
 		}
 	}
 }
diff --git a/couchdb-glib/couchdb-document-contact.c b/couchdb-glib/couchdb-document-contact.c
index 2021a1f..b62a93d 100644
--- a/couchdb-glib/couchdb-document-contact.c
+++ b/couchdb-glib/couchdb-document-contact.c
@@ -182,8 +182,6 @@ couchdb_document_contact_set_spouse_name (CouchdbDocumentContact *document, cons
 const char *
 couchdb_document_contact_get_birth_date (CouchdbDocumentContact *document)
 {
-	JsonObject *object;
-
 	g_return_val_if_fail (COUCHDB_IS_DOCUMENT_CONTACT (document), NULL);
 	g_return_val_if_fail (couchdb_document_is_contact (COUCHDB_DOCUMENT (document)), NULL);
 
@@ -203,8 +201,6 @@ couchdb_document_contact_set_birth_date (CouchdbDocumentContact *document, const
 const char *
 couchdb_document_contact_get_wedding_date (CouchdbDocumentContact *document)
 {
-	JsonObject *object;
-
 	g_return_val_if_fail (COUCHDB_IS_DOCUMENT_CONTACT (document), NULL);
 	g_return_val_if_fail (couchdb_document_is_contact (COUCHDB_DOCUMENT (document)), NULL);
 
diff --git a/couchdb-glib/couchdb-document.c b/couchdb-glib/couchdb-document.c
index d8e3921..e5f162c 100644
--- a/couchdb-glib/couchdb-document.c
+++ b/couchdb-glib/couchdb-document.c
@@ -268,8 +268,6 @@ couchdb_document_set_revision (CouchdbDocument *document, const char *revision)
 gboolean
 couchdb_document_has_field (CouchdbDocument *document, const char *field)
 {
-	JsonNode *node;
-
 	g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), FALSE);
 	g_return_val_if_fail (field != NULL, FALSE);
 
@@ -554,7 +552,7 @@ couchdb_document_foreach_attachment (CouchdbDocument *document,
 {
 	CouchdbStructField *attachments;
 
-	g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
+	g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
 
 	attachments = couchdb_document_get_struct_field (document, "_attachments");
 	if (attachments != NULL) {
diff --git a/couchdb-glib/couchdb-session.c b/couchdb-glib/couchdb-session.c
index 362ab91..4e8841e 100644
--- a/couchdb-glib/couchdb-session.c
+++ b/couchdb-glib/couchdb-session.c
@@ -708,7 +708,7 @@ couchdb_session_send_message (CouchdbSession *session, const char *method, const
 	if (error != NULL)
 		real_error = error;
 	else
-		*real_error = NULL;
+		real_error = NULL;
 
 	http_message = soup_message_new (method, url);
 	if (body != NULL) {
@@ -759,7 +759,7 @@ debug_message (const gchar *log_domain, GLogLevelFlags log_level,
 
 	couchdb_env_debug_messages = g_getenv(COUCHDB_ENV_DEBUG_MESSAGES);
 	if (couchdb_env_debug_messages != NULL) {
-		g_printf ("couchdb-glib:DEBUG: %s\n", message);
+		g_print ("couchdb-glib:DEBUG: %s\n", message);
 	}
 }
 #endif
diff --git a/couchdb-glib/utils.h b/couchdb-glib/utils.h
index 4ecf494..6aa8ce3 100644
--- a/couchdb-glib/utils.h
+++ b/couchdb-glib/utils.h
@@ -47,6 +47,7 @@ gboolean            couchdb_session_send_message (CouchdbSession *session,
 						  GError **error);
 
 CouchdbDocument    *couchdb_document_new_from_json_object (JsonObject *json_object);
+void                couchdb_document_set_from_json_object (CouchdbDocument *document, JsonObject *json_object);
 JsonObject*	    couchdb_document_get_json_object	(CouchdbDocument *document);
 
 CouchdbArrayField  *couchdb_array_field_new_from_json_array (JsonArray *json_array);
diff --git a/tests/test-couchdb-glib.c b/tests/test-couchdb-glib.c
index 6f347fa..cdd8634 100644
--- a/tests/test-couchdb-glib.c
+++ b/tests/test-couchdb-glib.c
@@ -292,7 +292,7 @@ main (int argc, char *argv[])
 
 	/* Initialize data needed for all tests */
 	couchdb =  argc > 1 ? couchdb_session_new (argv[1]) : couchdb_session_new ("http://test:test 127 0 0 1:5985");
-	g_printf ("Connecting to Couchdb at %s\n", couchdb_session_get_uri (couchdb));
+	g_print ("Connecting to Couchdb at %s\n", couchdb_session_get_uri (couchdb));
 	
 	if (!couchdb) {
 		g_print ("Could not create Couchdb object\n");
diff --git a/tests/test-list-databases.c b/tests/test-list-databases.c
index 1b3debb..e4d0c6a 100644
--- a/tests/test-list-databases.c
+++ b/tests/test-list-databases.c
@@ -34,7 +34,7 @@ main (int argc, char *argv[])
 
 	/* Initialize Couchdb */
 	couchdb =  argc > 1 ? couchdb_session_new (argv[1]) : couchdb_session_new (NULL);
-	g_printf ("Connecting to Couchdb at %s\n", couchdb_session_get_uri (couchdb));
+	g_print ("Connecting to Couchdb at %s\n", couchdb_session_get_uri (couchdb));
 	
 	if (!couchdb) {
 		g_print ("Could not create Couchdb object\n");
@@ -80,7 +80,7 @@ main (int argc, char *argv[])
 		g_assert (database != NULL);
 
 		error = NULL;
-		doclist = couchdb_database_list_documents (couchdb, &error);
+		doclist = couchdb_database_list_documents (database, &error);
 		if (doclist) {
 			GSList *sl_doc;
 



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