[gnome-builder] build: fix various warnings with Clang



commit 0b3c43a240ed48c4ccee15ff14e497a68b55914c
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 23 15:49:03 2020 -0800

    build: fix various warnings with Clang

 src/libide/editor/ide-editor-settings-dialog.c               | 1 -
 src/libide/gui/ide-application-command-line.c                | 1 -
 src/plugins/c-pack/hdr-format.c                              | 1 -
 src/plugins/code-index/gbp-code-index-application-addin.c    | 2 --
 src/plugins/file-search/gbp-file-search-index.c              | 2 --
 src/plugins/gdb/gbp-gdb-debugger.c                           | 3 ++-
 src/plugins/git/gbp-git-client.c                             | 1 -
 src/plugins/git/gbp-git-workbench-addin.c                    | 1 -
 src/plugins/project-tree/gbp-project-tree-pane-actions.c     | 2 --
 src/plugins/qemu/gbp-qemu-device-provider.c                  | 2 ++
 src/plugins/restore-cursor/gbp-restore-cursor-buffer-addin.c | 1 -
 src/plugins/shellcmd/gbp-shellcmd-command-provider.c         | 2 --
 src/plugins/shellcmd/gbp-shellcmd-command.c                  | 4 ----
 src/plugins/symbol-tree/gbp-symbol-frame-addin.c             | 2 --
 src/plugins/symbol-tree/gbp-symbol-hover-provider.c          | 2 --
 src/plugins/todo/gbp-todo-panel.c                            | 1 -
 src/plugins/update-manager/meson.build                       | 2 ++
 17 files changed, 6 insertions(+), 24 deletions(-)
---
diff --git a/src/libide/editor/ide-editor-settings-dialog.c b/src/libide/editor/ide-editor-settings-dialog.c
index 7f3bf653a..73b05da5c 100644
--- a/src/libide/editor/ide-editor-settings-dialog.c
+++ b/src/libide/editor/ide-editor-settings-dialog.c
@@ -293,7 +293,6 @@ ide_editor_settings_dialog_class_init (IdeEditorSettingsDialogClass *klass)
 static void
 ide_editor_settings_dialog_init (IdeEditorSettingsDialog *self)
 {
-  g_autoptr(GtkListStore) store = NULL;
   GtkSourceLanguageManager *manager;
   const gchar * const *lang_ids;
   GValue idval = {0};
diff --git a/src/libide/gui/ide-application-command-line.c b/src/libide/gui/ide-application-command-line.c
index 3cd89ea8c..4ba09e920 100644
--- a/src/libide/gui/ide-application-command-line.c
+++ b/src/libide/gui/ide-application-command-line.c
@@ -137,7 +137,6 @@ void
 _ide_application_command_line (IdeApplication          *self,
                                GApplicationCommandLine *cmdline)
 {
-  g_autoptr(PeasExtensionSet) set = NULL;
   g_autofree gchar *project = NULL;
   GVariantDict *dict;
 
diff --git a/src/plugins/c-pack/hdr-format.c b/src/plugins/c-pack/hdr-format.c
index 774a2de75..05e9253d0 100644
--- a/src/plugins/c-pack/hdr-format.c
+++ b/src/plugins/c-pack/hdr-format.c
@@ -195,7 +195,6 @@ push_chunk (GArray      *ar,
             const gchar *str)
 {
   g_autofree gchar *attr = NULL;
-  g_autofree gchar *post = NULL;
   g_autofree gchar *return_type = NULL;
   g_autofree gchar *ident = NULL;
   const gchar *pos;
diff --git a/src/plugins/code-index/gbp-code-index-application-addin.c 
b/src/plugins/code-index/gbp-code-index-application-addin.c
index 3d4551b58..58ff97453 100644
--- a/src/plugins/code-index/gbp-code-index-application-addin.c
+++ b/src/plugins/code-index/gbp-code-index-application-addin.c
@@ -74,8 +74,6 @@ gbp_code_index_application_addin_foreach_cb (GFile              *directory,
                                              gpointer            user_data)
 {
   GApplicationCommandLine *cmdline = user_data;
-  g_autofree gchar *path = NULL;
-  g_autoptr(GFile) file = NULL;
 
   g_assert (G_IS_FILE (directory));
   g_assert (plan_items != NULL);
diff --git a/src/plugins/file-search/gbp-file-search-index.c b/src/plugins/file-search/gbp-file-search-index.c
index 4e519a6f5..5f12790f2 100644
--- a/src/plugins/file-search/gbp-file-search-index.c
+++ b/src/plugins/file-search/gbp-file-search-index.c
@@ -383,8 +383,6 @@ gbp_file_search_index_populate (GbpFileSearchIndex *self,
           g_autoptr(GbpFileSearchResult) result = NULL;
           g_autofree gchar *escaped = NULL;
           g_autofree gchar *markup = NULL;
-          g_autofree gchar *free_me = NULL;
-          g_autofree gchar *free_me_sym = NULL;
           const gchar *filename = match->key;
           g_autofree gchar *content_type = NULL;
           g_autoptr(GIcon) themed_icon = NULL;
diff --git a/src/plugins/gdb/gbp-gdb-debugger.c b/src/plugins/gdb/gbp-gdb-debugger.c
index ac09b98aa..060e435a8 100644
--- a/src/plugins/gdb/gbp-gdb-debugger.c
+++ b/src/plugins/gdb/gbp-gdb-debugger.c
@@ -139,8 +139,9 @@ gbp_gdb_debugger_translate_path (GbpGdbDebugger *self,
   /* If we still have access to the runtime, translate */
   if (runtime != NULL)
     {
-      g_autoptr(GFile) freeme = file;
+      GFile *freeme = file;
       file = ide_runtime_translate_file (runtime, file);
+      g_clear_object (&freeme);
     }
 
   return g_file_get_path (file);
diff --git a/src/plugins/git/gbp-git-client.c b/src/plugins/git/gbp-git-client.c
index d5a40e22b..a7eba6adb 100644
--- a/src/plugins/git/gbp-git-client.c
+++ b/src/plugins/git/gbp-git-client.c
@@ -55,7 +55,6 @@ gbp_git_client_subprocess_spawned (GbpGitClient            *self,
                                    IdeSubprocessSupervisor *supervisor)
 {
   g_autoptr(GIOStream) stream = NULL;
-  g_autoptr(GVariant) params = NULL;
   GOutputStream *output;
   GInputStream *input;
   GList *queued;
diff --git a/src/plugins/git/gbp-git-workbench-addin.c b/src/plugins/git/gbp-git-workbench-addin.c
index 51ad4b58d..520d5f4f1 100644
--- a/src/plugins/git/gbp-git-workbench-addin.c
+++ b/src/plugins/git/gbp-git-workbench-addin.c
@@ -174,7 +174,6 @@ gbp_git_workbench_addin_load_project_async (IdeWorkbenchAddin   *addin,
 {
   GbpGitWorkbenchAddin *self = (GbpGitWorkbenchAddin *)addin;
   g_autoptr(IdeTask) task = NULL;
-  g_autoptr(GError) error = NULL;
   GbpGitClient *client;
   IdeContext *context;
 
diff --git a/src/plugins/project-tree/gbp-project-tree-pane-actions.c 
b/src/plugins/project-tree/gbp-project-tree-pane-actions.c
index 53fa73c6c..acc3bac6d 100644
--- a/src/plugins/project-tree/gbp-project-tree-pane-actions.c
+++ b/src/plugins/project-tree/gbp-project-tree-pane-actions.c
@@ -539,10 +539,8 @@ gbp_project_tree_pane_actions_open_in_terminal (GSimpleAction *action,
   IdeProjectFile *project_file;
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autoptr(IdeSubprocess) subprocess = NULL;
-  g_autoptr(GFile) file = NULL;
   IdeTreeNode *selected;
   g_autofree gchar *terminal_executable = NULL;
-  g_auto(GStrv) env = NULL;
   g_autoptr(GFile) workdir = NULL;
   g_autoptr(GError) error = NULL;
 
diff --git a/src/plugins/qemu/gbp-qemu-device-provider.c b/src/plugins/qemu/gbp-qemu-device-provider.c
index 3d893b5b3..a8d2add5f 100644
--- a/src/plugins/qemu/gbp-qemu-device-provider.c
+++ b/src/plugins/qemu/gbp-qemu-device-provider.c
@@ -32,6 +32,7 @@ struct _GbpQemuDeviceProvider
 
 G_DEFINE_TYPE (GbpQemuDeviceProvider, gbp_qemu_device_provider, IDE_TYPE_DEVICE_PROVIDER)
 
+#ifdef __linux__
 static const struct {
   const gchar *filename;
   const gchar *arch;
@@ -41,6 +42,7 @@ static const struct {
   { "qemu-aarch64", "aarch64", N_("Aarch64 Emulation") },
   { "qemu-arm",     "arm",     N_("Arm Emulation") },
 };
+#endif
 
 #ifdef __linux__
 static gboolean
diff --git a/src/plugins/restore-cursor/gbp-restore-cursor-buffer-addin.c 
b/src/plugins/restore-cursor/gbp-restore-cursor-buffer-addin.c
index 74f67547b..677f09b22 100644
--- a/src/plugins/restore-cursor/gbp-restore-cursor-buffer-addin.c
+++ b/src/plugins/restore-cursor/gbp-restore-cursor-buffer-addin.c
@@ -109,7 +109,6 @@ gbp_restore_cursor_buffer_addin_file_loaded (IdeBufferAddin *addin,
                                              GFile          *file)
 {
   g_autoptr(GSettings) settings = NULL;
-  g_autoptr(GFileInfo) file_info = NULL;
 
   g_assert (IDE_IS_MAIN_THREAD ());
   g_assert (GBP_IS_RESTORE_CURSOR_BUFFER_ADDIN (addin));
diff --git a/src/plugins/shellcmd/gbp-shellcmd-command-provider.c 
b/src/plugins/shellcmd/gbp-shellcmd-command-provider.c
index 8daa5a293..e73508ca0 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-command-provider.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-command-provider.c
@@ -67,7 +67,6 @@ gbp_shellcmd_command_provider_query_async (IdeCommandProvider  *provider,
   GbpShellcmdCommandProvider *self = (GbpShellcmdCommandProvider *)provider;
   g_autoptr(IdeTask) task = NULL;
   g_autoptr(GPtrArray) ret = NULL;
-  g_autofree gchar *quoted = NULL;
   IdeContext *context;
 
   g_assert (GBP_IS_SHELLCMD_COMMAND_PROVIDER (provider));
@@ -176,7 +175,6 @@ on_model_keybindings_changed_cb (GbpShellcmdCommandProvider *self,
       g_autoptr(GbpShellcmdCommand) command = NULL;
       g_autofree gchar *dzlcmdid = NULL;
       g_autofree gchar *dzlcmdaction = NULL;
-      g_autofree gchar *delimit = NULL;
       const gchar *shortcut;
       const gchar *id;
 
diff --git a/src/plugins/shellcmd/gbp-shellcmd-command.c b/src/plugins/shellcmd/gbp-shellcmd-command.c
index 8c2479edb..4a79e018f 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-command.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-command.c
@@ -365,7 +365,6 @@ gbp_shellcmd_command_apply (GbpShellcmdCommand    *self,
                             GFile                 *relative_to)
 {
   g_autoptr(IdeContext) context = NULL;
-  g_autoptr(GError) error = NULL;
   g_autoptr(GFile) workdir = NULL;
   g_autoptr(GFile) cwd = NULL;
   const gchar *builddir = NULL;
@@ -430,9 +429,7 @@ gbp_shellcmd_command_run_host (GbpShellcmdCommand  *self,
 {
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autoptr(IdeTerminalLauncher) tlauncher = NULL;
-  g_autoptr(IdeSubprocess) subprocess = NULL;
   g_autoptr(IdeContext) context = NULL;
-  g_autoptr(GError) error = NULL;
   g_autoptr(GFile) workdir = NULL;
   IdeWorkspace *workspace;
   IdeWorkbench *workbench;
@@ -621,7 +618,6 @@ gbp_shellcmd_command_run_build (GbpShellcmdCommand  *self,
 {
   g_autoptr(IdeSubprocessLauncher) launcher = NULL;
   g_autoptr(IdeTerminalLauncher) tlauncher = NULL;
-  g_autoptr(IdeSubprocess) subprocess = NULL;
   g_autoptr(IdeContext) context = NULL;
   g_autoptr(GError) error = NULL;
   g_autoptr(GFile) builddir = NULL;
diff --git a/src/plugins/symbol-tree/gbp-symbol-frame-addin.c 
b/src/plugins/symbol-tree/gbp-symbol-frame-addin.c
index ee0d13379..87a92e550 100644
--- a/src/plugins/symbol-tree/gbp-symbol-frame-addin.c
+++ b/src/plugins/symbol-tree/gbp-symbol-frame-addin.c
@@ -386,8 +386,6 @@ gbp_symbol_frame_addin_bind (GbpSymbolFrameAddin *self,
                              IdeBuffer           *buffer,
                              DzlSignalGroup      *buffer_signals)
 {
-  g_autoptr(GPtrArray) resolvers = NULL;
-
   g_assert (GBP_IS_SYMBOL_FRAME_ADDIN (self));
   g_assert (IDE_IS_BUFFER (buffer));
   g_assert (DZL_IS_SIGNAL_GROUP (buffer_signals));
diff --git a/src/plugins/symbol-tree/gbp-symbol-hover-provider.c 
b/src/plugins/symbol-tree/gbp-symbol-hover-provider.c
index 270659d72..ff129b740 100644
--- a/src/plugins/symbol-tree/gbp-symbol-hover-provider.c
+++ b/src/plugins/symbol-tree/gbp-symbol-hover-provider.c
@@ -68,8 +68,6 @@ gbp_symbol_hover_provider_get_symbol_cb (GObject      *object,
   g_autoptr(IdeTask) task = user_data;
   g_autoptr(IdeSymbol) symbol = NULL;
   g_autoptr(GError) error = NULL;
-  g_autoptr(GString) str = NULL;
-  g_autoptr(IdeMarkedContent) content = NULL;
   g_autofree gchar *tt = NULL;
   IdeHoverContext *context;
   const gchar *name;
diff --git a/src/plugins/todo/gbp-todo-panel.c b/src/plugins/todo/gbp-todo-panel.c
index 552eadd95..bd15a0ee8 100644
--- a/src/plugins/todo/gbp-todo-panel.c
+++ b/src/plugins/todo/gbp-todo-panel.c
@@ -97,7 +97,6 @@ gbp_todo_panel_row_activated (GbpTodoPanel      *self,
 {
   g_autoptr(GbpTodoItem) item = NULL;
   g_autoptr(GFile) file = NULL;
-  g_autofree gchar *fragment = NULL;
   IdeWorkbench *workbench;
   GtkTreeModel *model;
   const gchar *path;
diff --git a/src/plugins/update-manager/meson.build b/src/plugins/update-manager/meson.build
index 255d5af4c..850971308 100644
--- a/src/plugins/update-manager/meson.build
+++ b/src/plugins/update-manager/meson.build
@@ -1,4 +1,5 @@
 if get_option('plugin_update_manager')
+if host_machine.system() == 'linux'
 
 plugins_deps += [
   libportal_dep,
@@ -18,3 +19,4 @@ plugin_update_manager_resources = gnome.compile_resources(
 plugins_sources += plugin_update_manager_resources
 
 endif
+endif


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