[Goodies-commits] r5001 - in xfce4-screenshooter-plugin/trunk: . src

Jerome Guelfucci jeromeg at xfce.org
Fri Jun 27 18:21:54 CEST 2008


Author: jeromeg
Date: 2008-06-27 16:21:54 +0000 (Fri, 27 Jun 2008)
New Revision: 5001

Modified:
   xfce4-screenshooter-plugin/trunk/ChangeLog
   xfce4-screenshooter-plugin/trunk/src/Makefile.am
   xfce4-screenshooter-plugin/trunk/src/main.c
   xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c
   xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.h
Log:
Fix gcc warnings and infinite loop.

Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog	2008-06-27 15:58:01 UTC (rev 5000)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog	2008-06-27 16:21:54 UTC (rev 5001)
@@ -1,5 +1,11 @@
 2008-06-27 jeromeg
 
+	* src/Makefile.am: enable -Wall
+	* src/{main.c, screenshooter-utils.{c,h}}: fix gcc warnings except one...
+	* BUGFIX: fix infinite loop in generate_filename_for_uri !
+
+2008-06-27 jeromeg
+
 	* src/screenshooter-utils.c: clean generate_filename_for_uri using g_access.
 
 2008-06-20 09:19 jeromeg

Modified: xfce4-screenshooter-plugin/trunk/src/Makefile.am
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/Makefile.am	2008-06-27 15:58:01 UTC (rev 5000)
+++ xfce4-screenshooter-plugin/trunk/src/Makefile.am	2008-06-27 16:21:54 UTC (rev 5001)
@@ -4,7 +4,7 @@
 
 xfce4_screenshooter_plugin_CFLAGS =						\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
-	@LIBXFCE4PANEL_CFLAGS@
+	@LIBXFCE4PANEL_CFLAGS@ -Wall
 
 xfce4_screenshooter_plugin_LDFLAGS =						\
 	@LIBXFCE4PANEL_LIBS@
@@ -17,7 +17,7 @@
 	@GTK_CFLAGS@ \
 	@GLIB_CFLAGS@ \
 	@LIBXFCE4UTIL_CFLAGS@ \
-	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" -Wall
 	
 xfce4_screenshooter_LDFLAGS =                       \
 	@GTK_LIBS@ \

Modified: xfce4-screenshooter-plugin/trunk/src/main.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/main.c	2008-06-27 15:58:01 UTC (rev 5000)
+++ xfce4-screenshooter-plugin/trunk/src/main.c	2008-06-27 16:21:54 UTC (rev 5001)
@@ -103,7 +103,7 @@
   gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_ACCEPT);
   gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER ( chooser ), xfce_get_homedir () );  
   
-  filename = generate_filename_for_uri ( xfce_get_homedir () );
+  filename = generate_filename_for_uri ( g_strdup ( xfce_get_homedir () ) );
   preview = gtk_image_new ();
   
   gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (chooser), filename);
@@ -123,5 +123,6 @@
   
   gtk_widget_destroy(chooser);
   g_free(filename);
+  
+  return 0;
 }
-

Modified: xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c	2008-06-27 15:58:01 UTC (rev 5000)
+++ xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c	2008-06-27 16:21:54 UTC (rev 5001)
@@ -149,7 +149,6 @@
 
 gchar *generate_filename_for_uri(char *uri)
 {
-  int test;
   gchar *file_name;
   unsigned int i = 0;
     
@@ -160,7 +159,7 @@
   
   file_name = g_strdup ("Screenshot.png");
     
-  if( ( test = g_access ( g_build_filename (uri, file_name, NULL), F_OK ) ) != 0 ) 
+  if( g_access ( g_build_filename (uri, file_name, NULL), F_OK ) != 0 ) 
   {
     return file_name;
   }
@@ -171,7 +170,7 @@
     g_free (file_name);
     file_name = g_strdup_printf ("Screenshot-%d.png", i);
   }
-  while( ( test = g_access ( g_build_filename (uri, file_name, NULL), F_OK ) ) == -1 );
+  while( g_access ( g_build_filename (uri, file_name, NULL), F_OK ) == 0 );
     
   return file_name;
 }

Modified: xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.h
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.h	2008-06-27 15:58:01 UTC (rev 5000)
+++ xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.h	2008-06-27 16:21:54 UTC (rev 5001)
@@ -31,6 +31,7 @@
 
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
+#include <glib/gstdio.h>
 
 #include <fcntl.h>
 #include <X11/Xatom.h>




More information about the Goodies-commits mailing list