[Xfce4-commits] <tumbler:master> Fix compiler warning, add parameters to uri_error_new().

Jannis Pohlmann noreply at xfce.org
Thu Oct 8 13:32:03 CEST 2009


Updating branch refs/heads/master
         to bce7182312cc8a88755d4313aded2249501dd2dd (commit)
       from 63178254dcb82326cbd443e87394deb1c726f3aa (commit)

commit bce7182312cc8a88755d4313aded2249501dd2dd
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Thu Oct 8 13:25:43 2009 +0200

    Fix compiler warning, add parameters to uri_error_new().

 tumblerd/tumbler-group-scheduler.c |   13 ++++++++-----
 tumblerd/tumbler-scheduler.c       |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/tumblerd/tumbler-group-scheduler.c b/tumblerd/tumbler-group-scheduler.c
index c128a11..c97f97f 100644
--- a/tumblerd/tumbler-group-scheduler.c
+++ b/tumblerd/tumbler-group-scheduler.c
@@ -309,11 +309,17 @@ tumbler_group_scheduler_unqueue_request (TumblerSchedulerRequest *request,
 
 
 static UriError *
-uri_error_new (void)
+uri_error_new (gint         code,
+               const gchar *uri,
+               const gchar *message)
 {
   UriError *error;
 
   error = g_slice_new0 (UriError);
+  error->error_code = code;
+  error->failed_uri = g_strdup (uri);
+  error->message = g_strdup (message);
+
   return error;
 }
 
@@ -608,10 +614,7 @@ tumbler_group_scheduler_thumbnailer_error (TumblerThumbnailer *thumbnailer,
   g_return_if_fail (uri_errors != NULL);
 
   /* allocate a new URI error */
-  error = g_slice_new0 (UriError);
-  error->error_code = error_code;
-  error->message = g_strdup (message);
-  error->failed_uri = g_strdup (failed_uri);
+  error = uri_error_new (error_code, failed_uri, message);
 
   /* add the error to the list */
   *uri_errors = g_list_prepend (*uri_errors, error);
diff --git a/tumblerd/tumbler-scheduler.c b/tumblerd/tumbler-scheduler.c
index 933e801..59b1dc8 100644
--- a/tumblerd/tumbler-scheduler.c
+++ b/tumblerd/tumbler-scheduler.c
@@ -172,7 +172,7 @@ tumbler_scheduler_get_name (TumblerScheduler *scheduler)
 {
   const gchar *name;
 
-  g_return_if_fail (TUMBLER_IS_SCHEDULER (scheduler));
+  g_return_val_if_fail (TUMBLER_IS_SCHEDULER (scheduler), NULL);
   g_object_get (scheduler, "name", &name, NULL);
 
   return name;



More information about the Xfce4-commits mailing list