winedbg: Use offsetof instead of reimplementing it.

Michael Stefaniuc mstefani at redhat.de
Sat Nov 1 18:23:02 CDT 2008


---
 programs/winedbg/display.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/programs/winedbg/display.c b/programs/winedbg/display.c
index 0901961..acd51a4 100644
--- a/programs/winedbg/display.c
+++ b/programs/winedbg/display.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -40,8 +41,6 @@ struct display
 static struct display *displaypoints = NULL;
 static unsigned int maxdisplays = 0, ndisplays = 0;
 
-#define OFFSET_OF(_f,_s)        ((unsigned)(&(((_s*)NULL)->_f)))
-
 static inline BOOL cmp_symbol(const SYMBOL_INFO* si1, const SYMBOL_INFO* si2)
 {
     /* FIXME: !memcmp(si1, si2, sizeof(SYMBOL_INFO) + si1->NameLen)
@@ -50,7 +49,7 @@ static inline BOOL cmp_symbol(const SYMBOL_INFO* si1, const SYMBOL_INFO* si2)
      * stack_get_frame, so that un-touched fields by stack_get_frame
      * get the same value!!
      */
-    return !memcmp(si1, si2, OFFSET_OF(Name, SYMBOL_INFO)) &&
+    return !memcmp(si1, si2, offsetof(SYMBOL_INFO, Name)) &&
         !memcmp(si1->Name, si2->Name, si1->NameLen);
 }
 
-- 
1.6.0.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081102/51bff0e1/attachment.pgp 


More information about the wine-patches mailing list