Commit ad893483 authored by Christian Hergert's avatar Christian Hergert
Browse files

build: fix a number of warnings in release builds

These popped up when building with --buildtype=release. All of them are
harmless, but I like keeping the warning counts down.
parent c6c41f58
......@@ -56,12 +56,16 @@ ide_application_run_tests_cb (GObject *object,
gpointer user_data)
{
AsyncTest *test = user_data;
GError *error = NULL;
g_autoptr(GError) error = NULL;
gboolean ret;
ret = test->test_completion (result, &error);
g_assert_no_error (error);
g_assert (ret == TRUE);
if (error != NULL)
g_error ("%s: %s", g_quark_to_string (error->domain), error->message);
if (ret == FALSE)
g_error ("Test failed without an error");
if (test->self->test_funcs)
ide_application_run_next_test (test->self);
......
......@@ -1196,7 +1196,6 @@ ide_buffer_symbol_resolver_added (IdeExtensionSetAdapter *adapter,
gpointer user_data)
{
IdeSymbolResolver *resolver = (IdeSymbolResolver *)extension;
IdeBuffer *self = user_data;
IDE_ENTRY;
......@@ -1204,7 +1203,7 @@ ide_buffer_symbol_resolver_added (IdeExtensionSetAdapter *adapter,
g_assert (IDE_IS_EXTENSION_SET_ADAPTER (adapter));
g_assert (plugin_info != NULL);
g_assert (IDE_IS_SYMBOL_RESOLVER (resolver));
g_assert (IDE_IS_BUFFER (self));
g_assert (IDE_IS_BUFFER (user_data));
IDE_TRACE_MSG ("Loading symbol resolver %s", G_OBJECT_TYPE_NAME (resolver));
......@@ -1220,7 +1219,6 @@ ide_buffer_symbol_resolver_removed (IdeExtensionSetAdapter *adapter,
gpointer user_data)
{
IdeSymbolResolver *resolver = (IdeSymbolResolver *)extension;
IdeBuffer *self = user_data;
IDE_ENTRY;
......@@ -1228,7 +1226,7 @@ ide_buffer_symbol_resolver_removed (IdeExtensionSetAdapter *adapter,
g_assert (IDE_IS_EXTENSION_SET_ADAPTER (adapter));
g_assert (plugin_info != NULL);
g_assert (IDE_IS_SYMBOL_RESOLVER (resolver));
g_assert (IDE_IS_BUFFER (self));
g_assert (IDE_IS_BUFFER (user_data));
IDE_TRACE_MSG ("Unloading symbol resolver %s", G_OBJECT_TYPE_NAME (resolver));
......
......@@ -1187,7 +1187,6 @@ ide_build_manager_execute_cb (GObject *object,
gpointer user_data)
{
IdeBuildPipeline *pipeline = (IdeBuildPipeline *)object;
IdeBuildManager *self;
g_autoptr(GTask) task = user_data;
g_autoptr(GError) error = NULL;
......@@ -1197,9 +1196,6 @@ ide_build_manager_execute_cb (GObject *object,
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (IDE_IS_BUILD_MANAGER (self));
if (!ide_build_pipeline_execute_finish (pipeline, result, &error))
{
ide_object_warning (pipeline, "%s", error->message);
......@@ -1391,7 +1387,6 @@ ide_build_manager_clean_cb (GObject *object,
IdeBuildPipeline *pipeline = (IdeBuildPipeline *)object;
g_autoptr(GTask) task = user_data;
g_autoptr(GError) error = NULL;
IdeBuildManager *self;
IDE_ENTRY;
......@@ -1399,9 +1394,6 @@ ide_build_manager_clean_cb (GObject *object,
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (IDE_IS_BUILD_MANAGER (self));
if (!ide_build_pipeline_clean_finish (pipeline, result, &error))
g_task_return_error (task, g_steal_pointer (&error));
else
......
......@@ -3256,7 +3256,6 @@ ide_build_pipeline_reaper_cb (GObject *object,
IdeBuildPipeline *self;
g_autoptr(GTask) task = user_data;
g_autoptr(GError) error = NULL;
GCancellable *cancellable;
TaskData *td;
IDE_ENTRY;
......@@ -3271,10 +3270,7 @@ ide_build_pipeline_reaper_cb (GObject *object,
g_assert (td->task == task);
g_assert (td->type == TASK_REBUILD);
cancellable = g_task_get_cancellable (task);
self = g_task_get_source_object (task);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
g_assert (IDE_IS_BUILD_PIPELINE (self));
/* Make sure our reaper completed or else we bail */
......
......@@ -197,10 +197,9 @@ ide_build_panel_create_stage_row_cb (gpointer data,
gpointer user_data)
{
IdeBuildStage *stage = data;
IdeBuildPanel *self = user_data;
g_assert (IDE_IS_BUILD_STAGE (stage));
g_assert (IDE_IS_BUILD_PANEL (self));
g_assert (IDE_IS_BUILD_PANEL (user_data));
return ide_build_stage_row_new (stage);
}
......
......@@ -797,11 +797,10 @@ static void
ide_debug_manager_reset_breakpoints_cb (gpointer item,
gpointer user_data)
{
IdeDebugManager *self = user_data;
IdeDebuggerBreakpoint *breakpoint = item;
g_assert (IDE_IS_DEBUGGER_BREAKPOINT (breakpoint));
g_assert (IDE_IS_DEBUG_MANAGER (self));
g_assert (IDE_IS_DEBUG_MANAGER (user_data));
_ide_debugger_breakpoint_reset (breakpoint);
}
......
......@@ -326,13 +326,12 @@ ide_langserv_rename_provider_rename_finish (IdeRenameProvider *provider,
GPtrArray **edits,
GError **error)
{
IdeLangservRenameProvider *self = (IdeLangservRenameProvider *)provider;
g_autoptr(GPtrArray) ar = NULL;
gboolean ret;
IDE_ENTRY;
g_assert (IDE_IS_LANGSERV_RENAME_PROVIDER (self));
g_assert (IDE_IS_LANGSERV_RENAME_PROVIDER (provider));
g_assert (G_IS_TASK (result));
ar = g_task_propagate_pointer (G_TASK (result), error);
......
......@@ -4989,11 +4989,10 @@ ide_source_view_rename_edits_applied (GObject *object,
gpointer user_data)
{
g_autoptr(IdeSourceView) self = user_data;
IdeBufferManager *buffer_manager = (IdeBufferManager *)object;
IDE_ENTRY;
g_assert (IDE_IS_BUFFER_MANAGER (buffer_manager));
g_assert (IDE_IS_BUFFER_MANAGER (object));
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (IDE_IS_SOURCE_VIEW (self));
......
......@@ -428,11 +428,10 @@ static gboolean
ide_word_completion_provider_match (GtkSourceCompletionProvider *provider,
GtkSourceCompletionContext *context)
{
IdeWordCompletionProvider *self = (IdeWordCompletionProvider *) provider;
GtkSourceCompletionActivation activation;
GtkTextIter iter;
g_assert (IDE_IS_WORD_COMPLETION_PROVIDER (self));
g_assert (IDE_IS_WORD_COMPLETION_PROVIDER (provider));
g_assert (GTK_SOURCE_IS_COMPLETION_CONTEXT (context));
if (!gtk_source_completion_context_get_iter (context, &iter))
......
......@@ -566,9 +566,7 @@ ide_breakout_subprocess_send_signal (IdeSubprocess *subprocess,
static void
ide_breakout_subprocess_force_exit (IdeSubprocess *subprocess)
{
IdeBreakoutSubprocess *self = (IdeBreakoutSubprocess *)subprocess;
g_assert (IDE_IS_BREAKOUT_SUBPROCESS (self));
g_assert (IDE_IS_BREAKOUT_SUBPROCESS (subprocess));
ide_breakout_subprocess_send_signal (subprocess, SIGKILL);
}
......@@ -835,14 +833,13 @@ ide_breakout_subprocess_communicate_finish (IdeSubprocess *subprocess,
GBytes **stderr_buf,
GError **error)
{
IdeBreakoutSubprocess *self = (IdeBreakoutSubprocess *)subprocess;
CommunicateState *state;
GTask *task = (GTask *)result;
gboolean success;
IDE_ENTRY;
g_assert (IDE_IS_BREAKOUT_SUBPROCESS (self));
g_assert (IDE_IS_BREAKOUT_SUBPROCESS (subprocess));
g_assert (G_IS_TASK (task));
g_object_ref (task);
......
......@@ -159,8 +159,6 @@ gb_beautifier_process_create_for_clang_format (GbBeautifierEditorAddin *self,
g_autoptr(GSubprocessLauncher) launcher = NULL;
GSubprocess *subprocess = NULL;
GPtrArray *args;
gchar *config_path;
gchar *src_path;
g_autofree gchar *tmp_workdir = NULL;
g_autofree gchar *tmp_config_path = NULL;
g_autofree gchar *tmp_src_path = NULL;
......@@ -168,11 +166,6 @@ gb_beautifier_process_create_for_clang_format (GbBeautifierEditorAddin *self,
g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
g_assert (state != NULL);
config_path = g_file_get_path (state->config_file);
src_path = g_file_get_path (state->src_file);
g_assert (!dzl_str_empty0 (config_path));
g_assert (!dzl_str_empty0 (src_path));
g_assert (!dzl_str_empty0 (state->lang_id));
tmp_workdir = g_build_filename (self->tmp_dir, "clang-XXXXXX.txt", NULL);
......
......@@ -516,12 +516,11 @@ gbp_cmake_build_system_get_build_flags_finish (IdeBuildSystem *build_system,
GAsyncResult *result,
GError **error)
{
GbpCMakeBuildSystem *self = (GbpCMakeBuildSystem *)build_system;
gchar **build_flags;
IDE_ENTRY;
g_assert (GBP_IS_CMAKE_BUILD_SYSTEM (self));
g_assert (GBP_IS_CMAKE_BUILD_SYSTEM (build_system));
g_assert (G_IS_TASK (result));
build_flags = g_task_propagate_pointer (G_TASK (result), error);
......
......@@ -159,7 +159,6 @@ ide_persistent_map_builder_write_worker (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
IdePersistentMapBuilder *self = source_object;
BuildState *state = task_data;
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) data = NULL;
......@@ -170,7 +169,7 @@ ide_persistent_map_builder_write_worker (GTask *task,
GVariant *metadata;
g_assert (G_IS_TASK (task));
g_assert (IDE_IS_PERSISTENT_MAP_BUILDER (self));
g_assert (IDE_IS_PERSISTENT_MAP_BUILDER (source_object));
g_assert (state != NULL);
g_assert (state->keys != NULL);
g_assert (state->keys_hash != NULL);
......
......@@ -454,14 +454,10 @@ ide_ctags_index_init_finish (GAsyncInitable *initable,
GAsyncResult *result,
GError **error)
{
IdeCtagsIndex *self = (IdeCtagsIndex *)initable;
GTask *task = (GTask *)result;
g_assert (IDE_IS_CTAGS_INDEX (self));
g_assert (IDE_IS_CTAGS_INDEX (initable));
g_assert (G_IS_TASK (result));
g_assert (G_IS_TASK (task));
return g_task_propagate_boolean (task, error);
return g_task_propagate_boolean (G_TASK (result), error);
}
static void
......
......@@ -465,10 +465,11 @@ build_system_tags_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
IdeTagsBuilder *builder = (IdeTagsBuilder *)object;
g_autoptr(IdeCtagsService) self = user_data;
g_assert (IDE_IS_TAGS_BUILDER (builder));
g_assert (IDE_IS_TAGS_BUILDER (object));
g_assert (G_IS_ASYNC_RESULT (result));
g_assert (IDE_IS_CTAGS_SERVICE (self));
ide_ctags_service_queue_mine (self);
}
......
......@@ -608,14 +608,13 @@ gbp_flatpak_application_addin_install_runtime_worker (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
GbpFlatpakApplicationAddin *self = source_object;
InstallRequest *request = task_data;
g_autoptr(GError) error = NULL;
IDE_ENTRY;
g_assert (G_IS_TASK (task));
g_assert (GBP_IS_FLATPAK_APPLICATION_ADDIN (self));
g_assert (GBP_IS_FLATPAK_APPLICATION_ADDIN (source_object));
g_assert (request != NULL);
g_assert (request->id != NULL);
g_assert (request->arch != NULL);
......
......@@ -61,14 +61,10 @@ static void
manifest_save_tick (GTask *task)
{
g_autoptr(GbpFlatpakManifest) manifest = NULL;
GbpFlatpakConfigurationProvider *self;
GPtrArray *manifests;
g_assert (G_IS_TASK (task));
self = g_task_get_source_object (task);
g_assert (GBP_IS_FLATPAK_CONFIGURATION_PROVIDER (self));
manifests = g_task_get_task_data (task);
g_assert (manifests != NULL);
......@@ -606,7 +602,6 @@ static void
gbp_flatpak_configuration_provider_duplicate (IdeConfigurationProvider *provider,
IdeConfiguration *configuration)
{
GbpFlatpakConfigurationProvider *self = (GbpFlatpakConfigurationProvider *)provider;
GbpFlatpakManifest *manifest = (GbpFlatpakManifest *)configuration;
g_autofree gchar *path = NULL;
g_autofree gchar *base = NULL;
......@@ -614,7 +609,7 @@ gbp_flatpak_configuration_provider_duplicate (IdeConfigurationProvider *provider
gchar *dot;
GFile *file;
g_assert (GBP_IS_FLATPAK_CONFIGURATION_PROVIDER (self));
g_assert (GBP_IS_FLATPAK_CONFIGURATION_PROVIDER (provider));
g_assert (GBP_IS_FLATPAK_MANIFEST (manifest));
file = gbp_flatpak_manifest_get_file (manifest);
......
......@@ -322,7 +322,6 @@ gbp_flatpak_runtime_provider_locate_sdk_cb (GObject *object,
g_autoptr(GTask) task = user_data;
g_autoptr(GError) error = NULL;
g_autofree gchar *docs_id = NULL;
GbpFlatpakRuntimeProvider *self;
IdeTransferManager *transfer_manager;
InstallRuntime *install;
GCancellable *cancellable;
......@@ -335,14 +334,11 @@ gbp_flatpak_runtime_provider_locate_sdk_cb (GObject *object,
g_assert (G_IS_TASK (task));
g_assert (!g_task_get_completed (task));
self = g_task_get_source_object (task);
install = g_task_get_task_data (task);
cancellable = g_task_get_cancellable (task);
g_assert (install != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
g_assert (self != NULL);
g_assert (GBP_IS_FLATPAK_RUNTIME_PROVIDER (self));
transfer_manager = ide_application_get_transfer_manager (IDE_APPLICATION_DEFAULT);
......
......@@ -308,9 +308,7 @@ static void
gbp_flatpak_runtime_prepare_configuration (IdeRuntime *runtime,
IdeConfiguration *configuration)
{
GbpFlatpakRuntime* self = (GbpFlatpakRuntime *)runtime;
g_assert (GBP_IS_FLATPAK_RUNTIME (self));
g_assert (GBP_IS_FLATPAK_RUNTIME (runtime));
g_assert (IDE_IS_CONFIGURATION (configuration));
ide_configuration_set_prefix (configuration, "/app");
......
......@@ -702,10 +702,9 @@ static gboolean
gb_project_tree_builder_node_draggable (DzlTreeBuilder *builder,
DzlTreeNode *node)
{
GbProjectTreeBuilder *self = (GbProjectTreeBuilder *)builder;
GObject *item;
g_assert (GB_IS_PROJECT_TREE_BUILDER (self));
g_assert (GB_IS_PROJECT_TREE_BUILDER (builder));
g_assert (DZL_IS_TREE_NODE (node));
item = dzl_tree_node_get_item (node);
......@@ -718,10 +717,9 @@ gb_project_tree_builder_node_droppable (DzlTreeBuilder *builder,
DzlTreeNode *node,
GtkSelectionData *data)
{
GbProjectTreeBuilder *self = (GbProjectTreeBuilder *)builder;
GObject *item;
g_assert (GB_IS_PROJECT_TREE_BUILDER (self));
g_assert (GB_IS_PROJECT_TREE_BUILDER (builder));
g_assert (DZL_IS_TREE_NODE (node));
item = dzl_tree_node_get_item (node);
......@@ -734,10 +732,9 @@ gb_project_tree_builder_drag_data_get (DzlTreeBuilder *builder,
DzlTreeNode *node,
GtkSelectionData *data)
{
GbProjectTreeBuilder *self = (GbProjectTreeBuilder *)builder;
GObject *item;
g_assert (GB_IS_PROJECT_TREE_BUILDER (self));
g_assert (GB_IS_PROJECT_TREE_BUILDER (builder));
g_assert (DZL_IS_TREE_NODE (node));
if (gtk_selection_data_get_target (data) != _ATOM ("text/uri-list"))
......@@ -764,9 +761,7 @@ gb_project_tree_builder_drag_data_received (DzlTreeBuilder *builder,
GdkDragAction action,
GtkSelectionData *data)
{
GbProjectTreeBuilder *self = (GbProjectTreeBuilder *)builder;
g_assert (GB_IS_PROJECT_TREE_BUILDER (self));
g_assert (GB_IS_PROJECT_TREE_BUILDER (builder));
g_assert (DZL_IS_TREE_NODE (drop_node));
g_assert (data != NULL);
g_assert (action == GDK_ACTION_COPY || action == GDK_ACTION_MOVE);
......@@ -843,11 +838,10 @@ gb_project_tree_builder_drag_node_received (DzlTreeBuilder *builder,
GdkDragAction action,
GtkSelectionData *data)
{
GbProjectTreeBuilder *self = (GbProjectTreeBuilder *)builder;
GObject *drag_item;
GObject *drop_item;
g_assert (GB_IS_PROJECT_TREE_BUILDER (self));
g_assert (GB_IS_PROJECT_TREE_BUILDER (builder));
g_assert (DZL_IS_TREE_NODE (drag_node));
g_assert (DZL_IS_TREE_NODE (drop_node));
g_assert (data != NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment