[PATCH] Xfce 4.2 rc 1 & 2 panel not starting up

Michele Baldessari michele at pupazzo.org
Tue Dec 14 12:27:10 CET 2004


[resend: messed up first time. sorry if a duplicate mail shows up]

Hi there,

I finally took some time to investigate why my xfce4-panel (everything
else is fine) never started up on my debian unstable ppc laptop (it 
works fine on my x86 workstation, same distro). This happened with
rc1,rc2 and a couple of cvs snapshots in between.

It basically gets stuck in panel/xfce_support.c +211 write_backup_file(), due
to a wrong size comparison (gcc 3.3.5 spews "warning: comparison is always
true due to limited range of data type" on those lines). getc returns an int 
and EOF is sizeof(int).

The attached patch fixes the startup problem here. While I was at it, I
alse fixed the other comparisons I found.

Hope it sounds ok. Obviously casting EOF to (char)EOF and not changing
the type for 'c' works as well. (but is uglier methinks)

See http://www.federated.com/~jim/arm/charhell.html for more
details.

Michele Baldessari

--- xfce4-panel-4.1.99.2+cvs.20041211/panel/main.c.orig	2004-10-06 10:25:08.000000000 +0200
+++ xfce4-panel-4.1.99.2+cvs.20041211/panel/main.c	2004-12-14 08:55:53.849841352 +0100
@@ -316,7 +316,8 @@
                       const char *old_subdir, const char *old_file,
                       const char *new_subdir, const char *new_file)
 {
-    char  *old, *new, *path, c;
+    char  *old, *new, *path;
+    int c;
     FILE *r, *w;
     GError *error = NULL;
 
--- xfce4-panel-4.1.99.2+cvs.20041211/panel/xfce_support.c.orig	2004-11-10 10:36:45.000000000 +0100
+++ xfce4-panel-4.1.99.2+cvs.20041211/panel/xfce_support.c	2004-12-14 08:55:53.887835576 +0100
@@ -194,7 +194,8 @@
 {
     FILE *fp;
     FILE *bakfp;
-    char bakfile[MAXSTRLEN + 1], c;
+    char bakfile[MAXSTRLEN + 1];
+    int c;
 
     snprintf (bakfile, MAXSTRLEN, "%s.bak", path);
 
--- xfce4-panel-4.1.99.2+cvs.20041211/settings/xfce_settings_plugin.c.orig	2004-12-14 08:56:28.720540200 +0100
+++ xfce4-panel-4.1.99.2+cvs.20041211/settings/xfce_settings_plugin.c	2004-12-14 08:56:43.271328144 +0100
@@ -100,7 +100,8 @@
                       const char *old_subdir, const char *old_file,
                       const char *new_subdir, const char *new_file)
 {
-    char  *old, *new, *path, c;
+    char  *old, *new, *path;
+    int c;
     FILE *r, *w;
     GError *error = NULL;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20041214/86dc3776/attachment.pgp>


More information about the Xfce4-dev mailing list