[libgsf] Cleanups.



commit ef252712777ed885193fe7d557f88fa45d6a3497
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 5 11:43:02 2013 -0500

    Cleanups.

 ChangeLog            |    4 ++++
 gsf/gsf-output-gio.c |   10 ++--------
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e97c509..a468d3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-01-05  Morten Welinder  <terra gnome org>
 
+	* gsf/gsf-output-gio.c (gsf_output_gio_new_for_uri): Use
+	proconditions for programming errors.
+	(gsf_output_gio_write): Drop unneeded cast.
+
 	* gsf/gsf-libxml.c (gsf_xml_out_add_gvalue): Deal with G_TYPE_CHAR
 	always being signed char.
 	(gsf_xml_gvalue_from_str): Ditto.
diff --git a/gsf/gsf-output-gio.c b/gsf/gsf-output-gio.c
index 7d0966e..e6911e2 100644
--- a/gsf/gsf-output-gio.c
+++ b/gsf/gsf-output-gio.c
@@ -128,15 +128,9 @@ gsf_output_gio_new_for_uri (char const *uri, GError **err)
 	GFile *file;
 	GsfOutput *output;
 
-	if (uri == NULL) {
-		if (err != NULL)
-			*err = g_error_new (gsf_output_error_id (), 0,
-					    "uri is NULL");
-		return NULL;
-	}
+	g_return_val_if_fail (uri != NULL, NULL);
 
 	file = g_file_new_for_uri (uri);
-
 	output = gsf_output_gio_new (file);
 	g_object_unref (file);
 
@@ -193,7 +187,7 @@ gsf_output_gio_write (GsfOutput *output,
 
 		if (nwritten >= 0) {
 			total_written += nwritten;
-			if ((size_t)total_written == num_bytes)
+			if (total_written == num_bytes)
 				return TRUE;
 		} else {
 			return FALSE;



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