Re: patch for 64bit compilation



Hi,

It seems with gcc 4.1 has a problem with these macros as well complaining that the value computed in not used.  Doing as Shahms King suggested works for me but also needed to be applied to GNOME_VFS_FILE_INFO_SET_SYMLINK which was used by the file-method.  I've attached a patch that applies this to both as well as fixes the other similar macros since I suspect the only reason they are triggering the warning is because they aren't used. 

Trevor

On 12/19/05, Alexander Larsson < alexl redhat com> wrote:
On Fri, 2005-12-16 at 15:24 -0800, Shahms King wrote:
> which quite a few of them do. I don't have a compiler to test this on,
> but if GNOME_VFS_FILE_INFO_SET_LOCAL is changed to:
>
> #define GNOME_VFS_FILE_INFO_SET_LOCAL(info, value) \
>       ((info)->flags = (value ? \
>       ((info)->flags | GNOME_VFS_FILE_FLAGS_LOCAL) : \
>       ((info)->flags & ~GNOME_VFS_FILE_FLAGS_LOCAL)))
>
> Does the error go away? The above change shouldn't change the API as the
> macro still returns the new value of flags, but *should* silence the
> warning.  If the above works, the rest of the macros should probably be
> changed.

Rodrigo, could you test this? It seems like a better approach if it
works.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson                                            Red Hat, Inc
                   alexl redhat com     alla lysator liu se
He's an ungodly Amish senator with a mysterious suitcase handcuffed to his
arm. She's a manipulative gold-digging magician's assistant on the trail of a
serial killer. They fight crime!

_______________________________________________
gnome-vfs-list mailing list
gnome-vfs-list gnome org
http://mail.gnome.org/mailman/listinfo/gnome-vfs-list

Index: gnome-vfs-file-info.h
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-file-info.h,v
retrieving revision 1.33
diff -u -r1.33 gnome-vfs-file-info.h
--- gnome-vfs-file-info.h	30 Nov 2005 14:46:49 -0000	1.33
+++ gnome-vfs-file-info.h	19 Dec 2005 17:41:55 -0000
@@ -352,10 +352,11 @@
  *
  * Set the symbolic link field in @info to @value.
  */
-#define GNOME_VFS_FILE_INFO_SET_SYMLINK(info, value)			\
-	(value ? ((info)->flags |= GNOME_VFS_FILE_FLAGS_SYMLINK)	\
-	       : ((info)->flags &= ~GNOME_VFS_FILE_FLAGS_SYMLINK))
-
+ #define GNOME_VFS_FILE_INFO_SET_SYMLINK(info, value) \
+       ((info)->flags = (value ? \
+       ((info)->flags | GNOME_VFS_FILE_FLAGS_SYMLINK) : \
+       ((info)->flags & ~GNOME_VFS_FILE_FLAGS_SYMLINK)))
+       
 /**
  * GNOME_VFS_FILE_INFO_LOCAL:
  * @info: GnomeVFSFileInfo struct
@@ -372,10 +373,10 @@
  *
  * Set the "local file" field in @info to @value.
  */
-#define GNOME_VFS_FILE_INFO_SET_LOCAL(info, value)			\
-	(value ? ((info)->flags |= GNOME_VFS_FILE_FLAGS_LOCAL)		\
-	       : ((info)->flags &= ~GNOME_VFS_FILE_FLAGS_LOCAL))
-
+ #define GNOME_VFS_FILE_INFO_SET_LOCAL(info, value) \
+       ((info)->flags = (value ? \
+       ((info)->flags | GNOME_VFS_FILE_FLAGS_LOCAL) : \
+       ((info)->flags & ~GNOME_VFS_FILE_FLAGS_LOCAL)))
 
 /**
  * GNOME_VFS_FILE_INFO_SUID:
@@ -412,8 +413,9 @@
  * Set the SUID field in @info to @value.
  */
 #define GNOME_VFS_FILE_INFO_SET_SUID(info, value)		\
-	(value ? ((info)->permissions |= GNOME_VFS_PERM_SUID)	\
-	       : ((info)->permissions &= ~GNOME_VFS_PERM_SUID))
+       ((info)->flags = (value ? \
+       ((info)->flags | GNOME_VFS_PERM_SUID) : \
+       ((info)->flags & ~GNOME_VFS_PERM_SUID)))
 
 /**
  * GNOME_VFS_FILE_INFO_SET_SGID:
@@ -423,8 +425,10 @@
  * Set the SGID field in @info to @value.
  */
 #define GNOME_VFS_FILE_INFO_SET_SGID(info, value)		\
-	(value ? ((info)->permissions |= GNOME_VFS_PERM_SGID)	\
-	       : ((info)->permissions &= ~GNOME_VFS_PERM_SGID))
+		((info)->flags = (value ? \
+		((info)->flags | GNOME_VFS_PERM_SGID) : \
+		((info)->flags & ~GNOME_VFS_PERM_SGID)))      
+	       
 /**
  * GNOME_VFS_FILE_INFO_SET_STICKY:
  * @info: GnomeVFSFileInfo struct


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