[Xfce4-commits] <xfdesktop:master> Fix warnings and obsolete macros

Eric Koegel noreply at xfce.org
Mon Sep 9 09:44:01 CEST 2013


Updating branch refs/heads/master
         to 72db63766094dd55fa60ffed85ff846adbd00631 (commit)
       from 487e5002a5fa4ef9fa8a204f4547bc0c4f7494e3 (commit)

commit 72db63766094dd55fa60ffed85ff846adbd00631
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Sep 9 10:37:43 2013 +0300

    Fix warnings and obsolete macros
    
    There were a couple potential variables used uninitialized, some
    variables were set before the previous value was used in the code,
    and finally some obsolete macros in autoconf that were fixed.

 configure.ac.in             |   20 ++++++++++----------
 src/xfdesktop-file-utils.c  |    2 +-
 src/xfdesktop-icon-view.c   |    6 +++---
 src/xfdesktop-notify.c      |    6 ++++--
 src/xfdesktop-volume-icon.c |    5 +++--
 5 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 8a4c309..982502a 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -28,7 +28,7 @@ m4_define([xfconf_minimum_version], [4.8.0])
 
 dnl init autoconf
 AC_INIT([xfdesktop], [xfdesktop_version], [http://bugzilla.xfce.org/])
-AC_PREREQ([2.50])
+AC_PREREQ([2.60])
 
 dnl init automake
 AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar no-dist-gzip])
@@ -37,16 +37,15 @@ AM_MAINTAINER_MODE
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl check for UNIX variants
-AC_AIX
-AC_ISC_POSIX
-AC_MINIX
+AC_USE_SYSTEM_EXTENSIONS
+AC_SEARCH_LIBS([strerror],[cposix])
 AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""])
 
 dnl check for basic programs
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_INSTALL
-AC_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
+IT_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
 m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [AC_CHECK_PROG(SED, sed, sed)])
 
 dnl prepare libtool
@@ -95,7 +94,7 @@ XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [glib_minimum_version], [
 
 dnl do we want desktop icons at all?
 AC_ARG_ENABLE([desktop-icons],
-    [AC_HELP_STRING([--disable-desktop-icons],
+    [AS_HELP_STRING([--disable-desktop-icons],
             [Do not compile in support for desktop icons (default=enabled)])],
         [ac_cv_enable_desktop_icons=$enableval],
         [ac_cv_enable_desktop_icons=yes])
@@ -109,7 +108,7 @@ AM_CONDITIONAL([ENABLE_DESKTOP_ICONS], [test "x$enable_desktop_icons" = "xyes"])
 
 dnl if we want desktop icons, do we also want file icons?
 AC_ARG_ENABLE([file-icons],
-    [AC_HELP_STRING([--disable-file-icons],
+    [AS_HELP_STRING([--disable-file-icons],
             [Do not compile in support for desktop file icons (default=enabled)])],
         [ac_cv_enable_file_icons=$enableval],
         [ac_cv_enable_file_icons=yes])
@@ -151,7 +150,7 @@ XDT_CHECK_PACKAGE([LIBEXO], [exo-1], [exo_minimum_version])
 
 
 AC_ARG_ENABLE([desktop-menu],
-        AC_HELP_STRING([--disable-desktop-menu],
+        AS_HELP_STRING([--disable-desktop-menu],
                 [Do not build the desktop menu module (default=enabled)]),
         [ac_cv_enable_desktop_menu=$enableval],
         [ac_cv_enable_desktop_menu=yes])
@@ -177,7 +176,7 @@ fi
 AM_CONDITIONAL([BUILD_DESKTOP_MENU], [test "x$build_desktop_menu" = "xyes"])
 
 AC_ARG_WITH([file-manager-fallback],
-    [AC_HELP_STRING([--with-file-manager-fallback=PATH],
+    [AS_HELP_STRING([--with-file-manager-fallback=PATH],
             [Default file manager fallback to handle external folders and applications (default=Thunar)])],
     [ac_cv_file_manager_fallback="$withval"],
     [ac_cv_file_manager_fallback=Thunar])
@@ -193,7 +192,7 @@ XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.4.0], [notifications],
 dnl check for debugging support
 XDT_FEATURE_DEBUG
 
-AC_OUTPUT([
+AC_CONFIG_FILES([
 Makefile
 backgrounds/Makefile
 common/Makefile
@@ -203,6 +202,7 @@ po/Makefile.in
 settings/Makefile
 src/Makefile
 ])
+AC_OUTPUT
 
 echo
 echo "Build Configuration:"
diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c
index e593c65..23e5dc3 100644
--- a/src/xfdesktop-file-utils.c
+++ b/src/xfdesktop-file-utils.c
@@ -324,7 +324,7 @@ xfdesktop_file_utils_mount_is_internal (GMount *mount)
 gboolean
 xfdesktop_file_utils_volume_is_removable(GVolume *volume)
 {
-  gboolean can_eject = FALSE;
+  gboolean can_eject;
   gboolean can_mount = FALSE;
   gboolean can_unmount = FALSE;
   gboolean is_removable = FALSE;
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 8a1b2d6..3bec49d 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -1376,7 +1376,7 @@ xfdesktop_icon_view_drag_motion(GtkWidget *widget,
                                 guint time_)
 {
     XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(widget);
-    GdkAtom target = GDK_NONE;
+    GdkAtom target;
     guint16 hover_row = 0, hover_col = 0;
     XfdesktopIcon *icon_on_dest = NULL;
     GdkDragAction our_action = 0;
@@ -1496,7 +1496,7 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
                               guint time_)
 {
     XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(widget);
-    GdkAtom target = GDK_NONE;
+    GdkAtom target;
     XfdesktopIcon *icon;
     guint16 old_row, old_col, row, col;
     GList *l;
@@ -3117,7 +3117,7 @@ xfdesktop_move_all_cached_icons_to_desktop(XfdesktopIconView *icon_view)
 {
 #ifdef ENABLE_FILE_ICONS
     GList *l, *leftovers = NULL;
-    XfdesktopFileIconManager *fmanager;
+    XfdesktopFileIconManager *fmanager = NULL;
 
     TRACE("entering");
 
diff --git a/src/xfdesktop-notify.c b/src/xfdesktop-notify.c
index 6cbcad3..6d2cff9 100644
--- a/src/xfdesktop-notify.c
+++ b/src/xfdesktop-notify.c
@@ -235,9 +235,10 @@ xfdesktop_notify_unmount_finish (GMount *mount, gboolean unmount_successful)
       notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
       notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
       notify_notification_show (notification, NULL);
+
+      g_free (message);
     }
 
-  g_free (message);
   g_free (icon_name);
   g_free (name);
 }
@@ -419,9 +420,10 @@ xfdesktop_notify_eject_finish (GVolume *volume, gboolean eject_successful)
       notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
       notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
       notify_notification_show (notification, NULL);
+
+      g_free (message);
     }
 
-  g_free (message);
   g_free (icon_name);
   g_free (name);
 }
diff --git a/src/xfdesktop-volume-icon.c b/src/xfdesktop-volume-icon.c
index c01b7f2..e29bd99 100644
--- a/src/xfdesktop-volume-icon.c
+++ b/src/xfdesktop-volume-icon.c
@@ -715,7 +715,7 @@ xfdesktop_volume_icon_menu_eject(GtkWidget *widget,
     GtkWidget *toplevel = gtk_widget_get_toplevel(icon_view);
     GVolume *volume;
     GMount *mount;
-    GMountOperation *operation;
+    GMountOperation *operation = NULL;
 
     volume = xfdesktop_volume_icon_peek_volume(icon);
     mount = g_volume_get_mount(volume);
@@ -743,7 +743,8 @@ xfdesktop_volume_icon_menu_eject(GtkWidget *widget,
     }
 
     g_object_unref(mount);
-    g_object_unref(operation);
+    if(operation != NULL)
+        g_object_unref(operation);
 }
 
 static void


More information about the Xfce4-commits mailing list