]> git.eshelyaron.com Git - emacs.git/commitdiff
(VECSIZE): Use OFFSETOF.
authorAndreas Schwab <schwab@suse.de>
Sun, 29 Apr 2007 16:08:14 +0000 (16:08 +0000)
committerAndreas Schwab <schwab@suse.de>
Sun, 29 Apr 2007 16:08:14 +0000 (16:08 +0000)
src/ChangeLog
src/lisp.h

index f5da623e24c04eedc2fa5b45910afc985ce4f118..67227b5670298ea31911525228bf0fdf76405466 100644 (file)
@@ -1,3 +1,7 @@
+2007-04-29  Andreas Schwab  <schwab@suse.de>
+
+       * lisp.h (VECSIZE): Use OFFSETOF.
+
 2007-04-29  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * xdisp.c (try_window_reusing_current_matrix): Fix number of
index 40ed548e494005eb262d28102f29b0630aaf57e6..d92f4045742f639b2db7eb0cc606efe561a59427 100644 (file)
@@ -735,9 +735,9 @@ struct Lisp_Vector
 
 /* If a struct is made to look like a vector, this macro returns the length
    of the shortest vector that would hold that struct.  */
-#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector)  \
-                                         - sizeof (Lisp_Object))      \
-                        + sizeof(Lisp_Object) - 1) /* round up */     \
+#define VECSIZE(type) ((sizeof (type)                                    \
+                       - OFFSETOF (struct Lisp_Vector, contents[0])      \
+                        + sizeof(Lisp_Object) - 1) /* round up */        \
                       / sizeof (Lisp_Object))
 
 /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields