From 7c1b001728f448695cf63dfeb2899f02d41d4341 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Mon, 15 Aug 2005 21:13:53 +0000 Subject: [PATCH] * vfs-impl.h (union vfs_dirent): Using the offsetof macro instead of null pointer arithmethics. --- vfs/ChangeLog | 5 +++++ vfs/vfs-impl.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index b4368fb57..a9b043fe8 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,8 @@ +2005-08-15 Roland Illig + + * vfs-impl.h (union vfs_dirent): Using the offsetof macro + instead of null pointer arithmethics. + 2005-07-31 Roland Illig * samba: Added some const qualifiers to reduce the number of gcc diff --git a/vfs/vfs-impl.h b/vfs/vfs-impl.h index 668a7b639..9d993b769 100644 --- a/vfs/vfs-impl.h +++ b/vfs/vfs-impl.h @@ -3,6 +3,8 @@ #ifdef USE_VFS +#include + typedef void *vfsid; struct vfs_stamping; @@ -79,8 +81,7 @@ struct vfs_class { */ union vfs_dirent { struct dirent dent; - char _extra_buffer[((int) &((struct dirent *) 0)->d_name) + - MC_MAXPATHLEN + 1]; + char _extra_buffer[offsetof(struct dirent, d_name) + MC_MAXPATHLEN + 1]; }; /* Register a file system class */