[gnome-builder] build: squash a bunch of warnings
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] build: squash a bunch of warnings
- Date: Thu, 30 Apr 2015 00:37:39 +0000 (UTC)
commit 39e5938a78e13a80930183241d076ccecfa44c59
Author: Christian Hergert <christian hergert me>
Date: Wed Apr 29 02:29:42 2015 -0700
build: squash a bunch of warnings
libide/autotools/ide-makecache.c | 8 +++---
libide/clang/ide-clang-completion-item.c | 2 +-
libide/clang/ide-clang-service.c | 2 +-
libide/clang/ide-clang-translation-unit.c | 2 +-
libide/editorconfig/libeditorconfig/ec_glob.c | 7 ++---
libide/editorconfig/libeditorconfig/editorconfig.c | 16 ++++++++------
libide/ide-back-forward-list.c | 6 ++--
libide/ide-buffer.c | 1 +
libide/ide-project-files.c | 21 +++++++++++--------
libide/ide-source-view.c | 3 +-
libide/ide-unsaved-files.c | 6 ++--
libide/modelines/modeline-parser.c | 1 +
libide/python/ide-python-indenter.c | 2 -
libide/tasks/ide-load-directory-task.c | 1 -
tests/test-c-parse-helper.c | 6 +----
tests/test-ide-back-forward-list.c | 2 -
tests/test-ide-buffer-manager.c | 2 -
tests/test-ide-buffer.c | 2 -
tests/test-ide-context.c | 2 -
tools/ide-list-diagnostics.c | 6 +++-
20 files changed, 45 insertions(+), 53 deletions(-)
---
diff --git a/libide/autotools/ide-makecache.c b/libide/autotools/ide-makecache.c
index f6296a3..503153d 100644
--- a/libide/autotools/ide-makecache.c
+++ b/libide/autotools/ide-makecache.c
@@ -283,7 +283,7 @@ ide_makecache_get_file_targets_cached (IdeMakecache *self,
ret = g_hash_table_lookup (self->file_targets_cache, path);
- IDE_DEBUG ("File targets cache %s for %s.", ret ? "hit" : "miss", path);
+ g_debug ("File targets cache %s for %s.", ret ? "hit" : "miss", path);
IDE_RETURN (ret);
}
@@ -444,7 +444,7 @@ ide_makecache_validate_mapped_file (GMappedFile *mapped,
g_assert (error);
g_assert (!*error);
- IDE_DEBUG ("Validating makecache");
+ g_debug ("Validating makecache");
contents = g_mapped_file_get_contents (mapped);
@@ -510,7 +510,7 @@ ide_makecache_open_temp (IdeMakecache *self,
"makecache",
NULL);
- IDE_DEBUG ("Using \"%s\" for makecache directory", directory);
+ g_debug ("Using \"%s\" for makecache directory", directory);
if (g_mkdir_with_parents (directory, 0700) != 0)
{
@@ -525,7 +525,7 @@ ide_makecache_open_temp (IdeMakecache *self,
name = g_strdup_printf ("%s.makecache.tmp-%u", project_name, (guint)now);
path = g_build_filename (directory, name, NULL);
- IDE_DEBUG ("Creating temporary makecache at \"%s\"", path);
+ g_debug ("Creating temporary makecache at \"%s\"", path);
fd = g_open (path, O_CREAT|O_RDWR, 0600);
diff --git a/libide/clang/ide-clang-completion-item.c b/libide/clang/ide-clang-completion-item.c
index 4bf4739..4fcfe8a 100644
--- a/libide/clang/ide-clang-completion-item.c
+++ b/libide/clang/ide-clang-completion-item.c
@@ -110,7 +110,7 @@ ide_clang_completion_item_lazy_init (IdeClangCompletionItem *self)
/*
* Try to determine the icon to use for this result.
*/
- switch (result->CursorKind)
+ switch ((int)result->CursorKind)
{
case CXCursor_CXXMethod:
case CXCursor_Constructor:
diff --git a/libide/clang/ide-clang-service.c b/libide/clang/ide-clang-service.c
index 1075bac..4533d4c 100644
--- a/libide/clang/ide-clang-service.c
+++ b/libide/clang/ide-clang-service.c
@@ -95,7 +95,7 @@ ide_clang_service_build_index_visitor (CXCursor cursor,
kind = clang_getCursorKind (cursor);
- switch (kind)
+ switch ((int)kind)
{
case CXCursor_TypedefDecl:
case CXCursor_TypeAliasDecl:
diff --git a/libide/clang/ide-clang-translation-unit.c b/libide/clang/ide-clang-translation-unit.c
index aae2210..f0de10d 100644
--- a/libide/clang/ide-clang-translation-unit.c
+++ b/libide/clang/ide-clang-translation-unit.c
@@ -966,7 +966,7 @@ ide_clang_translation_unit_get_symbols__visitor_cb (CXCursor cursor,
kind = clang_getCursorKind (cursor);
- switch (kind)
+ switch ((int)kind)
{
case CXCursor_FunctionDecl:
case CXCursor_TypedefDecl:
diff --git a/libide/editorconfig/libeditorconfig/ec_glob.c b/libide/editorconfig/libeditorconfig/ec_glob.c
index 684c90e..22182b8 100644
--- a/libide/editorconfig/libeditorconfig/ec_glob.c
+++ b/libide/editorconfig/libeditorconfig/ec_glob.c
@@ -1,16 +1,16 @@
/*
* Copyright (c) 2014 Hong Xu <hong AT topbug DOT net>
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -321,7 +321,6 @@ int ec_glob(const char *pattern, const char *string)
if (rc < 0) /* failed to match */
{
- int ret;
if (rc == PCRE_ERROR_NOMATCH)
ret = EC_GLOB_NOMATCH;
else
diff --git a/libide/editorconfig/libeditorconfig/editorconfig.c
b/libide/editorconfig/libeditorconfig/editorconfig.c
index 9b5d91e..ce81a00 100644
--- a/libide/editorconfig/libeditorconfig/editorconfig.c
+++ b/libide/editorconfig/libeditorconfig/editorconfig.c
@@ -1,16 +1,16 @@
/*
* Copyright (c) 2011-2012 EditorConfig Team
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -100,7 +100,7 @@ static void reset_special_property_name_value_pointers(
array_editorconfig_name_value* aenv)
{
int i;
-
+
for (i = 0; i < aenv->current_value_count; ++ i)
set_special_property_name_value_pointers(
&aenv->name_values[i], &aenv->spnvp);
@@ -259,12 +259,12 @@ static int ini_handler(void* hfp, const char* section, const char* name,
return 1;
}
-/*
+/*
* Split an absolute file path into directory and filename parts.
*
* If absolute_path does not contain a path separator, set directory and
* filename to NULL pointers.
- */
+ */
static void split_file_path(char** directory, char** filename,
const char* absolute_path)
{
@@ -376,12 +376,14 @@ const char* editorconfig_get_error_msg(int err_num)
return "Memory error.";
case EDITORCONFIG_PARSE_VERSION_TOO_NEW:
return "Required version is greater than the current version.";
+ default:
+ break;
}
return "Unknown error.";
}
-/*
+/*
* See the header file for the use of this function
*/
EDITORCONFIG_EXPORT
diff --git a/libide/ide-back-forward-list.c b/libide/ide-back-forward-list.c
index 35abe78..7f380b9 100644
--- a/libide/ide-back-forward-list.c
+++ b/libide/ide-back-forward-list.c
@@ -761,10 +761,10 @@ ide_back_forward_list__load_contents_cb (GObject *object,
{
g_autoptr(IdeSourceLocation) srcloc = NULL;
g_autoptr(IdeBackForwardItem) item = NULL;
- g_autoptr(GFile) file = NULL;
+ g_autoptr(GFile) jump_file = NULL;
- file = g_file_new_for_uri (parts [2]);
- srcloc = create_source_location (self, file, line, line_offset);
+ jump_file = g_file_new_for_uri (parts [2]);
+ srcloc = create_source_location (self, jump_file, line, line_offset);
item = ide_back_forward_item_new (context, srcloc);
ide_back_forward_list_push (self, item);
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index 910fa13..ce15570 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -1233,6 +1233,7 @@ ide_buffer_get_line_flags (IdeBuffer *self,
flags |= IDE_BUFFER_LINE_FLAGS_CHANGED;
break;
+ case IDE_BUFFER_LINE_CHANGE_DELETED:
case IDE_BUFFER_LINE_CHANGE_NONE:
default:
break;
diff --git a/libide/ide-project-files.c b/libide/ide-project-files.c
index 49f8690..8005fa2 100644
--- a/libide/ide-project-files.c
+++ b/libide/ide-project-files.c
@@ -75,15 +75,18 @@ ide_project_files_find_child (IdeProjectItem *item,
!g_sequence_iter_is_end (iter);
iter = g_sequence_iter_next (iter))
{
- IdeProjectItem *item = g_sequence_get (iter);
+ IdeProjectItem *current_item = g_sequence_get (iter);
- if (IDE_IS_PROJECT_FILE (item))
+ if (IDE_IS_PROJECT_FILE (current_item))
{
- IdeProjectFile *file = IDE_PROJECT_FILE (item);
- const gchar *name = ide_project_file_get_name (file);
+ IdeProjectFile *file;
+ const gchar *name;
+
+ file = IDE_PROJECT_FILE (current_item);
+ name = ide_project_file_get_name (file);
if (g_strcmp0 (name, child) == 0)
- return item;
+ return current_item;
}
}
@@ -172,19 +175,19 @@ ide_project_files_get_file_for_path (IdeProjectFiles *self,
if (item)
{
IdeContext *context;
- const gchar *path;
+ const gchar *file_path;
GFile *gfile;
context = ide_object_get_context (IDE_OBJECT (self));
gfile = ide_project_file_get_file (IDE_PROJECT_FILE (item));
- path = ide_project_file_get_path (IDE_PROJECT_FILE (item));
+ file_path = ide_project_file_get_path (IDE_PROJECT_FILE (item));
file = g_object_new (IDE_TYPE_FILE,
"context", context,
"file", gfile,
- "path", path,
+ "path", file_path,
NULL);
if (file)
- g_hash_table_insert (priv->files_by_path, g_strdup (path), g_object_ref (file));
+ g_hash_table_insert (priv->files_by_path, g_strdup (file_path), g_object_ref (file));
}
return file;
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 96acd08..4928b40 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -4731,8 +4731,8 @@ ide_source_view_real_populate_popup (GtkTextView *text_view,
GtkWidget *popup)
{
IdeSourceView *self = (IdeSourceView *)text_view;
- GtkTextBuffer *buffer;
GtkSeparatorMenuItem *sep;
+ GtkTextBuffer *buffer;
GtkMenuItem *menu_item;
GtkTextMark *insert;
GtkTextIter iter;
@@ -4771,7 +4771,6 @@ ide_source_view_real_populate_popup (GtkTextView *text_view,
if (num_fixits > 0)
{
- GtkSeparatorMenuItem *sep;
GtkWidget *parent;
GtkWidget *submenu;
guint i;
diff --git a/libide/ide-unsaved-files.c b/libide/ide-unsaved-files.c
index 5f58c5e..0bf43c7 100644
--- a/libide/ide-unsaved-files.c
+++ b/libide/ide-unsaved-files.c
@@ -329,7 +329,7 @@ ide_unsaved_files_restore_worker (GTask *task,
g_autofree gchar *hash = NULL;
g_autofree gchar *path = NULL;
UnsavedFile *unsaved;
- gsize len;
+ gsize data_len;
if (!*lines [i])
continue;
@@ -343,7 +343,7 @@ ide_unsaved_files_restore_worker (GTask *task,
g_debug ("Loading draft for \"%s\" from \"%s\"", lines [i], path);
- if (!g_file_get_contents (path, &contents, &len, &error))
+ if (!g_file_get_contents (path, &contents, &data_len, &error))
{
g_warning ("%s", error->message);
g_clear_error (&error);
@@ -352,7 +352,7 @@ ide_unsaved_files_restore_worker (GTask *task,
unsaved = g_slice_new0 (UnsavedFile);
unsaved->file = g_object_ref (file);
- unsaved->content = g_bytes_new_take (contents, len);
+ unsaved->content = g_bytes_new_take (contents, data_len);
g_ptr_array_add (state->unsaved_files, unsaved);
}
diff --git a/libide/modelines/modeline-parser.c b/libide/modelines/modeline-parser.c
index abac589..e40c4ff 100644
--- a/libide/modelines/modeline-parser.c
+++ b/libide/modelines/modeline-parser.c
@@ -655,6 +655,7 @@ check_previous (GtkSourceView *view,
previous->language_id) == 0);
}
break;
+ case MODELINE_SET_NONE:
default:
return FALSE;
break;
diff --git a/libide/python/ide-python-indenter.c b/libide/python/ide-python-indenter.c
index b4570e6..bcba2c8 100644
--- a/libide/python/ide-python-indenter.c
+++ b/libide/python/ide-python-indenter.c
@@ -635,8 +635,6 @@ maybe_unindent_else_or_elif (IdePythonIndenter *python,
if ((line_starts_with (©, "if ") || line_starts_with (©, "for ")))
{
- guint line_offset;
-
line_offset = gtk_source_view_get_visual_column (sv, ©);
move_to_visual_column (sv, begin, line_offset);
IDE_RETURN (slice);
diff --git a/libide/tasks/ide-load-directory-task.c b/libide/tasks/ide-load-directory-task.c
index f45e817..5c1e6fd 100644
--- a/libide/tasks/ide-load-directory-task.c
+++ b/libide/tasks/ide-load-directory-task.c
@@ -144,7 +144,6 @@ ide_load_directory_task_load_directory (IdeLoadDirectoryTask *self,
g_autoptr(IdeProjectItem) item = NULL;
g_autoptr(GFile) file = NULL;
g_autofree gchar *path = NULL;
- GFileType file_type;
const gchar *name;
name = g_file_info_get_attribute_byte_string (child_info, G_FILE_ATTRIBUTE_STANDARD_NAME);
diff --git a/tests/test-c-parse-helper.c b/tests/test-c-parse-helper.c
index a0937d1..5508449 100644
--- a/tests/test-c-parse-helper.c
+++ b/tests/test-c-parse-helper.c
@@ -16,11 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef G_DISABLE_ASSERT
-# undef G_DISABLE_ASSERT
-#endif
-
-#include "c-parse-helper.h"
+#include "c/c-parse-helper.h"
static void
test_parse_parameters1 (void)
diff --git a/tests/test-ide-back-forward-list.c b/tests/test-ide-back-forward-list.c
index 09a985e..1977c13 100644
--- a/tests/test-ide-back-forward-list.c
+++ b/tests/test-ide-back-forward-list.c
@@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "tests.h"
-
#include <glib.h>
#include <ide.h>
diff --git a/tests/test-ide-buffer-manager.c b/tests/test-ide-buffer-manager.c
index 91fcf31..3051d5c 100644
--- a/tests/test-ide-buffer-manager.c
+++ b/tests/test-ide-buffer-manager.c
@@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "tests.h"
-
#include <glib.h>
#include <glib/gstdio.h>
#include <girepository.h>
diff --git a/tests/test-ide-buffer.c b/tests/test-ide-buffer.c
index a9cf76a..d4a1ece 100644
--- a/tests/test-ide-buffer.c
+++ b/tests/test-ide-buffer.c
@@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "tests.h"
-
#include <glib.h>
#include <glib/gstdio.h>
#include <girepository.h>
diff --git a/tests/test-ide-context.c b/tests/test-ide-context.c
index 98044b0..cade0d0 100644
--- a/tests/test-ide-context.c
+++ b/tests/test-ide-context.c
@@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "tests.h"
-
#include <girepository.h>
#include <ide.h>
diff --git a/tools/ide-list-diagnostics.c b/tools/ide-list-diagnostics.c
index d83357c..17d8507 100644
--- a/tools/ide-list-diagnostics.c
+++ b/tools/ide-list-diagnostics.c
@@ -125,11 +125,11 @@ print_diagnostic (IdeDiagnostic *diag)
if (linestr)
{
- gsize i;
+ gsize j;
g_print ("%s\n", linestr);
- for (i = 0; i < column; i++)
+ for (j = 0; j < column; j++)
g_print (" ");
if (isatty (STDOUT_FILENO))
@@ -279,6 +279,8 @@ main (gint argc,
ide_set_program_name ("gnome-builder");
g_set_prgname ("ide-list-diagnostics");
+ gtk_init (&argc, &argv);
+
context = g_option_context_new (_("- List diagnostics for a file."));
if (!g_option_context_parse (context, &argc, &argv, &error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]