From 4bb7141c0dc99bd4c4031b8e4910f7bd78a10a03 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 29 Apr 2007 16:08:14 +0000 Subject: [PATCH] (VECSIZE): Use OFFSETOF. --- src/ChangeLog | 4 ++++ src/lisp.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f5da623e24c..67227b56702 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-04-29 Andreas Schwab + + * lisp.h (VECSIZE): Use OFFSETOF. + 2007-04-29 YAMAMOTO Mitsuharu * xdisp.c (try_window_reusing_current_matrix): Fix number of diff --git a/src/lisp.h b/src/lisp.h index 40ed548e494..d92f4045742 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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 -- 2.39.2