]> git.eshelyaron.com Git - emacs.git/commitdiff
Assume C89 offsetof in widget.c
authorPaul Eggert <eggert@Penguin.CS.UCLA.EDU>
Tue, 14 Apr 2015 07:37:48 +0000 (00:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Apr 2015 07:53:35 +0000 (00:53 -0700)
* src/widget.c (XtOffset): Remove; no longer needed.
(offset): Implement via offsetof instead of via pre-C89 XtOffset hack.

src/widget.c

index acf559f313b981a2644af69975956968d45ac3bd..c45193f17f57aa5167fa653d33a2f267cecec160 100644 (file)
@@ -61,10 +61,7 @@ static void EmacsFrameResize (Widget widget);
 static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result);
 
 
-#undef XtOffset
-#define XtOffset(p_type,field) \
-       ((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0)))
-#define offset(field) XtOffset (EmacsFrame, emacs_frame.field)
+#define offset(field) offsetof (EmacsFrameRec, emacs_frame.field)
 
 static XtResource resources[] = {
   {XtNgeometry, XtCGeometry, XtRString, sizeof (String),