[gupnp-tools] Remove gnome-common stuff



commit de0d3e726e0bc16ce22a6fa543c8c23b903779c2
Author: Jens Georg <mail jensge org>
Date:   Sun Jun 14 13:34:26 2015 +0200

    Remove gnome-common stuff
    
    Fix compiler warnings on the way.
    
    Signed-off-by: Jens Georg <mail jensge org>

 configure.ac                        |    5 +
 m4/ax_append_compile_flags.m4       |   65 ++++++++++++++
 m4/ax_append_flag.m4                |   71 ++++++++++++++++
 m4/ax_check_compile_flag.m4         |   74 ++++++++++++++++
 m4/ax_check_enable_debug.m4         |  113 +++++++++++++++++++++++++
 m4/ax_compiler_flags.m4             |  158 +++++++++++++++++++++++++++++++++++
 m4/ax_compiler_flags_cflags.m4      |  133 +++++++++++++++++++++++++++++
 m4/ax_compiler_flags_gir.m4         |   60 +++++++++++++
 m4/ax_compiler_flags_ldflags.m4     |   75 +++++++++++++++++
 m4/ax_is_release.m4                 |   69 +++++++++++++++
 m4/ax_require_defined.m4            |   37 ++++++++
 src/av-cp/Makefile.am               |    5 +-
 src/av-cp/gui.c                     |    9 ++-
 src/av-cp/main.c                    |    4 +-
 src/av-cp/playlist-treeview.c       |   55 +++++++++----
 src/av-cp/renderer-combo.c          |    6 +-
 src/av-cp/renderer-controls.c       |   38 +++++++-
 src/av-cp/renderer-controls.h       |    2 +-
 src/common/Makefile.am              |    3 +-
 src/common/icons.c                  |   18 ++--
 src/discover/Makefile.am            |    5 +-
 src/discover/gssdp-discover.c       |    6 +-
 src/network-light/Makefile.am       |    5 +-
 src/network-light/gui.c             |   26 ++++++-
 src/network-light/upnp.c            |   74 ++++++++++++++--
 src/universal-cp/Makefile.am        |    5 +-
 src/universal-cp/action-dialog.c    |    6 ++
 src/universal-cp/details-treeview.c |   12 +++
 src/universal-cp/device-treeview.c  |   20 ++++-
 src/universal-cp/event-treeview.c   |   34 +++++++-
 src/universal-cp/gui.c              |    5 +
 src/universal-cp/gui.h              |    8 +--
 src/universal-cp/main.c             |    6 +-
 src/upload/Makefile.am              |    5 +-
 src/upload/container-search.c       |    1 +
 src/upload/control_point.c          |    5 +-
 src/upload/item-creation.c          |    1 +
 src/upload/item-creation.h          |    3 +-
 src/upload/main.c                   |   10 +--
 src/upload/transfer.c               |    1 +
 40 files changed, 1152 insertions(+), 86 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f63c489..4c87a8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,11 +14,16 @@ AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-xz])
 AM_MAINTAINER_MODE([enable])
 AM_SILENT_RULES([yes])
 
+AX_CHECK_ENABLE_DEBUG([yes])
+
 AC_SEARCH_LIBS([strerror],[cposix])
 AC_PROG_CC
 AC_HEADER_STDC
 AC_FUNC_MMAP
 
+AX_IS_RELEASE([git-directory])
+AX_COMPILER_FLAGS
+
 # libtool
 LT_PREREQ([2.2])
 LT_INIT([])
diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4
new file mode 100644
index 0000000..dc7b866
--- /dev/null
+++ b/m4/ax_append_compile_flags.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   For every FLAG1, FLAG2 it is checked whether the compiler works with the
+#   flag.  If it does, the flag is added FLAGS-VARIABLE
+#
+#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+#   CFLAGS) is used.  During the check the flag is always added to the
+#   current language's flags.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   NOTE: This macro depends on the AX_APPEND_FLAG and
+#   AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
+#   AX_APPEND_LINK_FLAGS.
+#
+# LICENSE
+#
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans gmail com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
+[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
+AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+for flag in $1; do
+  AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
+done
+])dnl AX_APPEND_COMPILE_FLAGS
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
new file mode 100644
index 0000000..aeab899
--- /dev/null
+++ b/m4/ax_append_flag.m4
@@ -0,0 +1,71 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
+#
+# DESCRIPTION
+#
+#   FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
+#   added in between.
+#
+#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+#   CFLAGS) is used.  FLAGS-VARIABLE is not changed if it already contains
+#   FLAG.  If FLAGS-VARIABLE is unset in the shell, it is set to exactly
+#   FLAG.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod gmx de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans gmail com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 5
+
+AC_DEFUN([AX_APPEND_FLAG],
+[dnl
+AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
+AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
+AS_VAR_SET_IF(FLAGS,[
+  AS_CASE([" AS_VAR_GET(FLAGS) "],
+    [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
+    [
+     AS_VAR_APPEND(FLAGS," $1")
+     AC_RUN_LOG([: FLAGS="$FLAGS"])
+    ])
+  ],
+  [
+  AS_VAR_SET(FLAGS,[$1])
+  AC_RUN_LOG([: FLAGS="$FLAGS"])
+  ])
+AS_VAR_POPDEF([FLAGS])dnl
+])dnl AX_APPEND_FLAG
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 0000000..ca36397
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+#   Check whether the given FLAG works with the current language's compiler
+#   or gives an error.  (Warnings, however, are ignored)
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod gmx de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans gmail com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+    [AS_VAR_SET(CACHEVAR,[yes])],
+    [AS_VAR_SET(CACHEVAR,[no])])
+  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4
new file mode 100644
index 0000000..37add91
--- /dev/null
+++ b/m4/ax_check_enable_debug.m4
@@ -0,0 +1,113 @@
+# ===========================================================================
+#         http://autoconf-archive.cryp.to/ax_check_enable_debug.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   Check for the presence of an --enable-debug option to configure and
+#   allow/avoid compiled debugging flags appropriately.
+#
+#   AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no],
+#                         [ENABLE DEBUG VARIABLES …],
+#                         [DISABLE DEBUG VARIABLES NDEBUG …])
+#
+# DESCRIPTION
+#
+#   Check for the presence of an --enable-debug option to configure, with the
+#   specified default value used when the option is not present.  Return the
+#   value in the variable $ax_enable_debug.
+#
+#   Specifying 'yes' adds '-g -O0' to the compilation flags for all languages.
+#   Specifying 'info' adds '-g' to the compilation flags.  Specifying 'profile'
+#   adds '-g -pg' to the compilation flags and '-pg' to the linking flags.
+#   Otherwise, nothing is added.
+#
+#   Define the variables listed in the second argument if debug is enabled,
+#   defaulting to no variables.  Defines the variables listed in the third
+#   argument if debug is disabled, defaulting to NDEBUG.  All lists of
+#   variables should be space-separated.
+#
+#   If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
+#   Should be invoked prior to any AC_PROG_* compiler checks.
+#
+# LAST MODIFICATION
+#
+#   2014-05-12
+#
+# COPYLEFT
+#
+#   Copyright (c) 2011 Rhys Ulerich <rhys ulerich gmail com>
+#   Copyright © 2014 Philip Withnall <philip tecnocode co uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
+    AC_BEFORE([$0],[AC_PROG_CC])dnl
+    AC_BEFORE([$0],[AC_PROG_CXX])dnl
+    AC_BEFORE([$0],[AC_PROG_F77])dnl
+    AC_BEFORE([$0],[AC_PROG_FC])dnl
+
+    AC_MSG_CHECKING(whether to enable debugging)
+
+    m4_define(ax_enable_debug_default,[m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))])
+    m4_define(ax_enable_debug_vars,[m4_normalize(ifelse([$2],,,[$2]))])
+    m4_define(ax_disable_debug_vars,[m4_normalize(ifelse([$3],,[NDEBUG],[$3]))])
+
+    AC_ARG_ENABLE(debug,
+        [AS_HELP_STRING([--enable-debug]@<:@=ax_enable_debug_default@:>@,[compile with debugging; one of 
yes/info/profile/no])],
+        [],enable_debug=ax_enable_debug_default)
+    if test "x$enable_debug" = "xyes" || test "x$enable_debug" = "x"; then
+        AC_MSG_RESULT(yes)
+        CFLAGS="${CFLAGS} -g -O0"
+        CXXFLAGS="${CXXFLAGS} -g -O0"
+        FFLAGS="${FFLAGS} -g -O0"
+        FCFLAGS="${FCFLAGS} -g -O0"
+        OBJCFLAGS="${OBJCFLAGS} -g -O0"
+
+        dnl Define various variables if debugging is enabled.
+        m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is enabled])])
+    else
+        if test "x$enable_debug" = "xinfo"; then
+            AC_MSG_RESULT(info)
+            CFLAGS="${CFLAGS} -g"
+            CXXFLAGS="${CXXFLAGS} -g"
+            FFLAGS="${FFLAGS} -g"
+            FCFLAGS="${FCFLAGS} -g"
+            OBJCFLAGS="${OBJCFLAGS} -g"
+        elif test "x$enable_debug" = "xprofile"; then
+            AC_MSG_RESULT(profile)
+            CFLAGS="${CFLAGS} -g -pg"
+            CXXFLAGS="${CXXFLAGS} -g -pg"
+            FFLAGS="${FFLAGS} -g -pg"
+            FCFLAGS="${FCFLAGS} -g -pg"
+            OBJCFLAGS="${OBJCFLAGS} -g -pg"
+            LDFLAGS="${LDFLAGS} -pg"
+        else
+            AC_MSG_RESULT(no)
+            dnl Ensure AC_PROG_CC/CXX/F77/FC/OBJC will not enable debug flags
+            dnl by setting any unset environment flag variables
+            if test "x${CFLAGS+set}" != "xset"; then
+                CFLAGS=""
+            fi
+            if test "x${CXXFLAGS+set}" != "xset"; then
+                CXXFLAGS=""
+            fi
+            if test "x${FFLAGS+set}" != "xset"; then
+                FFLAGS=""
+            fi
+            if test "x${FCFLAGS+set}" != "xset"; then
+                FCFLAGS=""
+            fi
+            if test "x${OBJCFLAGS+set}" != "xset"; then
+                OBJCFLAGS=""
+            fi
+        fi
+
+        dnl Define various variables if debugging is disabled.
+        dnl assert.h is a NOP if NDEBUG is defined, so define it by default.
+        m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is disabled])])
+    fi
+    ax_enable_debug=$enable_debug
+])
diff --git a/m4/ax_compiler_flags.m4 b/m4/ax_compiler_flags.m4
new file mode 100644
index 0000000..6cfe398
--- /dev/null
+++ b/m4/ax_compiler_flags.m4
@@ -0,0 +1,158 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPILER_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [IS-RELEASE], [EXTRA-BASE-CFLAGS], 
[EXTRA-YES-CFLAGS], [UNUSED], [UNUSED], [UNUSED], [EXTRA-BASE-LDFLAGS], [EXTRA-YES-LDFLAGS], [UNUSED], 
[UNUSED], [UNUSED])
+#
+# DESCRIPTION
+#
+#   Check for the presence of an --enable-compile-warnings option to
+#   configure, defaulting to "error" in normal operation, or "yes" if
+#   IS-RELEASE is equal to "yes".  Return the value in the variable
+#   $ax_enable_compile_warnings.
+#
+#   Depending on the value of --enable-compile-warnings, different compiler
+#   warnings are checked to see if they work with the current compiler and,
+#   if so, are appended to CFLAGS-VARIABLE and LDFLAGS-VARIABLE.  This
+#   allows a consistent set of baseline compiler warnings to be used across
+#   a code base, irrespective of any warnings enabled locally by individual
+#   developers.  By standardising the warnings used by all developers of a
+#   project, the project can commit to a zero-warnings policy, using -Werror
+#   to prevent compilation if new warnings are introduced.  This makes
+#   catching bugs which are flagged by warnings a lot easier.
+#
+#   By providing a consistent --enable-compile-warnings argument across all
+#   projects using this macro, continuous integration systems can easily be
+#   configured the same for all projects.  Automated systems or build
+#   systems aimed at beginners may want to pass the --disable-Werror
+#   argument to unconditionally prevent warnings being fatal.
+#
+#   --enable-compile-warnings can take the values:
+#
+#    * no:      Base compiler warnings only; not even -Wall.
+#    * yes:     The above, plus a broad range of useful warnings.
+#    * error:   The above, plus -Werror so that all warnings are fatal.
+#               Use --disable-Werror to override this and disable fatal
+#               warnings.
+#
+#   The set of base and enabled flags can be augmented using the
+#   EXTRA-*-CFLAGS and EXTRA-*-LDFLAGS variables, which are tested and
+#   appended to the output variable if --enable-compile-warnings is not
+#   "no". Flags should not be disabled using these arguments, as the entire
+#   point of AX_COMPILER_FLAGS is to enforce a consistent set of useful
+#   compiler warnings on code, using warnings which have been chosen for low
+#   false positive rates.  If a compiler emits false positives for a
+#   warning, a #pragma should be used in the code to disable the warning
+#   locally. See:
+#
+#     https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
+#
+#   The EXTRA-* variables should only be used to supply extra warning flags,
+#   and not general purpose compiler flags, as they are controlled by
+#   configure options such as --disable-Werror.
+#
+#   IS-RELEASE can be used to disable -Werror when making a release, which
+#   is useful for those hairy moments when you just want to get the release
+#   done as quickly as possible.  Set it to "yes" to disable -Werror. By
+#   default, it uses the value of $ax_is_release, so if you are using the
+#   AX_IS_RELEASE macro, there is no need to pass this parameter. For
+#   example:
+#
+#     AX_IS_RELEASE([git-directory])
+#     AX_COMPILER_FLAGS()
+#
+#   CFLAGS-VARIABLE defaults to WARN_CFLAGS, and LDFLAGS-VARIABLE defaults
+#   to WARN_LDFLAGS.  Both variables are AC_SUBST-ed by this macro, but must
+#   be manually added to the CFLAGS and LDFLAGS variables for each target in
+#   the code base.
+#
+#   If C++ language support is enabled with AC_PROG_CXX, which must occur
+#   before this macro in configure.ac, warning flags for the C++ compiler
+#   are AC_SUBST-ed as WARN_CXXFLAGS, and must be manually added to the
+#   CXXFLAGS variables for each target in the code base.  EXTRA-*-CFLAGS can
+#   be used to augment the base and enabled flags.
+#
+#   Warning flags for g-ir-scanner (from GObject Introspection) are
+#   AC_SUBST-ed as WARN_SCANNERFLAGS.  This variable must be manually added
+#   to the SCANNERFLAGS variable for each GIR target in the code base.  If
+#   extra g-ir-scanner flags need to be enabled, the AX_COMPILER_FLAGS_GIR
+#   macro must be invoked manually.
+#
+#   AX_COMPILER_FLAGS may add support for other tools in future, in addition
+#   to the compiler and linker.  No extra EXTRA-* variables will be added
+#   for those tools, and all extra support will still use the single
+#   --enable-compile-warnings configure option.  For finer grained control
+#   over the flags for individual tools, use AX_COMPILER_FLAGS_CFLAGS,
+#   AX_COMPILER_FLAGS_LDFLAGS and AX_COMPILER_FLAGS_* for new tools.
+#
+#   The UNUSED variables date from a previous version of this macro, and are
+#   automatically appended to the preceding non-UNUSED variable. They should
+#   be left empty in new uses of the macro.
+#
+# LICENSE
+#
+#   Copyright (c) 2014, 2015 Philip Withnall <philip tecnocode co uk>
+#   Copyright (c) 2015 David King <amigadave amigadave com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 13
+
+# _AX_COMPILER_FLAGS_LANG([LANGNAME])
+m4_defun([_AX_COMPILER_FLAGS_LANG],
+[m4_ifdef([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [],
+          [m4_define([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [])dnl
+           AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_]$1[FLAGS])])dnl
+])
+
+AC_DEFUN([AX_COMPILER_FLAGS],[
+    # C support is enabled by default.
+    _AX_COMPILER_FLAGS_LANG([C])
+    # Only enable C++ support if AC_PROG_CXX is called. The redefinition of
+    # AC_PROG_CXX is so that a fatal error is emitted if this macro is called
+    # before AC_PROG_CXX, which would otherwise cause no C++ warnings to be
+    # checked.
+    AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                      [_AX_COMPILER_FLAGS_LANG([CXX])],
+                      [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AX_COMPILER_FLAGS_LANG([CXX])])])
+    AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_LDFLAGS])
+
+    # Default value for IS-RELEASE is $ax_is_release
+    ax_compiler_flags_is_release=m4_tolower(m4_normalize(ifelse([$3],,
+                                                                [$ax_is_release],
+                                                                [$3])))
+
+    AC_ARG_ENABLE([compile-warnings],
+                  AS_HELP_STRING([--enable-compile-warnings=@<:@no/yes/error@:>@],
+                                 [Enable compiler warnings and errors]),,
+                  [AS_IF([test "$ax_compiler_flags_is_release" = "yes"],
+                         [enable_compile_warnings="yes"],
+                         [enable_compile_warnings="error"])])
+    AC_ARG_ENABLE([Werror],
+                  AS_HELP_STRING([--disable-Werror],
+                                 [Unconditionally make all compiler warnings non-fatal]),,
+                  [enable_Werror=maybe])
+
+    # Return the user's chosen warning level
+    AS_IF([test "$enable_Werror" = "no" -a \
+                "$enable_compile_warnings" = "error"],[
+        enable_compile_warnings="yes"
+    ])
+
+    ax_enable_compile_warnings=$enable_compile_warnings
+
+    AX_COMPILER_FLAGS_CFLAGS([$1],[$ax_compiler_flags_is_release],
+                             [$4],[$5 $6 $7 $8])
+    m4_ifdef([_AX_COMPILER_FLAGS_LANG_CXX_enabled],
+             [AX_COMPILER_FLAGS_CXXFLAGS([WARN_CXXFLAGS],
+                                         [$ax_compiler_flags_is_release],
+                                         [$4],[$5 $6 $7 $8])])
+    AX_COMPILER_FLAGS_LDFLAGS([$2],[$ax_compiler_flags_is_release],
+                              [$9],[$10 $11 $12 $13])
+    AX_COMPILER_FLAGS_GIR([WARN_SCANNERFLAGS],[$ax_compiler_flags_is_release])
+])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_compiler_flags_cflags.m4 b/m4/ax_compiler_flags_cflags.m4
new file mode 100644
index 0000000..f470f8f
--- /dev/null
+++ b/m4/ax_compiler_flags_cflags.m4
@@ -0,0 +1,133 @@
+# ============================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_cflags.html
+# ============================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPILER_FLAGS_CFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
+#
+# DESCRIPTION
+#
+#   Add warning flags for the C compiler to VARIABLE, which defaults to
+#   WARN_CFLAGS.  VARIABLE is AC_SUBST-ed by this macro, but must be
+#   manually added to the CFLAGS variable for each target in the code base.
+#
+#   This macro depends on the environment set up by AX_COMPILER_FLAGS.
+#   Specifically, it uses the value of $ax_enable_compile_warnings to decide
+#   which flags to enable.
+#
+# LICENSE
+#
+#   Copyright (c) 2014, 2015 Philip Withnall <philip tecnocode co uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 11
+
+AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
+    AC_REQUIRE([AC_PROG_SED])
+    AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
+    AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+    AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
+
+    # Variable names
+    m4_define(ax_warn_cflags_variable,
+              [m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))])
+
+    AC_LANG_PUSH([C])
+
+    # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
+    # flags, otherwise they are always appended to the warn_cflags variable, and
+    # Clang warns on them for every compilation unit.
+    # If this is passed to GCC, it will explode, so the flag must be enabled
+    # conditionally.
+    AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
+        ax_compiler_flags_test="-Werror=unknown-warning-option"
+    ],[
+        ax_compiler_flags_test=""
+    ])
+
+    # Base flags
+    AX_APPEND_COMPILE_FLAGS([ dnl
+        -fno-strict-aliasing dnl
+        $3 dnl
+    ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
+
+    AS_IF([test "$ax_enable_compile_warnings" != "no"],[
+        # "yes" flags
+        AX_APPEND_COMPILE_FLAGS([ dnl
+            -Wall dnl
+            -Wextra dnl
+            -Wundef dnl
+            -Wnested-externs dnl
+            -Wwrite-strings dnl
+            -Wpointer-arith dnl
+            -Wmissing-declarations dnl
+            -Wmissing-prototypes dnl
+            -Wstrict-prototypes dnl
+            -Wredundant-decls dnl
+            -Wno-unused-parameter dnl
+            -Wno-missing-field-initializers dnl
+            -Wdeclaration-after-statement dnl
+            -Wformat=2 dnl
+            -Wold-style-definition dnl
+            -Wcast-align dnl
+            -Wformat-nonliteral dnl
+            -Wformat-security dnl
+            -Wsign-compare dnl
+            -Wstrict-aliasing dnl
+            -Wshadow dnl
+            -Winline dnl
+            -Wpacked dnl
+            -Wmissing-format-attribute dnl
+            -Wmissing-noreturn dnl
+            -Winit-self dnl
+            -Wredundant-decls dnl
+            -Wmissing-include-dirs dnl
+            -Wunused-but-set-variable dnl
+            -Warray-bounds dnl
+            -Wimplicit-function-declaration dnl
+            -Wreturn-type dnl
+            -Wswitch-enum dnl
+            -Wswitch-default dnl
+            $4 dnl
+            $5 dnl
+            $6 dnl
+            $7 dnl
+        ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
+    ])
+    AS_IF([test "$ax_enable_compile_warnings" = "error"],[
+        # "error" flags; -Werror has to be appended unconditionally because
+        # it's not possible to test for
+        #
+        # suggest-attribute=format is disabled because it gives too many false
+        # positives
+        AX_APPEND_FLAG([-Werror],ax_warn_cflags_variable)
+
+        AX_APPEND_COMPILE_FLAGS([ dnl
+            -Wno-suggest-attribute=format dnl
+        ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
+    ])
+
+    # In the flags below, when disabling specific flags, always add *both*
+    # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example)
+    # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall,
+    # which effectively turns that flag back on again as an error.
+    for flag in $ax_warn_cflags_variable; do
+        AS_CASE([$flag],
+                [-Wno-*=*],[],
+                [-Wno-*],[
+                    AX_APPEND_COMPILE_FLAGS([-Wno-error=$(AS_ECHO([$flag]) | $SED 's/^-Wno-//')],
+                                            ax_warn_cflags_variable,
+                                            [$ax_compiler_flags_test])
+                ])
+    done
+
+    AC_LANG_POP([C])
+
+    # Substitute the variables
+    AC_SUBST(ax_warn_cflags_variable)
+])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_compiler_flags_gir.m4 b/m4/ax_compiler_flags_gir.m4
new file mode 100644
index 0000000..180f50d
--- /dev/null
+++ b/m4/ax_compiler_flags_gir.m4
@@ -0,0 +1,60 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
+#
+# DESCRIPTION
+#
+#   Add warning flags for the g-ir-scanner (from GObject Introspection) to
+#   VARIABLE, which defaults to WARN_SCANNERFLAGS.  VARIABLE is AC_SUBST-ed
+#   by this macro, but must be manually added to the SCANNERFLAGS variable
+#   for each GIR target in the code base.
+#
+#   This macro depends on the environment set up by AX_COMPILER_FLAGS.
+#   Specifically, it uses the value of $ax_enable_compile_warnings to decide
+#   which flags to enable.
+#
+# LICENSE
+#
+#   Copyright (c) 2015 Philip Withnall <philip tecnocode co uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 4
+
+AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
+    AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+
+    # Variable names
+    m4_define(ax_warn_scannerflags_variable,
+              [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
+
+    # Base flags
+    AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable)
+
+    AS_IF([test "$ax_enable_compile_warnings" != "no"],[
+        # "yes" flags
+        AX_APPEND_FLAG([ dnl
+            --warn-all dnl
+            $4 dnl
+            $5 dnl
+            $6 dnl
+            $7 dnl
+        ],ax_warn_scannerflags_variable)
+    ])
+    AS_IF([test "$ax_enable_compile_warnings" = "error"],[
+        # "error" flags
+        AX_APPEND_FLAG([ dnl
+            --warn-error dnl
+        ],ax_warn_scannerflags_variable)
+    ])
+
+    # Substitute the variables
+    AC_SUBST(ax_warn_scannerflags_variable)
+])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_compiler_flags_ldflags.m4 b/m4/ax_compiler_flags_ldflags.m4
new file mode 100644
index 0000000..f393ba4
--- /dev/null
+++ b/m4/ax_compiler_flags_ldflags.m4
@@ -0,0 +1,75 @@
+# =============================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_ldflags.html
+# =============================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPILER_FLAGS_LDFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
+#
+# DESCRIPTION
+#
+#   Add warning flags for the linker to VARIABLE, which defaults to
+#   WARN_LDFLAGS.  VARIABLE is AC_SUBST-ed by this macro, but must be
+#   manually added to the LDFLAGS variable for each target in the code base.
+#
+#   This macro depends on the environment set up by AX_COMPILER_FLAGS.
+#   Specifically, it uses the value of $ax_enable_compile_warnings to decide
+#   which flags to enable.
+#
+# LICENSE
+#
+#   Copyright (c) 2014, 2015 Philip Withnall <philip tecnocode co uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 4
+
+AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
+    AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
+    AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+    AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
+
+    # Variable names
+    m4_define(ax_warn_ldflags_variable,
+              [m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))])
+
+    # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
+    # flags, otherwise they are always appended to the warn_ldflags variable,
+    # and Clang warns on them for every compilation unit.
+    # If this is passed to GCC, it will explode, so the flag must be enabled
+    # conditionally.
+    AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
+        ax_compiler_flags_test="-Werror=unknown-warning-option"
+    ],[
+        ax_compiler_flags_test=""
+    ])
+
+    # Base flags
+    AX_APPEND_COMPILE_FLAGS([ dnl
+        -Wl,--no-as-needed dnl
+        $3 dnl
+    ],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
+
+    AS_IF([test "$ax_enable_compile_warnings" != "no"],[
+        # "yes" flags
+        AX_APPEND_COMPILE_FLAGS([$4 $5 $6 $7],
+                                ax_warn_ldflags_variable,
+                                [$ax_compiler_flags_test])
+    ])
+    AS_IF([test "$ax_enable_compile_warnings" = "error"],[
+        # "error" flags; -Werror has to be appended unconditionally because
+        # it's not possible to test for
+        #
+        # suggest-attribute=format is disabled because it gives too many false
+        # positives
+        AX_APPEND_COMPILE_FLAGS([ dnl
+            -Wl,--fatal-warnings dnl
+        ],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
+    ])
+
+    # Substitute the variables
+    AC_SUBST(ax_warn_ldflags_variable)
+])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_is_release.m4 b/m4/ax_is_release.m4
new file mode 100644
index 0000000..9ec6746
--- /dev/null
+++ b/m4/ax_is_release.m4
@@ -0,0 +1,69 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_is_release.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_IS_RELEASE(POLICY)
+#
+# DESCRIPTION
+#
+#   Determine whether the code is being configured as a release, or from
+#   git. Set the ax_is_release variable to 'yes' or 'no'.
+#
+#   If building a release version, it is recommended that the configure
+#   script disable compiler errors and debug features, by conditionalising
+#   them on the ax_is_release variable.  If building from git, these
+#   features should be enabled.
+#
+#   The POLICY parameter specifies how ax_is_release is determined. It can
+#   take the following values:
+#
+#    * git-directory:  ax_is_release will be 'no' if a '.git' directory exists
+#    * minor-version:  ax_is_release will be 'no' if the minor version number
+#                      in $PACKAGE_VERSION is odd; this assumes
+#                      $PACKAGE_VERSION follows the 'major.minor.micro' scheme
+#    * micro-version:  ax_is_release will be 'no' if the micro version number
+#                      in $PACKAGE_VERSION is odd; this assumes
+#                      $PACKAGE_VERSION follows the 'major.minor.micro' scheme
+#    * always:         ax_is_release will always be 'yes'
+#    * never:          ax_is_release will always be 'no'
+#
+#   Other policies may be added in future.
+#
+# LICENSE
+#
+#   Copyright (c) 2015 Philip Withnall <philip tecnocode co uk>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+#serial 3
+
+AC_DEFUN([AX_IS_RELEASE],[
+    AC_BEFORE([AC_INIT],[$0])
+
+    m4_case([$1],
+      [git-directory],[
+        # $is_release = (.git directory does not exist)
+        AS_IF([test -d .git],[ax_is_release=no],[ax_is_release=yes])
+      ],
+      [minor-version],[
+        # $is_release = ($minor_version is even)
+        minor_version=`echo "$PACKAGE_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
+        AS_IF([test "$(( $minor_version % 2 ))" -ne 0],
+              [ax_is_release=no],[ax_is_release=yes])
+      ],
+      [micro-version],[
+        # $is_release = ($micro_version is even)
+        micro_version=`echo "$PACKAGE_VERSION" | sed 's/[[^.]]*\.[[^.]]*\.\([[^.]]*\).*/\1/'`
+        AS_IF([test "$(( $micro_version % 2 ))" -ne 0],
+              [ax_is_release=no],[ax_is_release=yes])
+      ],
+      [always],[ax_is_release=yes],
+      [never],[ax_is_release=no],
+      [
+        AC_MSG_ERROR([Invalid policy. Valid policies: git-directory, minor-version.])
+      ])
+])
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
new file mode 100644
index 0000000..cae1111
--- /dev/null
+++ b/m4/ax_require_defined.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+#    http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_REQUIRE_DEFINED(MACRO)
+#
+# DESCRIPTION
+#
+#   AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
+#   been defined and thus are available for use.  This avoids random issues
+#   where a macro isn't expanded.  Instead the configure script emits a
+#   non-fatal:
+#
+#     ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
+#
+#   It's like AC_REQUIRE except it doesn't expand the required macro.
+#
+#   Here's an example:
+#
+#     AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+#
+# LICENSE
+#
+#   Copyright (c) 2014 Mike Frysinger <vapier gentoo org>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
+  m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
+])dnl AX_REQUIRE_DEFINED
diff --git a/src/av-cp/Makefile.am b/src/av-cp/Makefile.am
index 3ebfbd5..21e0404 100644
--- a/src/av-cp/Makefile.am
+++ b/src/av-cp/Makefile.am
@@ -9,7 +9,8 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
            $(GTK_CFLAGS) \
            $(GTKSOURCEVIEW_CFLAGS) \
            -I$(top_srcdir) -DDATA_DIR='"$(shareddir)"' \
-           -I$(top_srcdir)/src/common
+           -I$(top_srcdir)/src/common \
+           $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-av-cp
 
@@ -32,7 +33,7 @@ gupnp_av_cp_LDADD = ../common/libutil.a \
                    $(LIBGUPNP_AV_LIBS) \
                    $(GTK_LIBS) \
                    $(GTKSOURCEVIEW_LIBS)
-gupnp_av_cp_LDFLAGS = -export-dynamic
+gupnp_av_cp_LDFLAGS = -export-dynamic $(WARN_LDFLAGS)
 
 if OS_WIN32
 av-cp.res: av-cp.rc
diff --git a/src/av-cp/gui.c b/src/av-cp/gui.c
index 47b72db..a0d96fe 100644
--- a/src/av-cp/gui.c
+++ b/src/av-cp/gui.c
@@ -38,6 +38,11 @@ static GtkWidget *main_window;
 static GtkWidget *about_dialog;
 static GtkButton *rescan_button;
 
+gboolean
+on_delete_event (GtkWidget *widget,
+                 GdkEvent  *event,
+                 gpointer   user_data);
+
 G_MODULE_EXPORT
 gboolean
 on_delete_event (GtkWidget *widget,
@@ -50,7 +55,7 @@ on_delete_event (GtkWidget *widget,
 }
 
 static void
-setup_icons (GtkBuilder *builder)
+setup_icons (GtkBuilder *object)
 {
         GdkPixbuf *icon_pixbuf;
         GtkWidget *volume_min;
@@ -81,7 +86,7 @@ setup_icons (GtkBuilder *builder)
 }
 
 gboolean
-init_ui ()
+init_ui (void)
 {
         gint window_width, window_height;
         GError *error = NULL;
diff --git a/src/av-cp/main.c b/src/av-cp/main.c
index 73449ad..2a420b7 100644
--- a/src/av-cp/main.c
+++ b/src/av-cp/main.c
@@ -51,6 +51,8 @@ static GOptionEntry entries[] =
 
 static GUPnPContextManager *context_manager;
 
+void application_exit (void);
+
 static void
 dms_proxy_available_cb (GUPnPControlPoint *cp,
                         GUPnPDeviceProxy  *proxy)
@@ -89,7 +91,7 @@ on_rescan_button_clicked (GtkButton *button,
 }
 
 static void
-on_context_available (GUPnPContextManager *context_manager,
+on_context_available (GUPnPContextManager *cm,
                       GUPnPContext        *context,
                       gpointer             user_data)
 {
diff --git a/src/av-cp/playlist-treeview.c b/src/av-cp/playlist-treeview.c
index e425225..6a78cf1 100644
--- a/src/av-cp/playlist-treeview.c
+++ b/src/av-cp/playlist-treeview.c
@@ -54,6 +54,26 @@ static GtkWidget *didl_textview;
 static gboolean   expanded;
 static GHashTable *initial_notify;
 
+gboolean
+on_playlist_treeview_button_release (GtkWidget      *widget,
+                                     GdkEventButton *event,
+                                     gpointer        user_data);
+void
+on_playlist_row_expanded (GtkTreeView *tree_view,
+                          GtkTreeIter *iter,
+                          GtkTreePath *path,
+                          gpointer     user_data);
+
+void
+on_playlist_row_collapsed (GtkTreeView *tree_view,
+                           GtkTreeIter *iter,
+                           GtkTreePath *path,
+                           gpointer     user_data);
+
+void
+on_didl_menuitem_activate (GtkMenuItem *menuitem,
+                           gpointer     user_data);
+
 typedef struct
 {
   GUPnPServiceProxy *content_dir;
@@ -197,14 +217,14 @@ create_playlist_treemodel (void)
 }
 
 static void
-setup_treeview_columns (GtkWidget *treeview)
+setup_treeview_columns (GtkWidget *tv)
 
 {
         GtkTreeSelection  *selection;
         GtkTreeViewColumn *column;
         GtkCellRenderer   *renderers[2];
-        char              *headers[] = { "Icon", "Title"};
-        char              *attribs[] = { "pixbuf", "text"};
+        const char        *headers[] = { "Icon", "Title"};
+        const char        *attribs[] = { "pixbuf", "text"};
         int                i;
 
         selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
@@ -361,20 +381,22 @@ setup_playlist_treeview (GtkBuilder *builder)
         didl_textview = GTK_WIDGET (gtk_builder_get_object (builder,
                                                           "didl-textview"));
 #ifdef HAVE_GTK_SOURCEVIEW
-        GtkSourceLanguageManager *manager =
+        {
+                GtkSourceLanguageManager *manager =
                                 gtk_source_language_manager_get_default ();
-        GtkSourceLanguage *language =
-                gtk_source_language_manager_guess_language (manager,
-                                                            NULL,
-                                                            "text/xml");
-
-        GtkSourceBuffer *buffer = gtk_source_buffer_new_with_language (language);
-        gtk_source_buffer_set_highlight_syntax (buffer, TRUE);
-        gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (didl_textview),
-                                               TRUE);
-
-        gtk_text_view_set_buffer (GTK_TEXT_VIEW (didl_textview),
-                                  GTK_TEXT_BUFFER (buffer));
+                GtkSourceLanguage *language =
+                    gtk_source_language_manager_guess_language (manager,
+                                                                NULL,
+                                                                "text/xml");
+
+                GtkSourceBuffer *buffer = gtk_source_buffer_new_with_language (language);
+                gtk_source_buffer_set_highlight_syntax (buffer, TRUE);
+                gtk_source_view_set_show_line_numbers (GTK_SOURCE_VIEW (didl_textview),
+                                                       TRUE);
+
+                gtk_text_view_set_buffer (GTK_TEXT_VIEW (didl_textview),
+                                          GTK_TEXT_BUFFER (buffer));
+        }
 #endif
 
         model = create_playlist_treemodel ();
@@ -812,7 +834,6 @@ browse_cb (GUPnPServiceProxy       *content_dir,
                 GUPnPDIDLLiteParser *parser;
                 gint32              remaining;
                 gint32              batch_size;
-                GError              *error;
 
                 error = NULL;
                 parser = gupnp_didl_lite_parser_new ();
diff --git a/src/av-cp/renderer-combo.c b/src/av-cp/renderer-combo.c
index ba41aa0..aace96c 100644
--- a/src/av-cp/renderer-combo.c
+++ b/src/av-cp/renderer-combo.c
@@ -457,7 +457,7 @@ clear_selected_renderer_state (void)
         }
 }
 
-void
+static void
 append_media_renderer_to_tree (GUPnPDeviceProxy  *proxy,
                                GUPnPServiceProxy *av_transport,
                                GUPnPServiceProxy *rendering_control,
@@ -816,7 +816,7 @@ create_renderer_treemodel (void)
 }
 
 static void
-setup_renderer_combo_text_cell (GtkWidget *renderer_combo)
+setup_renderer_combo_text_cell (GtkWidget *widget)
 {
         GtkCellRenderer *renderer;
 
@@ -835,7 +835,7 @@ setup_renderer_combo_text_cell (GtkWidget *renderer_combo)
 }
 
 static void
-setup_renderer_combo_pixbuf_cell (GtkWidget *renderer_combo)
+setup_renderer_combo_pixbuf_cell (GtkWidget *widget)
 {
         GtkCellRenderer *renderer;
 
diff --git a/src/av-cp/renderer-controls.c b/src/av-cp/renderer-controls.c
index 8d114a1..15c91fe 100644
--- a/src/av-cp/renderer-controls.c
+++ b/src/av-cp/renderer-controls.c
@@ -42,6 +42,33 @@ GtkWidget *lenient_mode_menuitem;
 
 static guint timeout_id;
 
+void
+on_play_button_clicked (GtkButton *button,
+                        gpointer   user_data);
+void
+on_pause_button_clicked (GtkButton *button,
+                         gpointer   user_data);
+
+void
+on_stop_button_clicked (GtkButton *button,
+                        gpointer   user_data);
+
+void
+on_next_button_clicked (GtkButton *button,
+                        gpointer   user_data);
+
+void
+on_previous_button_clicked (GtkButton *button,
+                            gpointer   user_data);
+
+void
+on_clear_state_button_clicked (GtkButton *button,
+                               gpointer   user_data);
+
+gboolean
+on_position_scale_value_changed (GtkRange *range,
+                                 gpointer  user_data);
+
 typedef struct
 {
   GCallback callback;
@@ -142,7 +169,7 @@ create_av_transport_args (char **additional_args, GList **out_values)
 }
 
 void
-av_transport_send_action (char *action,
+av_transport_send_action (const char *action,
                           char *additional_args[])
 {
         GUPnPServiceProxy *av_transport;
@@ -169,9 +196,9 @@ av_transport_send_action (char *action,
 static void
 play (void)
 {
-        char *args[] = { "Speed", "1", NULL };
+        const char *args[] = { "Speed", "1", NULL };
 
-        av_transport_send_action ("Play", args);
+        av_transport_send_action ("Play", (char **) args);
 }
 
 static void
@@ -402,7 +429,7 @@ gboolean
 on_position_scale_value_changed (GtkRange *range,
                                  gpointer  user_data)
 {
-        char *args[] = { "Unit", "ABS_TIME", "Target", NULL, NULL };
+        char *args[] = { (char *) "Unit", (char *) "ABS_TIME", (char *)"Target", NULL, NULL };
         guint total_secs;
         guint hours;
         guint minutes;
@@ -419,7 +446,7 @@ on_position_scale_value_changed (GtkRange *range,
                                    seconds);
 
         if (args[3]) {
-                av_transport_send_action ("Seek", args);
+                av_transport_send_action ("Seek", (char **)args);
                 g_free (args[3]);
         }
 
@@ -606,6 +633,7 @@ prepare_controls_for_state (PlaybackState state)
 
                 break;
 
+       case PLAYBACK_STATE_UNKNOWN:
        default:
                 play_possible = TRUE;
                 pause_possible = TRUE;
diff --git a/src/av-cp/renderer-controls.h b/src/av-cp/renderer-controls.h
index 35ed2f0..9ac3b82 100644
--- a/src/av-cp/renderer-controls.h
+++ b/src/av-cp/renderer-controls.h
@@ -45,7 +45,7 @@ void
 prepare_controls_for_state      (PlaybackState state);
 
 void
-av_transport_send_action        (char *action,
+av_transport_send_action        (const char *action,
                                  char *additional_args[]);
 
 void
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 2a764c1..c6e4709 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -5,7 +5,8 @@ shareddir = $(datadir)/gupnp-tools
 endif
 
 AM_CFLAGS = $(LIBGUPNP_CFLAGS) $(GTK_CFLAGS) -I$(top_srcdir) \
-           -DDATA_DIR='"$(shareddir)"' -I$(top_builddir)/src/common
+           -DDATA_DIR='"$(shareddir)"' -I$(top_builddir)/src/common \
+           $(WARN_CFLAGS)
 
 noinst_LIBRARIES = libutil.a
 
diff --git a/src/common/icons.c b/src/common/icons.c
index e9ebcc3..0ae5fad 100644
--- a/src/common/icons.c
+++ b/src/common/icons.c
@@ -32,7 +32,7 @@
 GdkPixbuf *icons[ICON_LAST];
 
 /* For async downloads of icons */
-static SoupSession *session;
+static SoupSession *download_session;
 static GList       *pending_gets;
 
 typedef struct {
@@ -163,7 +163,7 @@ schedule_icon_update (GUPnPDeviceInfo            *info,
         data->callback = callback;
 
         pending_gets = g_list_prepend (pending_gets, data);
-        soup_session_queue_message (session,
+        soup_session_queue_message (download_session,
                                     data->message,
                                     (SoupSessionCallback) got_icon_url,
                                     data);
@@ -186,7 +186,7 @@ unschedule_icon_update (GUPnPDeviceInfo *info)
                 udn2 = gupnp_device_info_get_udn (data->info);
 
                 if (udn1 && udn2 && strcmp (udn1, udn2) == 0) {
-                        soup_session_cancel_message (session,
+                        soup_session_cancel_message (download_session,
                                                      data->message,
                                                      SOUP_STATUS_CANCELLED);
                         break;
@@ -261,7 +261,7 @@ void
 init_icons (void)
 {
         int   i, j;
-        char *file_names[] = {
+        const char *file_names[] = {
                 "pixmaps/upnp-device.png",          /* ICON_DEVICE         */
                 "pixmaps/upnp-service.png",         /* ICON_SERVICE        */
                 "pixmaps/upnp-state-variable.png",  /* ICON_VARIABLE       */
@@ -270,7 +270,7 @@ init_icons (void)
                 "pixmaps/media-renderer.png"        /* ICON_MEDIA_RENDERER */
         };
 
-        char *theme_names[] = {
+        const char *theme_names[] = {
                 "image-missing",               /* ICON_MISSING    */
                 "network-workgroup",           /* ICON_NETWORK    */
                 "system-run",                  /* ICON_ACTION     */
@@ -294,8 +294,8 @@ init_icons (void)
         }
 
 
-        session = soup_session_async_new ();
-        g_assert (session != NULL);
+        download_session = soup_session_async_new ();
+        g_assert (download_session != NULL);
 
         pending_gets = NULL;
 }
@@ -310,12 +310,12 @@ deinit_icons (void)
 
                 data = pending_gets->data;
 
-                soup_session_cancel_message (session,
+                soup_session_cancel_message (download_session,
                                              data->message,
                                              SOUP_STATUS_CANCELLED);
         }
 
-        g_object_unref (session);
+        g_object_unref (download_session);
 
         for (i = 0; i < ICON_LAST; i++) {
                 g_object_unref (icons[i]);
diff --git a/src/discover/Makefile.am b/src/discover/Makefile.am
index 48da3b5..cd26371 100644
--- a/src/discover/Makefile.am
+++ b/src/discover/Makefile.am
@@ -1,6 +1,7 @@
 AM_CFLAGS = $(LIBGSSDP_CFLAGS)    \
            $(GIO_CFLAGS)         \
-           -I$(top_srcdir)
+           -I$(top_srcdir) \
+           $(WARN_CFLAGS)
 
 bin_PROGRAMS = gssdp-discover
 
@@ -8,4 +9,6 @@ gssdp_discover_SOURCES = gssdp-discover.c
 
 gssdp_discover_LDADD = $(LIBGSSDP_LIBS) $(GIO_LIBS)
 
+gssdp_discover_LDFLAGS = $(WARN_LDFLAGS)
+
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/discover/gssdp-discover.c b/src/discover/gssdp-discover.c
index 783fd28..e2b4656 100644
--- a/src/discover/gssdp-discover.c
+++ b/src/discover/gssdp-discover.c
@@ -48,7 +48,7 @@ static GOptionEntry entries[] =
         { NULL }
 };
 
-gboolean
+static gboolean
 on_force_rescan_timeout (GSSDPDiscover *discover) {
         gssdp_resource_browser_set_active (discover->browser,
                                            FALSE);
@@ -57,7 +57,7 @@ on_force_rescan_timeout (GSSDPDiscover *discover) {
         return TRUE;
 }
 
-void
+static void
 on_resource_available (GSSDPResourceBrowser *browser,
                        const char           *usn,
                        GList                *locations)
@@ -72,7 +72,7 @@ on_resource_available (GSSDPResourceBrowser *browser,
                 g_print ("  Location: %s\n", (char *) l->data);
 }
 
-void
+static void
 on_resource_unavailable (GSSDPResourceBrowser *browser,
                          const char           *usn)
 {
diff --git a/src/network-light/Makefile.am b/src/network-light/Makefile.am
index 8acf4a6..1c6cfb6 100644
--- a/src/network-light/Makefile.am
+++ b/src/network-light/Makefile.am
@@ -9,7 +9,8 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
            $(UUID_CFLAGS) \
            -I$(top_srcdir) \
            -DDATA_DIR='"$(shareddir)"' \
-           -I$(top_srcdir)/src/common
+           -I$(top_srcdir)/src/common \
+           $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-network-light
 
@@ -27,7 +28,7 @@ gupnp_network_light_LDADD = ../common/libutil.a \
                            $(GTK_LIBS) \
                            $(UUID_LIBS)
 
-gupnp_network_light_LDFLAGS = -export-dynamic
+gupnp_network_light_LDFLAGS = -export-dynamic $(WARN_LDFLAGS)
 
 if OS_WIN32
 network-light.res: network-light.rc
diff --git a/src/network-light/gui.c b/src/network-light/gui.c
index 3c67362..7c1e68b 100644
--- a/src/network-light/gui.c
+++ b/src/network-light/gui.c
@@ -40,6 +40,30 @@ static GdkPixbuf  *on_pixbuf;
 static GdkPixbuf  *off_pixbuf;
 
 void
+on_light_status_menuitem_activate (GtkCheckMenuItem *menuitem,
+                                   gpointer          user_data);
+void
+on_about_menuitem_activate (GtkMenuItem *menuitem,
+                            gpointer     user_data);
+
+void
+on_increase_luminance_menuitem_activate (GtkMenuItem *menuitem,
+                                         gpointer     user_data);
+
+void
+on_decrease_luminance_menuitem_activate (GtkMenuItem *menuitem,
+                                         gpointer     user_data);
+gboolean
+on_main_window_button_event (GtkWidget      *widget,
+                             GdkEventButton *event,
+                             gpointer        user_data);
+
+gboolean
+on_delete_event (GtkWidget *widget,
+                 GdkEvent  *event,
+                 gpointer   user_data);
+
+void
 update_image (void)
 {
         GtkWidget *image;
@@ -102,7 +126,7 @@ on_decrease_luminance_menuitem_activate (GtkMenuItem *menuitem,
 }
 
 static void
-prepare_popup ()
+prepare_popup (void)
 {
         GtkWidget *status_menuitem;
 
diff --git a/src/network-light/upnp.c b/src/network-light/upnp.c
index 0e6a74b..f1c93bf 100644
--- a/src/network-light/upnp.c
+++ b/src/network-light/upnp.c
@@ -61,6 +61,60 @@ static GUPnPXMLDoc *doc;
 static char *desc_location;
 static char uuid[37];
 
+void
+on_get_status (GUPnPService       *service,
+               GUPnPServiceAction *action,
+               gpointer            user_data);
+
+void
+on_get_target (GUPnPService       *service,
+               GUPnPServiceAction *action,
+               gpointer            user_data);
+
+void
+on_set_target (GUPnPService       *service,
+               GUPnPServiceAction *action,
+               gpointer            user_data);
+
+void
+on_query_status (GUPnPService *service,
+                 const char   *variable_name,
+                 GValue       *value,
+                 gpointer      user_data);
+
+void
+on_query_target (GUPnPService *service,
+                 const char   *variable_name,
+                 GValue       *value,
+                 gpointer      user_data);
+
+void
+on_get_load_level_status (GUPnPService       *service,
+                          GUPnPServiceAction *action,
+                          gpointer            user_data);
+
+void
+on_get_load_level_target (GUPnPService       *service,
+                          GUPnPServiceAction *action,
+                          gpointer            user_data);
+
+void
+on_set_load_level_target (GUPnPService       *service,
+                          GUPnPServiceAction *action,
+                          gpointer            user_data);
+
+void
+on_query_load_level_status (GUPnPService *service,
+                            const char   *variable_name,
+                            GValue       *value,
+                            gpointer      user_data);
+
+void
+on_query_load_level_target (GUPnPService *service,
+                            const char   *variable_name,
+                            GValue       *value,
+                            gpointer      user_data);
+
 static NetworkLight *
 network_light_new (GUPnPRootDevice  *dev,
                    GUPnPServiceInfo *switch_power,
@@ -244,7 +298,9 @@ on_set_load_level_target (GUPnPService       *service,
                                   NULL);
         gupnp_service_action_return (action);
 
-        load_level = CLAMP (load_level, 0, 100);
+        if (load_level > 100)
+                load_level = 100;
+
         set_load_level (load_level);
 }
 
@@ -328,7 +384,7 @@ xml_util_get_element (xmlNode *node,
         return node;
 }
 
-static void init_uuid ()
+static void init_uuid (void)
 {
         uuid_t uuid_context;
         xmlNode *uuid_node;
@@ -366,7 +422,7 @@ static void init_uuid ()
         g_free (udn);
 }
 
-void on_service_proxy_action_ret (GUPnPServiceProxy *proxy,
+static void on_service_proxy_action_ret (GUPnPServiceProxy *proxy,
                                   GUPnPServiceProxyAction *action,
                                   gpointer user_data)
 {
@@ -572,11 +628,10 @@ init_server (GUPnPContext *context)
 }
 
 static gboolean
-prepare_desc ()
+prepare_desc (void)
 {
-        GError *error;
+        GError *error = NULL;
 
-        error = NULL;
         doc = gupnp_xml_doc_new_from_path (DATA_DIR "/" DESCRIPTION_DOC,
                                            &error);
         if (doc == NULL) {
@@ -638,7 +693,7 @@ init_client (GUPnPContext *context)
 }
 
 static void
-on_context_available (GUPnPContextManager *context_manager,
+on_context_available (GUPnPContextManager *manager,
                       GUPnPContext        *context,
                       gpointer             user_data)
 {
@@ -650,7 +705,7 @@ on_context_available (GUPnPContextManager *context_manager,
 }
 
 static void
-on_context_unavailable (GUPnPContextManager *context_manager,
+on_context_unavailable (GUPnPContextManager *manager,
                         GUPnPContext        *context,
                         gpointer             user_data)
 {
@@ -671,7 +726,6 @@ context_equal (GUPnPContext *context1, GUPnPContext *context2)
 gboolean
 init_upnp (gchar **interfaces, guint port)
 {
-        GError *error = NULL;
         GUPnPWhiteList *white_list;
 
         switch_proxies = NULL;
@@ -682,7 +736,7 @@ init_upnp (gchar **interfaces, guint port)
                                          g_object_unref,
                                          (GDestroyNotify) network_light_free);
 
-        if (!prepare_desc (&error)) {
+        if (!prepare_desc ()) {
                 return FALSE;
         }
 
diff --git a/src/universal-cp/Makefile.am b/src/universal-cp/Makefile.am
index e81d3d8..23eadd4 100644
--- a/src/universal-cp/Makefile.am
+++ b/src/universal-cp/Makefile.am
@@ -6,7 +6,8 @@ endif
 
 AM_CFLAGS = $(GTK_CFLAGS) $(LIBGUPNP_CFLAGS) \
            -I$(top_srcdir) -DDATA_DIR='"$(shareddir)"' \
-           -I$(top_srcdir)/src/common
+           -I$(top_srcdir)/src/common \
+           $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-universal-cp
 
@@ -29,7 +30,7 @@ gupnp_universal_cp_LDADD = ../common/libutil.a \
                           $(LIBXML_LIBS) \
                           $(LIBGUPNP_LIBS)
 
-gupnp_universal_cp_LDFLAGS = -export-dynamic
+gupnp_universal_cp_LDFLAGS = -export-dynamic $(WARN_LDFLAGS)
 
 if OS_WIN32
 universal-cp.res: universal-cp.rc
diff --git a/src/universal-cp/action-dialog.c b/src/universal-cp/action-dialog.c
index 406bfad..7623e42 100644
--- a/src/universal-cp/action-dialog.c
+++ b/src/universal-cp/action-dialog.c
@@ -32,6 +32,8 @@
 #include "icons.h"
 #include "main.h"
 
+#include "action-dialog.h"
+
 #define DEFAULT_TEXTVIEW_HEIGHT 55
 
 static GtkWidget *dialog;
@@ -44,6 +46,10 @@ static GtkWidget *in_args_expander;
 static GtkWidget *out_args_expander;
 static GtkSizeGroup *label_container_group;
 
+void
+on_action_invocation (GtkButton *button,
+                      gpointer   user_data);
+
 static void
 on_expander_clicked (GObject    *expander,
                      GParamSpec *param_spec,
diff --git a/src/universal-cp/details-treeview.c b/src/universal-cp/details-treeview.c
index b6c4e4a..ae5507d 100644
--- a/src/universal-cp/details-treeview.c
+++ b/src/universal-cp/details-treeview.c
@@ -32,6 +32,18 @@ static GtkWidget *treeview;
 static GtkWidget *copy_value_menuitem;
 static GtkWidget *popup;
 
+gboolean
+on_details_treeview_button_release (GtkWidget      *widget,
+                                    GdkEventButton *event,
+                                    gpointer        user_data);
+void
+on_details_treeview_row_activate (GtkMenuItem *menuitem,
+                                  gpointer     user_data);
+
+void
+on_copy_all_details_activate (GtkMenuItem *menuitem,
+                              gpointer     user_data);
+
 static gboolean
 get_selected_row (GtkTreeIter *iter)
 {
diff --git a/src/universal-cp/device-treeview.c b/src/universal-cp/device-treeview.c
index 5e08c01..a93bf0f 100644
--- a/src/universal-cp/device-treeview.c
+++ b/src/universal-cp/device-treeview.c
@@ -43,8 +43,24 @@ static GtkWidget *separator;
 
 static gboolean   expanded;
 
+gboolean
+on_device_treeview_button_release (GtkWidget      *widget,
+                                   GdkEventButton *event,
+                                   gpointer        user_data);
+
+void
+on_device_treeview_row_activate (GtkMenuItem *menuitem,
+                                 gpointer     user_data);
+
+void
+on_expand_devices_activate (GtkMenuItem *menuitem,
+                            gpointer     user_data);
+
+void
+on_collapse_devices_activate (GtkMenuItem *menuitem,
+                              gpointer     user_data);
 static void
-show_default_details ()
+show_default_details (void)
 {
         const char *details[32];
         int         i = 0;
@@ -137,7 +153,7 @@ get_service_device (GUPnPServiceInfo *service_info)
 }
 
 static void
-setup_device_popup (GtkWidget *popup)
+setup_device_popup (GtkWidget *widget)
 {
         GUPnPServiceProxy *proxy;
 
diff --git a/src/universal-cp/event-treeview.c b/src/universal-cp/event-treeview.c
index 82cbf96..d41842e 100644
--- a/src/universal-cp/event-treeview.c
+++ b/src/universal-cp/event-treeview.c
@@ -35,6 +35,31 @@ static GtkWidget *popup;
 static GtkWidget *scrolled_window;
 static GtkWidget *copy_event_menuitem;
 
+gboolean
+on_event_treeview_button_release (GtkWidget      *widget,
+                                  GdkEventButton *event,
+                                  gpointer        user_data);
+
+void
+on_event_treeview_row_activate (GtkMenuItem *menuitem,
+                                gpointer     user_data);
+
+void
+on_copy_all_events_activate (GtkMenuItem *menuitem,
+                             gpointer     user_data);
+
+void
+on_clear_event_log_activate (GtkMenuItem *menuitem,
+                             gpointer     user_data);
+
+void
+on_event_log_activate (GtkCheckMenuItem *menuitem,
+                       gpointer          user_data);
+
+void
+on_subscribe_to_events_activate (GtkCheckMenuItem *menuitem,
+                                 gpointer          user_data);
+
 static gboolean
 on_query_tooltip (GtkWidget  *widget,
                   gint        x,
@@ -106,7 +131,7 @@ get_selected_row (GtkTreeIter *iter)
 }
 
 static void
-setup_event_popup (GtkWidget *popup)
+setup_event_popup (GtkWidget *widget)
 {
         /* Only show "Copy Value" menuitem when a row is selected */
         g_object_set (copy_event_menuitem,
@@ -271,10 +296,13 @@ static char *
 get_display_value (const char *value)
 {
         char         *display_value;
-        guint         size;
+        size_t        size;
 
         /* Don't let the value displayed in treeview, grow indefinitely */
-        size = CLAMP (strlen (value), 0, MAX_VALUE_SIZE);
+        size = strlen (value);
+        if (size > MAX_VALUE_SIZE)
+                size = MAX_VALUE_SIZE;
+
         display_value = g_memdup (value, size + 1);
         display_value[size] = '\0';
 
diff --git a/src/universal-cp/gui.c b/src/universal-cp/gui.c
index e1b6235..9ddb9ab 100644
--- a/src/universal-cp/gui.c
+++ b/src/universal-cp/gui.c
@@ -37,6 +37,11 @@
 GtkBuilder *builder;
 static GtkWidget *main_window;
 
+gboolean
+on_delete_event (GtkWidget *widget,
+                 GdkEvent  *event,
+                 gpointer   user_data);
+
 void
 setup_treeview (GtkWidget    *treeview,
                 GtkTreeModel *model,
diff --git a/src/universal-cp/gui.h b/src/universal-cp/gui.h
index 62ad401..d3ba0c4 100644
--- a/src/universal-cp/gui.h
+++ b/src/universal-cp/gui.h
@@ -26,13 +26,7 @@
 
 #include "device-treeview.h"
 #include "details-treeview.h"
-
-void
-display_event      (const char       *notified_at,
-                    const char       *friendly_name,
-                    const char       *service_id,
-                    const char       *variable_name,
-                    const char       *value);
+#include "event-treeview.h"
 
 void
 setup_treeview     (GtkWidget    *treeview,
diff --git a/src/universal-cp/main.c b/src/universal-cp/main.c
index a58adf0..de9175e 100644
--- a/src/universal-cp/main.c
+++ b/src/universal-cp/main.c
@@ -43,6 +43,10 @@ static GOptionEntry entries[] =
         { NULL }
 };
 
+
+void
+application_exit (void);
+
 static GUPnPContextManager *context_manager;
 
 static void
@@ -60,7 +64,7 @@ device_proxy_unavailable_cb (GUPnPControlPoint *cp,
 }
 
 static void
-on_context_available (GUPnPContextManager *context_manager,
+on_context_available (GUPnPContextManager *manager,
                       GUPnPContext        *context,
                       gpointer             user_data)
 {
diff --git a/src/upload/Makefile.am b/src/upload/Makefile.am
index 56861fc..e50b61d 100644
--- a/src/upload/Makefile.am
+++ b/src/upload/Makefile.am
@@ -2,7 +2,8 @@ AM_CFLAGS = $(LIBGUPNP_CFLAGS)    \
            $(LIBGUPNP_AV_CFLAGS) \
            $(GIO_CFLAGS)         \
            -I$(top_srcdir)       \
-           -I$(top_srcdir)/src/common
+           -I$(top_srcdir)/src/common \
+           $(WARN_CFLAGS)
 
 bin_PROGRAMS = gupnp-upload
 
@@ -22,6 +23,6 @@ gupnp_upload_LDADD = $(LIBGUPNP_LIBS)    \
                     $(LIBGUPNP_AV_LIBS) \
                     $(GIO_LIBS)
 
-gupnp_upload_LDFLAGS = -export-dynamic
+gupnp_upload_LDFLAGS = -export-dynamic $(WARN_LDFLAGS)
 
 MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/upload/container-search.c b/src/upload/container-search.c
index 90d90e1..6284b2c 100644
--- a/src/upload/container-search.c
+++ b/src/upload/container-search.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "container-search.h"
 #include "main.h"
 
 static void
diff --git a/src/upload/control_point.c b/src/upload/control_point.c
index 4dcb1ac..a9ee088 100644
--- a/src/upload/control_point.c
+++ b/src/upload/control_point.c
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "control_point.h"
 #include "main.h"
 
 #define CDS "urn:schemas-upnp-org:service:ContentDirectory"
@@ -32,7 +33,7 @@ static GUPnPServiceProxy *cds_proxy = NULL;
 static guint timeout_id = 0;
 
 static void
-device_proxy_unavailable_cb (GUPnPControlPoint *cp,
+device_proxy_unavailable_cb (GUPnPControlPoint *control_point,
                              GUPnPDeviceProxy  *proxy)
 {
         /* We don't need to check if it's our proxy */
@@ -40,7 +41,7 @@ device_proxy_unavailable_cb (GUPnPControlPoint *cp,
 }
 
 static void
-device_proxy_available_cb (GUPnPControlPoint *cp,
+device_proxy_available_cb (GUPnPControlPoint *control_point,
                            GUPnPDeviceProxy  *proxy)
 {
         GUPnPDeviceInfo *info;
diff --git a/src/upload/item-creation.c b/src/upload/item-creation.c
index 2ec4e63..b9681e7 100644
--- a/src/upload/item-creation.c
+++ b/src/upload/item-creation.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "item-creation.h"
 #include "main.h"
 
 static const char *
diff --git a/src/upload/item-creation.h b/src/upload/item-creation.h
index 3d0805d..d4d9a76 100644
--- a/src/upload/item-creation.h
+++ b/src/upload/item-creation.h
@@ -27,8 +27,7 @@ void
 create_item                     (const char              *file_path,
                                  const char              *title,
                                  GUPnPServiceProxy       *cds_proxy,
-                                 const char              *container_id,
-                                 GUPnPContext            *context);
+                                 const char              *container_id);
 
 #endif /* __ITEM_CREATION_H__ */
 
diff --git a/src/upload/main.c b/src/upload/main.c
index abbaa21..11cecb5 100644
--- a/src/upload/main.c
+++ b/src/upload/main.c
@@ -67,8 +67,7 @@ goto_next_file (void)
                 create_item ((char *) files->data,
                              title,
                              cds_proxy,
-                             dest_container,
-                             upnp_context);
+                             dest_container);
         } else {
                 /* Exit if there are no more files to upload */
                 application_exit ();
@@ -90,8 +89,7 @@ container_found (const char *container_id)
         create_item ((char *) files->data,
                      title,
                      cds_proxy,
-                     dest_container,
-                     upnp_context);
+                     dest_container);
 }
 
 void
@@ -131,10 +129,8 @@ gint
 main (gint   argc,
       gchar *argv[])
 {
-        GError *error;
+        GError *error = NULL;
         gint i;
-
-        error = NULL;
         GOptionContext *context;
 
 #if !GLIB_CHECK_VERSION(2, 35, 0)
diff --git a/src/upload/transfer.c b/src/upload/transfer.c
index a1fcdaf..5b56207 100644
--- a/src/upload/transfer.c
+++ b/src/upload/transfer.c
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "transfer.h"
 #include "main.h"
 
 typedef struct


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