[gnome-builder] build: fix a number of -Wunused warnings in release mode



commit c5a1377fa9dc90a56f7228faf2257e640892da1d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 19 15:23:12 2019 -0800

    build: fix a number of -Wunused warnings in release mode

 src/libide/editor/ide-editor-page-actions.c                |  4 ----
 src/libide/foundry/ide-config-manager.c                    |  4 ----
 src/libide/foundry/ide-runtime-manager.c                   |  4 ----
 src/libide/foundry/ide-toolchain-manager.c                 |  8 --------
 src/libide/greeter/ide-clone-surface.c                     |  3 +--
 src/libide/greeter/ide-greeter-workspace.c                 |  3 +--
 src/libide/lsp/ide-lsp-rename-provider.c                   |  3 ---
 src/libide/lsp/ide-lsp-symbol-resolver.c                   |  3 ---
 src/libide/sourceview/ide-line-change-gutter-renderer.c    | 11 -----------
 src/libide/tree/ide-tree-model.c                           | 11 +++--------
 src/plugins/buildui/gbp-buildui-config-surface.c           |  3 +--
 src/plugins/buildui/gbp-buildui-config-view-addin.c        |  3 +--
 src/plugins/buildui/gbp-buildui-runtime-categories.c       |  2 +-
 src/plugins/code-index/gbp-code-index-plan.c               |  3 +--
 src/plugins/code-index/gbp-code-index-service.c            |  4 ----
 src/plugins/code-index/gbp-code-index-workbench-addin.c    |  4 +---
 src/plugins/command-bar/gbp-command-bar-command-provider.c |  3 +--
 src/plugins/ctags/gbp-ctags-workbench-addin.c              |  4 +---
 src/plugins/editor/gbp-editor-session-addin.c              |  4 ++--
 src/plugins/git/gbp-git-vcs-cloner.c                       |  3 +--
 src/plugins/git/gbp-git-workbench-addin.c                  |  3 +--
 src/plugins/grep/gbp-grep-model.c                          |  5 -----
 src/plugins/symbol-tree/gbp-symbol-hover-provider.c        |  4 ----
 src/plugins/terminal/gbp-terminal-application-addin.c      |  3 +--
 src/plugins/vim/gbp-vim-command-provider.c                 |  3 +--
 src/plugins/xml-pack/ide-xml-parser.c                      |  4 ++--
 src/plugins/xml-pack/ide-xml-tree-builder.c                |  4 ----
 27 files changed, 20 insertions(+), 93 deletions(-)
---
diff --git a/src/libide/editor/ide-editor-page-actions.c b/src/libide/editor/ide-editor-page-actions.c
index 4d91b60db..c20206d5e 100644
--- a/src/libide/editor/ide-editor-page-actions.c
+++ b/src/libide/editor/ide-editor-page-actions.c
@@ -200,7 +200,6 @@ ide_editor_page_actions_save (GSimpleAction *action,
                               gpointer       user_data)
 {
   IdeEditorPage *self = user_data;
-  IdeBufferManager *bufmgr;
   g_autoptr(IdeNotification) notif = NULL;
   g_autoptr(IdeContext) context = NULL;
   g_autoptr(GFile) local_file = NULL;
@@ -220,10 +219,7 @@ ide_editor_page_actions_save (GSimpleAction *action,
   file = ide_buffer_get_file (buffer);
   g_return_if_fail (G_IS_FILE (file));
 
-  bufmgr = ide_buffer_manager_from_context (context);
   workdir = ide_context_ref_workdir (context);
-
-  g_assert (IDE_IS_BUFFER_MANAGER (bufmgr));
   g_assert (G_IS_FILE (workdir));
 
   if (ide_buffer_get_is_temporary (buffer))
diff --git a/src/libide/foundry/ide-config-manager.c b/src/libide/foundry/ide-config-manager.c
index 76afc2dcd..45712238f 100644
--- a/src/libide/foundry/ide-config-manager.c
+++ b/src/libide/foundry/ide-config-manager.c
@@ -783,7 +783,6 @@ ide_config_manager_init_load_cb (GObject      *object,
                                         gpointer      user_data)
 {
   IdeConfigProvider *provider = (IdeConfigProvider *)object;
-  IdeConfigManager *self;
   g_autoptr(GError) error = NULL;
   g_autoptr(IdeTask) task = user_data;
   GPtrArray *providers;
@@ -795,9 +794,6 @@ ide_config_manager_init_load_cb (GObject      *object,
   g_assert (G_IS_ASYNC_RESULT (result));
   g_assert (IDE_IS_TASK (task));
 
-  self = ide_task_get_source_object (task);
-  g_assert (IDE_IS_CONFIG_MANAGER (self));
-
   if (!ide_config_provider_load_finish (provider, result, &error))
     {
       g_assert (error != NULL);
diff --git a/src/libide/foundry/ide-runtime-manager.c b/src/libide/foundry/ide-runtime-manager.c
index ba9298668..78d369859 100644
--- a/src/libide/foundry/ide-runtime-manager.c
+++ b/src/libide/foundry/ide-runtime-manager.c
@@ -112,14 +112,10 @@ ide_runtime_manager_initable_init (GInitable     *initable,
 {
   IdeRuntimeManager *self = (IdeRuntimeManager *)initable;
   g_autoptr(IdeRuntime) host = NULL;
-  IdeContext *context;
 
   g_assert (IDE_IS_RUNTIME_MANAGER (self));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
-  context = ide_object_get_context (IDE_OBJECT (self));
-  g_assert (IDE_IS_CONTEXT (context));
-
   self->extensions = ide_extension_set_adapter_new (IDE_OBJECT (self),
                                                     peas_engine_get_default (),
                                                     IDE_TYPE_RUNTIME_PROVIDER,
diff --git a/src/libide/foundry/ide-toolchain-manager.c b/src/libide/foundry/ide-toolchain-manager.c
index 93351e9f8..593a4ca6f 100644
--- a/src/libide/foundry/ide-toolchain-manager.c
+++ b/src/libide/foundry/ide-toolchain-manager.c
@@ -228,7 +228,6 @@ ide_toolchain_manager_init_load_cb (GObject      *object,
                                     gpointer      user_data)
 {
   IdeToolchainProvider *provider = (IdeToolchainProvider *)object;
-  IdeToolchainManager *self;
   g_autoptr(GError) error = NULL;
   g_autoptr(IdeTask) task = user_data;
   GPtrArray *providers;
@@ -240,9 +239,6 @@ ide_toolchain_manager_init_load_cb (GObject      *object,
   g_assert (G_IS_ASYNC_RESULT (result));
   g_assert (IDE_IS_TASK (task));
 
-  self = ide_task_get_source_object (task);
-  g_assert (IDE_IS_TOOLCHAIN_MANAGER (self));
-
   if (!ide_toolchain_provider_load_finish (provider, result, &error))
     {
       if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
@@ -292,7 +288,6 @@ ide_toolchain_manager_init_async (GAsyncInitable      *initable,
   g_autoptr(IdeSimpleToolchain) default_toolchain = NULL;
   g_autoptr(GPtrArray) providers = NULL;
   g_autoptr(IdeTask) task = NULL;
-  IdeContext *context;
   guint idx;
 
   g_assert (G_IS_ASYNC_INITABLE (self));
@@ -309,9 +304,6 @@ ide_toolchain_manager_init_async (GAsyncInitable      *initable,
                             self);
 #endif
 
-  context = ide_object_get_context (IDE_OBJECT (self));
-  g_assert (IDE_IS_CONTEXT (context));
-
   self->extensions = peas_extension_set_new (peas_engine_get_default (),
                                              IDE_TYPE_TOOLCHAIN_PROVIDER,
                                              NULL);
diff --git a/src/libide/greeter/ide-clone-surface.c b/src/libide/greeter/ide-clone-surface.c
index f464852c1..7c792feac 100644
--- a/src/libide/greeter/ide-clone-surface.c
+++ b/src/libide/greeter/ide-clone-surface.c
@@ -129,13 +129,12 @@ ide_clone_surface_addin_removed_cb (PeasExtensionSet *set,
                                     PeasExtension    *exten,
                                     gpointer          user_data)
 {
-  IdeVcsCloner *cloner = (IdeVcsCloner *)exten;
   IdeCloneSurface *self = user_data;
 
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (PEAS_IS_EXTENSION_SET (set));
   g_assert (plugin_info != NULL);
-  g_assert (IDE_IS_VCS_CLONER (cloner));
+  g_assert (IDE_IS_VCS_CLONER (exten));
   g_assert (IDE_IS_CLONE_SURFACE (self));
 
   self->n_addins--;
diff --git a/src/libide/greeter/ide-greeter-workspace.c b/src/libide/greeter/ide-greeter-workspace.c
index 62358edd1..a4d05ff84 100644
--- a/src/libide/greeter/ide-greeter-workspace.c
+++ b/src/libide/greeter/ide-greeter-workspace.c
@@ -253,12 +253,11 @@ ide_greeter_workspace_addin_removed_cb (PeasExtensionSet *set,
                                         gpointer          user_data)
 {
   IdeGreeterSection *section = (IdeGreeterSection *)exten;
-  IdeGreeterWorkspace *self = user_data;
 
   g_assert (PEAS_IS_EXTENSION_SET (set));
   g_assert (plugin_info != NULL);
   g_assert (IDE_IS_GREETER_SECTION (section));
-  g_assert (IDE_IS_GREETER_WORKSPACE (self));
+  g_assert (IDE_IS_GREETER_WORKSPACE (user_data));
 
   gtk_widget_destroy (GTK_WIDGET (section));
 }
diff --git a/src/libide/lsp/ide-lsp-rename-provider.c b/src/libide/lsp/ide-lsp-rename-provider.c
index e0ae48aff..a990e2a07 100644
--- a/src/libide/lsp/ide-lsp-rename-provider.c
+++ b/src/libide/lsp/ide-lsp-rename-provider.c
@@ -150,7 +150,6 @@ ide_lsp_rename_provider_rename_cb (GObject      *object,
                                         gpointer      user_data)
 {
   IdeLspClient *client = (IdeLspClient *)object;
-  IdeLspRenameProvider *self;
   g_autoptr(GVariant) return_value = NULL;
   g_autoptr(GError) error = NULL;
   g_autoptr(IdeTask) task = user_data;
@@ -164,8 +163,6 @@ ide_lsp_rename_provider_rename_cb (GObject      *object,
   g_assert (IDE_IS_LSP_CLIENT (client));
   g_assert (G_IS_ASYNC_RESULT (result));
   g_assert (IDE_IS_TASK (task));
-  self = ide_task_get_source_object (task);
-  g_assert (IDE_IS_LSP_RENAME_PROVIDER (self));
 
   if (!ide_lsp_client_call_finish (client, result, &return_value, &error))
     {
diff --git a/src/libide/lsp/ide-lsp-symbol-resolver.c b/src/libide/lsp/ide-lsp-symbol-resolver.c
index 64d5f5e7d..e4ec44e3a 100644
--- a/src/libide/lsp/ide-lsp-symbol-resolver.c
+++ b/src/libide/lsp/ide-lsp-symbol-resolver.c
@@ -161,7 +161,6 @@ ide_lsp_symbol_resolver_definition_cb (GObject      *object,
                                             gpointer      user_data)
 {
   IdeLspClient *client = (IdeLspClient *)object;
-  IdeLspSymbolResolver *self;
   g_autoptr(IdeTask) task = user_data;
   g_autoptr(GError) error = NULL;
   g_autoptr(GVariant) return_value = NULL;
@@ -182,8 +181,6 @@ ide_lsp_symbol_resolver_definition_cb (GObject      *object,
   g_assert (IDE_IS_LSP_CLIENT (client));
   g_assert (G_IS_ASYNC_RESULT (result));
   g_assert (IDE_IS_TASK (task));
-  self = ide_task_get_source_object (task);
-  g_assert (IDE_IS_LSP_SYMBOL_RESOLVER (self));
 
   if (!ide_lsp_client_call_finish (client, result, &return_value, &error))
     {
diff --git a/src/libide/sourceview/ide-line-change-gutter-renderer.c 
b/src/libide/sourceview/ide-line-change-gutter-renderer.c
index a8904959c..7650e36ee 100644
--- a/src/libide/sourceview/ide-line-change-gutter-renderer.c
+++ b/src/libide/sourceview/ide-line-change-gutter-renderer.c
@@ -315,16 +315,6 @@ ide_line_change_gutter_renderer_begin (GtkSourceGutterRenderer *renderer,
   self->lines = g_steal_pointer (&state.lines);
 }
 
-static void
-ide_line_change_gutter_renderer_end (GtkSourceGutterRenderer *renderer)
-{
-  IdeLineChangeGutterRenderer *self = (IdeLineChangeGutterRenderer *)renderer;
-
-  g_assert (IDE_IS_LINE_CHANGE_GUTTER_RENDERER (self));
-
-  //g_clear_pointer (&self->lines, g_array_unref);
-}
-
 static void
 draw_line_change (IdeLineChangeGutterRenderer  *self,
                   cairo_t                      *cr,
@@ -429,7 +419,6 @@ ide_line_change_gutter_renderer_class_init (IdeLineChangeGutterRendererClass *kl
 
   object_class->dispose = ide_line_change_gutter_renderer_dispose;
 
-  renderer_class->end = ide_line_change_gutter_renderer_end;
   renderer_class->begin = ide_line_change_gutter_renderer_begin;
   renderer_class->draw = ide_line_change_gutter_renderer_draw;
 }
diff --git a/src/libide/tree/ide-tree-model.c b/src/libide/tree/ide-tree-model.c
index aa797d645..7ff90de8b 100644
--- a/src/libide/tree/ide-tree-model.c
+++ b/src/libide/tree/ide-tree-model.c
@@ -398,10 +398,9 @@ ide_tree_model_get_path (GtkTreeModel *tree_model,
                          GtkTreeIter  *iter)
 {
   g_autoptr(GArray) indexes = NULL;
-  IdeTreeModel *self = (IdeTreeModel *)tree_model;
   IdeTreeNode *node;
 
-  g_assert (IDE_IS_TREE_MODEL (self));
+  g_assert (IDE_IS_TREE_MODEL (tree_model));
   g_assert (iter != NULL);
   g_assert (IDE_IS_TREE_NODE (iter->user_data));
 
@@ -587,9 +586,7 @@ ide_tree_model_iter_parent (GtkTreeModel *model,
                             GtkTreeIter  *iter,
                             GtkTreeIter  *child)
 {
-  IdeTreeModel *self = (IdeTreeModel *)model;
-
-  g_assert (IDE_IS_TREE_MODEL (self));
+  g_assert (IDE_IS_TREE_MODEL (model));
   g_assert (iter != NULL);
   g_assert (child != NULL);
   g_assert (IDE_IS_TREE_NODE (child->user_data));
@@ -1400,10 +1397,8 @@ static gboolean
 ide_tree_model_drag_data_delete (GtkTreeDragSource *source,
                                  GtkTreePath       *path)
 {
-  IdeTreeModel *self = (IdeTreeModel *)source;
-
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (IDE_IS_TREE_MODEL (self));
+  g_assert (IDE_IS_TREE_MODEL (source));
   g_assert (path != NULL);
 
   return FALSE;
diff --git a/src/plugins/buildui/gbp-buildui-config-surface.c 
b/src/plugins/buildui/gbp-buildui-config-surface.c
index 9d6cbe82f..85172ade2 100644
--- a/src/plugins/buildui/gbp-buildui-config-surface.c
+++ b/src/plugins/buildui/gbp-buildui-config-surface.c
@@ -152,14 +152,13 @@ static GtkWidget *
 gbp_buildui_config_surface_create_row_cb (gpointer item,
                                           gpointer user_data)
 {
-  GbpBuilduiConfigSurface *self = user_data;
   IdeConfig *config = item;
   const gchar *title;
   GtkWidget *row;
   GtkWidget *label;
 
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (GBP_IS_BUILDUI_CONFIG_SURFACE (self));
+  g_assert (GBP_IS_BUILDUI_CONFIG_SURFACE (user_data));
   g_assert (IDE_IS_CONFIG (config));
 
   title = ide_config_get_display_name (config);
diff --git a/src/plugins/buildui/gbp-buildui-config-view-addin.c 
b/src/plugins/buildui/gbp-buildui-config-view-addin.c
index 622aefe58..0528bb9f7 100644
--- a/src/plugins/buildui/gbp-buildui-config-view-addin.c
+++ b/src/plugins/buildui/gbp-buildui-config-view-addin.c
@@ -388,7 +388,6 @@ gbp_buildui_config_view_addin_load (IdeConfigViewAddin *addin,
                                     DzlPreferences     *preferences,
                                     IdeConfig   *config)
 {
-  GbpBuilduiConfigViewAddin *self = (GbpBuilduiConfigViewAddin *)addin;
   IdeToolchainManager *toolchain_manager;
   IdeRuntimeManager *runtime_manager;
   g_autoptr(GFile) workdir = NULL;
@@ -409,7 +408,7 @@ gbp_buildui_config_view_addin_load (IdeConfigViewAddin *addin,
   };
 
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (GBP_IS_BUILDUI_CONFIG_VIEW_ADDIN (self));
+  g_assert (GBP_IS_BUILDUI_CONFIG_VIEW_ADDIN (addin));
   g_assert (DZL_IS_PREFERENCES (preferences));
   g_assert (IDE_IS_CONFIG (config));
 
diff --git a/src/plugins/buildui/gbp-buildui-runtime-categories.c 
b/src/plugins/buildui/gbp-buildui-runtime-categories.c
index e4a693559..dca35ea50 100644
--- a/src/plugins/buildui/gbp-buildui-runtime-categories.c
+++ b/src/plugins/buildui/gbp-buildui-runtime-categories.c
@@ -59,7 +59,7 @@ gbp_buildui_runtime_categories_get_n_items (GListModel *model)
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (GBP_IS_BUILDUI_RUNTIME_CATEGORIES (self));
 
-  return GBP_BUILDUI_RUNTIME_CATEGORIES (model)->items->len;
+  return self->items->len;
 }
 
 static gpointer
diff --git a/src/plugins/code-index/gbp-code-index-plan.c b/src/plugins/code-index/gbp-code-index-plan.c
index 02ab57ae8..b366d7e65 100644
--- a/src/plugins/code-index/gbp-code-index-plan.c
+++ b/src/plugins/code-index/gbp-code-index-plan.c
@@ -445,13 +445,12 @@ gbp_code_index_plan_populate_worker (IdeTask      *task,
                                      gpointer      task_data,
                                      GCancellable *cancellable)
 {
-  GbpCodeIndexPlan *self = source_object;
   PopulateData *state = task_data;
 
   IDE_ENTRY;
 
   g_assert (IDE_IS_TASK (task));
-  g_assert (GBP_IS_CODE_INDEX_PLAN (self));
+  g_assert (GBP_IS_CODE_INDEX_PLAN (source_object));
   g_assert (state != NULL);
   g_assert (IDE_IS_BUILD_SYSTEM (state->build_system));
   g_assert (IDE_IS_VCS (state->vcs));
diff --git a/src/plugins/code-index/gbp-code-index-service.c b/src/plugins/code-index/gbp-code-index-service.c
index f4850a96c..dd8b87674 100644
--- a/src/plugins/code-index/gbp-code-index-service.c
+++ b/src/plugins/code-index/gbp-code-index-service.c
@@ -344,7 +344,6 @@ gbp_code_index_service_load_flags_cb (GObject      *object,
   g_autoptr(IdeTask) task = user_data;
   g_autoptr(GError) error = NULL;
   GbpCodeIndexService *self;
-  IdeContext *context;
 
   IDE_ENTRY;
 
@@ -363,10 +362,7 @@ gbp_code_index_service_load_flags_cb (GObject      *object,
     IDE_EXIT;
 
   self = ide_task_get_source_object (task);
-  context = ide_task_get_task_data (task);
-
   g_assert (GBP_IS_CODE_INDEX_SERVICE (self));
-  g_assert (IDE_IS_CONTEXT (context));
 
   executor = gbp_code_index_executor_new (plan);
   ide_object_append (IDE_OBJECT (self), IDE_OBJECT (executor));
diff --git a/src/plugins/code-index/gbp-code-index-workbench-addin.c 
b/src/plugins/code-index/gbp-code-index-workbench-addin.c
index 1d657fa67..dae6a2019 100644
--- a/src/plugins/code-index/gbp-code-index-workbench-addin.c
+++ b/src/plugins/code-index/gbp-code-index-workbench-addin.c
@@ -115,10 +115,8 @@ static void
 gbp_code_index_workbench_addin_workspace_removed (IdeWorkbenchAddin *addin,
                                                   IdeWorkspace      *workspace)
 {
-  GbpCodeIndexWorkbenchAddin *self = (GbpCodeIndexWorkbenchAddin *)addin;
-
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (GBP_IS_CODE_INDEX_WORKBENCH_ADDIN (self));
+  g_assert (GBP_IS_CODE_INDEX_WORKBENCH_ADDIN (addin));
   g_assert (IDE_IS_WORKSPACE (workspace));
 
   gtk_widget_insert_action_group (GTK_WIDGET (workspace), "code-index", NULL);
diff --git a/src/plugins/command-bar/gbp-command-bar-command-provider.c 
b/src/plugins/command-bar/gbp-command-bar-command-provider.c
index 3eca2a278..e84be23be 100644
--- a/src/plugins/command-bar/gbp-command-bar-command-provider.c
+++ b/src/plugins/command-bar/gbp-command-bar-command-provider.c
@@ -163,10 +163,9 @@ gbp_command_bar_command_provider_query_finish (IdeCommandProvider  *provider,
                                                GAsyncResult        *result,
                                                GError             **error)
 {
-  GbpCommandBarCommandProvider *self = (GbpCommandBarCommandProvider *)provider;
   GPtrArray *ret;
 
-  g_assert (GBP_IS_COMMAND_BAR_COMMAND_PROVIDER (self));
+  g_assert (GBP_IS_COMMAND_BAR_COMMAND_PROVIDER (provider));
   g_assert (G_IS_ASYNC_RESULT (result));
 
   ret = ide_task_propagate_pointer (IDE_TASK (result), error);
diff --git a/src/plugins/ctags/gbp-ctags-workbench-addin.c b/src/plugins/ctags/gbp-ctags-workbench-addin.c
index 7ab17d797..cf4be0fee 100644
--- a/src/plugins/ctags/gbp-ctags-workbench-addin.c
+++ b/src/plugins/ctags/gbp-ctags-workbench-addin.c
@@ -148,9 +148,7 @@ static void
 gbp_ctags_workbench_addin_workspace_removed (IdeWorkbenchAddin *addin,
                                              IdeWorkspace      *workspace)
 {
-  GbpCtagsWorkbenchAddin *self = (GbpCtagsWorkbenchAddin *)addin;
-
-  g_assert (GBP_IS_CTAGS_WORKBENCH_ADDIN (self));
+  g_assert (GBP_IS_CTAGS_WORKBENCH_ADDIN (addin));
   g_assert (IDE_IS_WORKSPACE (workspace));
 
   for (guint i = 0; i < G_N_ELEMENTS (actions); i++)
diff --git a/src/plugins/editor/gbp-editor-session-addin.c b/src/plugins/editor/gbp-editor-session-addin.c
index 61b782242..ebd9501f7 100644
--- a/src/plugins/editor/gbp-editor-session-addin.c
+++ b/src/plugins/editor/gbp-editor-session-addin.c
@@ -184,14 +184,14 @@ gbp_editor_session_addin_save_async (IdeSessionAddin     *addin,
                                      GAsyncReadyCallback  callback,
                                      gpointer             user_data)
 {
-  GbpEditorSessionAddin *self = (GbpEditorSessionAddin *)addin;
   g_autoptr(IdeTask) task = NULL;
   g_autoptr(GArray) items = NULL;
   GVariantBuilder builder;
 
   IDE_ENTRY;
 
-  g_assert (IDE_IS_SESSION_ADDIN (self));
+  g_assert (IDE_IS_MAIN_THREAD ());
+  g_assert (IDE_IS_SESSION_ADDIN (addin));
   g_assert (IDE_IS_WORKBENCH (workbench));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
diff --git a/src/plugins/git/gbp-git-vcs-cloner.c b/src/plugins/git/gbp-git-vcs-cloner.c
index 2a0b9958a..6c381c7b8 100644
--- a/src/plugins/git/gbp-git-vcs-cloner.c
+++ b/src/plugins/git/gbp-git-vcs-cloner.c
@@ -157,7 +157,6 @@ gbp_git_vcs_cloner_worker (IdeTask      *task,
                            gpointer      task_data,
                            GCancellable *cancellable)
 {
-  GbpGitVcsCloner *self = source_object;
   g_autoptr(GgitConfig) config = NULL;
   g_autoptr(GFile) config_file = NULL;
   g_autoptr(GError) error = NULL;
@@ -169,7 +168,7 @@ gbp_git_vcs_cloner_worker (IdeTask      *task,
   CloneRequest *req = task_data;
 
   g_assert (IDE_IS_TASK (task));
-  g_assert (GBP_IS_GIT_VCS_CLONER (self));
+  g_assert (GBP_IS_GIT_VCS_CLONER (source_object));
   g_assert (req != NULL);
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
diff --git a/src/plugins/git/gbp-git-workbench-addin.c b/src/plugins/git/gbp-git-workbench-addin.c
index 678895804..e3831d98e 100644
--- a/src/plugins/git/gbp-git-workbench-addin.c
+++ b/src/plugins/git/gbp-git-workbench-addin.c
@@ -46,7 +46,6 @@ gbp_git_workbench_addin_load_project_worker (IdeTask      *task,
                                              gpointer      task_data,
                                              GCancellable *cancellable)
 {
-  GbpGitWorkbenchAddin *self = source_object;
   g_autoptr(GgitRepository) repository = NULL;
   g_autoptr(GbpGitVcs) vcs = NULL;
   g_autoptr(GFile) location = NULL;
@@ -56,7 +55,7 @@ gbp_git_workbench_addin_load_project_worker (IdeTask      *task,
   GFile *directory = task_data;
 
   g_assert (IDE_IS_TASK (task));
-  g_assert (GBP_IS_GIT_WORKBENCH_ADDIN (self));
+  g_assert (GBP_IS_GIT_WORKBENCH_ADDIN (source_object));
   g_assert (G_IS_FILE (directory));
 
   /* Short-circuit if we don't .git */
diff --git a/src/plugins/grep/gbp-grep-model.c b/src/plugins/grep/gbp-grep-model.c
index 3848801a5..ef0ea9e8a 100644
--- a/src/plugins/grep/gbp-grep-model.c
+++ b/src/plugins/grep/gbp-grep-model.c
@@ -726,7 +726,6 @@ gbp_grep_model_scan_cb (GObject      *object,
   g_autoptr(GBytes) bytes = NULL;
   g_autoptr(GError) error = NULL;
   g_autofree gchar *stdout_buf = NULL;
-  GbpGrepModel *self;
   gsize len;
 
   IDE_ENTRY;
@@ -735,10 +734,6 @@ gbp_grep_model_scan_cb (GObject      *object,
   g_assert (G_IS_ASYNC_RESULT (result));
   g_assert (IDE_IS_TASK (task));
 
-  self = ide_task_get_source_object (task);
-
-  g_assert (GBP_IS_GREP_MODEL (self));
-
   if (!ide_subprocess_communicate_utf8_finish (subprocess, result, &stdout_buf, NULL, &error))
     {
       ide_task_return_error (task, g_steal_pointer (&error));
diff --git a/src/plugins/symbol-tree/gbp-symbol-hover-provider.c 
b/src/plugins/symbol-tree/gbp-symbol-hover-provider.c
index 60f1387a1..9a8353bdd 100644
--- a/src/plugins/symbol-tree/gbp-symbol-hover-provider.c
+++ b/src/plugins/symbol-tree/gbp-symbol-hover-provider.c
@@ -65,7 +65,6 @@ gbp_symbol_hover_provider_get_symbol_cb (GObject      *object,
                                          gpointer      user_data)
 {
   IdeBuffer *buffer = (IdeBuffer *)object;
-  GbpSymbolHoverProvider *self;
   g_autoptr(IdeTask) task = user_data;
   g_autoptr(IdeSymbol) symbol = NULL;
   g_autoptr(GError) error = NULL;
@@ -93,10 +92,7 @@ gbp_symbol_hover_provider_get_symbol_cb (GObject      *object,
       return;
     }
 
-  self = ide_task_get_source_object (task);
   context = ide_task_get_task_data (task);
-
-  g_assert (GBP_IS_SYMBOL_HOVER_PROVIDER (self));
   g_assert (context != NULL);
   g_assert (IDE_IS_HOVER_CONTEXT (context));
 
diff --git a/src/plugins/terminal/gbp-terminal-application-addin.c 
b/src/plugins/terminal/gbp-terminal-application-addin.c
index 9964b74cc..2f29138ab 100644
--- a/src/plugins/terminal/gbp-terminal-application-addin.c
+++ b/src/plugins/terminal/gbp-terminal-application-addin.c
@@ -38,11 +38,10 @@ gbp_terminal_application_addin_handle_command_line (IdeApplicationAddin     *add
                                                     IdeApplication          *application,
                                                     GApplicationCommandLine *cmdline)
 {
-  IdeApplication *app = (IdeApplication *)application;
   GVariantDict *options;
 
   g_assert (IDE_IS_APPLICATION_ADDIN (addin));
-  g_assert (IDE_IS_APPLICATION (app));
+  g_assert (IDE_IS_APPLICATION (application));
   g_assert (G_IS_APPLICATION_COMMAND_LINE (cmdline));
 
   if ((options = g_application_command_line_get_options_dict (cmdline)) &&
diff --git a/src/plugins/vim/gbp-vim-command-provider.c b/src/plugins/vim/gbp-vim-command-provider.c
index e55d95aab..951950692 100644
--- a/src/plugins/vim/gbp-vim-command-provider.c
+++ b/src/plugins/vim/gbp-vim-command-provider.c
@@ -89,11 +89,10 @@ gbp_vim_command_provider_query_finish (IdeCommandProvider  *provider,
                                        GAsyncResult        *result,
                                        GError             **error)
 {
-  GbpVimCommandProvider *self = (GbpVimCommandProvider *)provider;
   GPtrArray *ret;
 
   g_assert (IDE_IS_MAIN_THREAD ());
-  g_assert (GBP_IS_VIM_COMMAND_PROVIDER (self));
+  g_assert (GBP_IS_VIM_COMMAND_PROVIDER (provider));
   g_assert (G_IS_ASYNC_RESULT (result));
 
   ret = ide_task_propagate_pointer (IDE_TASK (result), error);
diff --git a/src/plugins/xml-pack/ide-xml-parser.c b/src/plugins/xml-pack/ide-xml-parser.c
index 1b0cfa802..5f4ad31cd 100644
--- a/src/plugins/xml-pack/ide-xml-parser.c
+++ b/src/plugins/xml-pack/ide-xml-parser.c
@@ -113,7 +113,6 @@ ide_xml_parser_create_diagnostic (ParserState            *state,
                                   const gchar            *msg,
                                   IdeDiagnosticSeverity   severity)
 {
-  IdeXmlParser *self = (IdeXmlParser *)state->self;
   g_autoptr(IdeLocation) start_loc = NULL;
   g_autoptr(IdeLocation) end_loc = NULL;
   IdeDiagnostic *diagnostic;
@@ -123,7 +122,8 @@ ide_xml_parser_create_diagnostic (ParserState            *state,
   gint end_line_offset;
   gsize size;
 
-  g_assert (IDE_IS_XML_PARSER (self));
+  g_assert (state != NULL);
+  g_assert (IDE_IS_XML_PARSER (state->self));
 
   ide_xml_sax_get_location (state->sax_parser,
                             &start_line, &start_line_offset,
diff --git a/src/plugins/xml-pack/ide-xml-tree-builder.c b/src/plugins/xml-pack/ide-xml-tree-builder.c
index ee2d2d3c9..01973325f 100644
--- a/src/plugins/xml-pack/ide-xml-tree-builder.c
+++ b/src/plugins/xml-pack/ide-xml-tree-builder.c
@@ -566,7 +566,6 @@ ide_xml_tree_builder_parent_set (IdeObject *object,
                                  IdeObject *parent)
 {
   IdeXmlTreeBuilder *self = (IdeXmlTreeBuilder *)object;
-  IdeContext *context;
 
   g_assert (IDE_IS_XML_TREE_BUILDER (self));
   g_assert (!parent || IDE_IS_OBJECT (parent));
@@ -574,9 +573,6 @@ ide_xml_tree_builder_parent_set (IdeObject *object,
   if (parent == NULL)
     return;
 
-  context = ide_object_get_context (IDE_OBJECT (self));
-  g_assert (IDE_IS_CONTEXT (context));
-
   self->parser = g_object_new (IDE_TYPE_XML_PARSER,
                                "parent", self,
                                NULL);


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