[gnome-builder/gnome-builder-3-28] build: fix various warnings in release builds
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-28] build: fix various warnings in release builds
- Date: Tue, 10 Apr 2018 05:41:14 +0000 (UTC)
commit f46ba379ae64505e80e4514012bc6495829c1ebd
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 9 22:38:38 2018 -0700
build: fix various warnings in release builds
src/plugins/terminal/gb-terminal-view-actions.c | 3 +--
src/plugins/xml-pack/ide-xml-parser.c | 12 ++++++------
src/tests/test-ide-buffer-manager.c | 8 ++++----
src/tests/test-line-reader.c | 6 +++---
4 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/terminal/gb-terminal-view-actions.c b/src/plugins/terminal/gb-terminal-view-actions.c
index afa2e091c..fc02b56c8 100644
--- a/src/plugins/terminal/gb-terminal-view-actions.c
+++ b/src/plugins/terminal/gb-terminal-view-actions.c
@@ -70,14 +70,13 @@ save_worker (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
- GbTerminalView *view = source_object;
SaveTask *savetask = (SaveTask *)task_data;
g_autoptr(GError) error = NULL;
gboolean ret;
g_assert (IDE_IS_MAIN_THREAD ());
g_assert (G_IS_TASK (task));
- g_assert (GB_IS_TERMINAL_VIEW (view));
+ g_assert (GB_IS_TERMINAL_VIEW (source_object));
g_assert (savetask != NULL);
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
diff --git a/src/plugins/xml-pack/ide-xml-parser.c b/src/plugins/xml-pack/ide-xml-parser.c
index d61a56242..d7996b21c 100644
--- a/src/plugins/xml-pack/ide-xml-parser.c
+++ b/src/plugins/xml-pack/ide-xml-parser.c
@@ -340,7 +340,6 @@ ide_xml_parser_error_sax_cb (ParserState *state,
const xmlChar *name,
...)
{
- IdeXmlParser *self = (IdeXmlParser *)state->self;
IdeDiagnostic *diagnostic;
xmlParserCtxt *context;
xmlError *error;
@@ -349,7 +348,8 @@ ide_xml_parser_error_sax_cb (ParserState *state,
g_autofree gchar *msg = NULL;
va_list var_args;
- g_assert (IDE_IS_XML_PARSER (self));
+ g_assert (state != NULL);
+ g_assert (IDE_IS_XML_PARSER (state->self));
va_start (var_args, name);
msg = g_strdup_vprintf ((const gchar *)name, var_args);
@@ -426,10 +426,10 @@ ide_xml_parser_internal_subset_sax_cb (ParserState *state,
const xmlChar *external_id,
const xmlChar *system_id)
{
- IdeXmlParser *self = (IdeXmlParser *)state->self;
IdeXmlSchemaCacheEntry *entry;
- g_assert (IDE_IS_XML_PARSER (self));
+ g_assert (state != NULL);
+ g_assert (IDE_IS_XML_PARSER (state->self));
entry = ide_xml_schema_cache_entry_new ();
entry->kind = SCHEMA_KIND_DTD;
@@ -472,14 +472,14 @@ ide_xml_parser_processing_instruction_sax_cb (ParserState *state,
const xmlChar *target,
const xmlChar *data)
{
- IdeXmlParser *self = (IdeXmlParser *)state->self;
IdeDiagnostic *diagnostic;
g_autofree gchar *schema_url = NULL;
const gchar *extension;
IdeXmlSchemaCacheEntry *entry;
IdeXmlSchemaKind kind;
- g_assert (IDE_IS_XML_PARSER (self));
+ g_assert (state != NULL);
+ g_assert (IDE_IS_XML_PARSER (state->self));
if (NULL != (schema_url = get_schema_url ((const gchar *)data)))
{
diff --git a/src/tests/test-ide-buffer-manager.c b/src/tests/test-ide-buffer-manager.c
index e9f9d4a4c..40786fe9f 100644
--- a/src/tests/test-ide-buffer-manager.c
+++ b/src/tests/test-ide-buffer-manager.c
@@ -16,6 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef G_DISABLE_ASSERT
+# undef G_DISABLE_ASSERT
+#endif
+
#include <glib.h>
#include <glib/gstdio.h>
#include <ide.h>
@@ -23,10 +27,6 @@
#include "application/ide-application-tests.h"
#include "../plugins/gnome-builder-plugins.h"
-#ifdef G_DISABLE_ASSERT
-# undef G_DISABLE_ASSERT
-#endif
-
static gint save_count;
static gint load_count;
static gchar *tmpfilename;
diff --git a/src/tests/test-line-reader.c b/src/tests/test-line-reader.c
index 3357a0608..182caead7 100644
--- a/src/tests/test-line-reader.c
+++ b/src/tests/test-line-reader.c
@@ -16,13 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <ide.h>
-#include <string.h>
-
#ifdef G_DISABLE_ASSERT
# undef G_DISABLE_ASSERT
#endif
+#include <ide.h>
+#include <string.h>
+
static void
test_line_reader_basic (void)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]