[gnome-builder] buffer: remove some unnecessary casts



commit a37f532d925c6101675082f168be1650f514b053
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 11 17:53:00 2016 +0300

    buffer: remove some unnecessary casts

 libide/ide-buffer-manager.c |   16 ++++++----------
 libide/ide-buffer.c         |   12 ++++--------
 2 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/libide/ide-buffer-manager.c b/libide/ide-buffer-manager.c
index a8a4745..e5bc9ab 100644
--- a/libide/ide-buffer-manager.c
+++ b/libide/ide-buffer-manager.c
@@ -811,15 +811,14 @@ ide_buffer_manager_load_file_finish (IdeBufferManager  *self,
                                      GAsyncResult      *result,
                                      GError           **error)
 {
-  GTask *task = (GTask *)result;
   IdeBuffer *ret;
 
   IDE_ENTRY;
 
   g_return_val_if_fail (IDE_IS_BUFFER_MANAGER (self), NULL);
-  g_return_val_if_fail (G_IS_TASK (task), NULL);
+  g_return_val_if_fail (G_IS_TASK (result), NULL);
 
-  ret = g_task_propagate_pointer (task, error);
+  ret = g_task_propagate_pointer (G_TASK (result), error);
 
   IDE_RETURN (ret);
 }
@@ -1091,12 +1090,10 @@ ide_buffer_manager_save_file_finish (IdeBufferManager  *self,
                                      GAsyncResult      *result,
                                      GError           **error)
 {
-  GTask *task = (GTask *)result;
-
   g_return_val_if_fail (IDE_IS_BUFFER_MANAGER (self), FALSE);
-  g_return_val_if_fail (G_IS_TASK (task), FALSE);
+  g_return_val_if_fail (G_IS_TASK (result), FALSE);
 
-  return g_task_propagate_boolean (task, error);
+  return g_task_propagate_boolean (G_TASK (result), error);
 }
 
 static void
@@ -1819,9 +1816,8 @@ ide_buffer_manager_save_all_finish (IdeBufferManager  *self,
                                     GAsyncResult      *result,
                                     GError           **error)
 {
-  GTask *task = (GTask *)result;
-
   g_return_val_if_fail (IDE_IS_BUFFER_MANAGER (self), FALSE);
+  g_return_val_if_fail (G_IS_TASK (result), FALSE);
 
-  return g_task_propagate_boolean (task, error);
+  return g_task_propagate_boolean (G_TASK (result), error);
 }
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index ca24292..46fb8da 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -2395,12 +2395,10 @@ ide_buffer_get_symbol_at_location_finish (IdeBuffer     *self,
                                           GAsyncResult  *result,
                                           GError       **error)
 {
-  GTask *task = (GTask *)result;
-
   g_return_val_if_fail (IDE_IS_BUFFER (self), NULL);
-  g_return_val_if_fail (G_IS_TASK (task), NULL);
+  g_return_val_if_fail (G_IS_TASK (result), NULL);
 
-  return g_task_propagate_pointer (task, error);
+  return g_task_propagate_pointer (G_TASK (result), error);
 }
 
 /**
@@ -2415,12 +2413,10 @@ ide_buffer_get_symbols_finish (IdeBuffer     *self,
                                GAsyncResult  *result,
                                GError       **error)
 {
-  GTask *task = (GTask *)result;
-
   g_return_val_if_fail (IDE_IS_BUFFER (self), NULL);
-  g_return_val_if_fail (G_IS_TASK (task), NULL);
+  g_return_val_if_fail (G_IS_TASK (result), NULL);
 
-  return g_task_propagate_pointer (task, error);
+  return g_task_propagate_pointer (G_TASK (result), error);
 }
 
 static gboolean


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