[gnome-video-arcade] Fix some compiler warnings, suppress others.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-video-arcade] Fix some compiler warnings, suppress others.
- Date: Wed, 6 May 2015 01:47:36 +0000 (UTC)
commit c106001c07150f506d47534d124d0c3e876e6dd5
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue May 5 21:42:06 2015 -0400
Fix some compiler warnings, suppress others.
Not interested in GTK+ deprecating still useful APIs.
configure.ac | 40 ++++++++++++++++++++++++++++++++--------
src/Makefile.am | 1 +
src/gva-main.c | 2 +-
src/gva-properties.c | 6 +++---
4 files changed, 37 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8d4c7f3..02966a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,26 +23,50 @@ AC_SUBST(abs_top_builddir)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Dependencies
-GLIB_MODULES="glib-2.0 gio-2.0 >= 2.28"
-PKG_CHECK_MODULES(GLIB, $GLIB_MODULES)
+
+# Keep these two definitions in agreement.
+m4_define([glib_minimum_version], [2.28])
+m4_define([glib_encoded_version], [GLIB_VERSION_2_28])
+
+# Keep these two definitions in agreement.
+m4_define([gdk_minimum_version], [3.0])
+m4_define([gdk_encoded_version], [GDK_VERSION_3_0])
+
+# Keep these two definitions in agreement.
+m4_define([soup_minimum_version], [2.34])
+m4_define([soup_encoded_version], [SOUP_VERSION_2_34])
+
+PKG_CHECK_MODULES(GLIB, [gio-2.0 >= glib_minimum_version])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
-GTK_MODULES="gtk+-3.0 >= 3.0"
-PKG_CHECK_MODULES(GTK, $GTK_MODULES)
+PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= gdk_minimum_version])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-SOUP_MODULES="libsoup-2.4 >= 2.4.0"
-PKG_CHECK_MODULES(SOUP, $SOUP_MODULES)
+PKG_CHECK_MODULES(SOUP, [libsoup-2.4 >= soup_minimum_version])
AC_SUBST(SOUP_CFLAGS)
AC_SUBST(SOUP_LIBS)
-SQLITE_MODULES="sqlite3 >= 3.0.0"
-PKG_CHECK_MODULES(SQLITE, $SQLITE_MODULES)
+PKG_CHECK_MODULES(SQLITE, [sqlite3 >= 3.0])
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
+# Warn about API usage that violates our minimum requirements.
+DEP_CPPFLAGS="$DEP_CPPFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
+DEP_CPPFLAGS="$DEP_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"
+DEP_CPPFLAGS="$DEP_CPPFLAGS -DSOUP_VERSION_MAX_ALLOWED=soup_encoded_version"
+
+# These will suppress warnings about newly-deprecated symbols. Ideally
+# these settings should match our minimum requirements and we will clean
+# up any new deprecation warnings after bumping our minimum requirements.
+# But if the warnings get to be overwhelming, use fixed versions instead.
+DEP_CPPFLAGS="$DEP_CPPFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
+DEP_CPPFLAGS="$DEP_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=gdk_encoded_version"
+DEP_CPPFLAGS="$DEP_CPPFLAGS -DSOUP_VERSION_MIN_REQUIRED=soup_encoded_version"
+
+AC_SUBST(DEP_CPPFLAGS)
+
# Needed for the monospace font name.
GDS_MODULES="gsettings-desktop-schemas"
PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, $GDS_MODULES)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3ca237c..e283e2c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,6 +8,7 @@ AM_CFLAGS = \
@SOUP_CFLAGS@ @SQLITE_CFLAGS@ @WNCK_CFLAGS@
AM_CPPFLAGS = \
+ $(DEP_CPPFLAGS) \
-DG_LOG_DOMAIN=\"Gva\" \
-DTOPSRCDIR=\""$(abs_top_builddir)"\" \
-DLOCALEDIR=\""$(datadir)/locale/"\"
diff --git a/src/gva-main.c b/src/gva-main.c
index f0b9d07..18e8f28 100644
--- a/src/gva-main.c
+++ b/src/gva-main.c
@@ -467,7 +467,7 @@ gva_main_cursor_busy (void)
display = gtk_widget_get_display (widget);
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (cursor);
}
/**
diff --git a/src/gva-properties.c b/src/gva-properties.c
index a9733cd..a9b3252 100644
--- a/src/gva-properties.c
+++ b/src/gva-properties.c
@@ -50,16 +50,16 @@
#define SQL_SELECT_CPU \
"SELECT COUNT(*), name, clock FROM chip " \
"WHERE game = \"%s\" AND type = \"cpu\" " \
- "GROUP BY name, clock ORDER BY CAST (clock AS INT) DESC LIMIT %d"
+ "GROUP BY name, clock ORDER BY CAST (clock AS INT) DESC LIMIT %lu"
#define SQL_SELECT_SOUND \
"SELECT COUNT(*), name, clock FROM chip " \
"WHERE game = \"%s\" AND type = \"audio\" " \
- "GROUP BY name, clock ORDER BY CAST (clock AS INT) DESC LIMIT %d"
+ "GROUP BY name, clock ORDER BY CAST (clock AS INT) DESC LIMIT %lu"
#define SQL_SELECT_VIDEO \
"SELECT type, rotate, width, height, refresh " \
- "FROM display WHERE game = \"%s\" LIMIT %d"
+ "FROM display WHERE game = \"%s\" LIMIT %lu"
/* Keep this in sync with the Glade file. */
enum
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]