From 553c56569950e68fa9f2ca620325e1921814dfdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Mayer?= Date: Sun, 7 Aug 2011 18:35:36 +0000 Subject: [PATCH] mate_grammar.lemon: - Fix a bug my previous patch introduced. mate/: - Unset G_DISABLE_DEPRECATED for the mate files. CMakeLists.txt configure.in: - Build with -DG_DISABLE_DEPRECATED so further usage of deprecated glib functions will be detected. svn path=/trunk/; revision=38393 --- CMakeLists.txt | 7 +++++-- configure.in | 2 ++ plugins/mate/mate.h | 2 ++ plugins/mate/mate_grammar.lemon | 2 +- plugins/mate/mate_parser.l | 4 ++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e8329825c..32051badfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,9 +27,11 @@ cmake_minimum_required(VERSION 2.6) set(CMAKE_BACKWARDS_COMPATIBILITY 2.6) # Needs to be set after cmake_minimum_required or cmake_policy(VERSION) -#if(COMMAND cmake_policy) +if(COMMAND cmake_policy) + # Backward compatibility for versions < 2.6.3 + cmake_policy(SET CMP0011 OLD) # cmake_policy(SET CMP0015 NEW) -#endif(COMMAND cmake_policy) +endif(COMMAND cmake_policy) # set(PROJECT_VERSION "1.3.4-rc5") # set(PROJECT_VERSION "1.3.4rc5") @@ -158,6 +160,7 @@ endif() add_definitions( -DHAVE_CONFIG_H + -DG_DISABLE_DEPRECATED ) # Counterhack to work around some cache magic in CHECK_C_SOURCE_COMPILES diff --git a/configure.in b/configure.in index e171b7cdc6..a522a1d31f 100644 --- a/configure.in +++ b/configure.in @@ -885,6 +885,8 @@ AC_MSG_CHECKING(whether GLib supports loadable modules) ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" +# Error out on the usage of deprecated glib functions +CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED" LIBS="$GLIB_LIBS $LIBS" AC_TRY_RUN([ #include diff --git a/plugins/mate/mate.h b/plugins/mate/mate.h index 4d062808ad..5f38953fc9 100644 --- a/plugins/mate/mate.h +++ b/plugins/mate/mate.h @@ -32,6 +32,8 @@ # include "config.h" #endif +#undef G_DISABLE_DEPRECATED + #ifndef ENABLE_STATIC #include "moduleinfo.h" #include diff --git a/plugins/mate/mate_grammar.lemon b/plugins/mate/mate_grammar.lemon index f6236ba766..a783740c6e 100644 --- a/plugins/mate/mate_grammar.lemon +++ b/plugins/mate/mate_grammar.lemon @@ -132,7 +132,7 @@ static gchar* recolonize(mate_config* mc, gchar* s) { vec = g_strsplit(s,":",0); for (i = 0; vec[i]; i++) { - g_ascii_strdown(vec[i]); + g_ascii_strdown(vec[i], -1); v = 0; switch ( strlen(vec[i]) ) { diff --git a/plugins/mate/mate_parser.l b/plugins/mate/mate_parser.l index 4fb4b509e9..792e6b7fa5 100644 --- a/plugins/mate/mate_parser.l +++ b/plugins/mate/mate_parser.l @@ -42,12 +42,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - #include "mate.h" #include "mate_grammar.h" #include "mate_parser_lex.h" +#include + #ifdef _WIN32 /* disable Windows VC compiler warning "signed/unsigned mismatch" associated */ /* with YY_INPUT code generated by flex versions such as 2.5.35. */