diff options
| author | Andreas Schwab | 2007-04-29 16:08:14 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2007-04-29 16:08:14 +0000 |
| commit | 4bb7141c0dc99bd4c4031b8e4910f7bd78a10a03 (patch) | |
| tree | 4ca6d41a98eedcbb70e3383eb2244d5d8f4ed308 /src | |
| parent | 6f37a5760b6efac0b70b3a89ee4014938c493f15 (diff) | |
| download | emacs-4bb7141c0dc99bd4c4031b8e4910f7bd78a10a03.tar.gz emacs-4bb7141c0dc99bd4c4031b8e4910f7bd78a10a03.zip | |
(VECSIZE): Use OFFSETOF.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2007-04-29 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * lisp.h (VECSIZE): Use OFFSETOF. | ||
| 4 | |||
| 1 | 2007-04-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 5 | 2007-04-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 6 | ||
| 3 | * xdisp.c (try_window_reusing_current_matrix): Fix number of | 7 | * 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 | |||
| 735 | 735 | ||
| 736 | /* If a struct is made to look like a vector, this macro returns the length | 736 | /* If a struct is made to look like a vector, this macro returns the length |
| 737 | of the shortest vector that would hold that struct. */ | 737 | of the shortest vector that would hold that struct. */ |
| 738 | #define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector) \ | 738 | #define VECSIZE(type) ((sizeof (type) \ |
| 739 | - sizeof (Lisp_Object)) \ | 739 | - OFFSETOF (struct Lisp_Vector, contents[0]) \ |
| 740 | + sizeof(Lisp_Object) - 1) /* round up */ \ | 740 | + sizeof(Lisp_Object) - 1) /* round up */ \ |
| 741 | / sizeof (Lisp_Object)) | 741 | / sizeof (Lisp_Object)) |
| 742 | 742 | ||
| 743 | /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields | 743 | /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields |