aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2016-03-18 08:42:15 -0700
committerPaul Eggert2016-03-18 08:43:32 -0700
commit6da3a6dc9e3e9ac3d7bb666410926ebc4a078505 (patch)
tree0311cc7cfbc87700fa709a19a13a510f7430cb65 /src
parentde7601f149a5fedc1f3f62c62ba94b9d0e3d2069 (diff)
downloademacs-6da3a6dc9e3e9ac3d7bb666410926ebc4a078505.tar.gz
emacs-6da3a6dc9e3e9ac3d7bb666410926ebc4a078505.zip
Port to strict C99 offsetof
* src/bidi.c (bidi_copy_it): * src/lisp.h (CHAR_TABLE_EXTRA_SLOTS): Use only a single identifier as the second argument of offsetof. Found by using clang -pedantic.
Diffstat (limited to 'src')
-rw-r--r--src/bidi.c2
-rw-r--r--src/lisp.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bidi.c b/src/bidi.c
index a68ffdb7e6d..c23ff954356 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -532,7 +532,7 @@ bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
532 /* Copy everything from the start through the active part of 532 /* Copy everything from the start through the active part of
533 the level stack. */ 533 the level stack. */
534 memcpy (to, from, 534 memcpy (to, from,
535 (offsetof (struct bidi_it, level_stack[1]) 535 (offsetof (struct bidi_it, level_stack) + sizeof from->level_stack[0]
536 + from->stack_idx * sizeof from->level_stack[0])); 536 + from->stack_idx * sizeof from->level_stack[0]));
537} 537}
538 538
diff --git a/src/lisp.h b/src/lisp.h
index 27588848c29..6a98adbda9c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1766,7 +1766,8 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct)
1766 1766
1767/* Make sure that sub char-table contents slot is where we think it is. */ 1767/* Make sure that sub char-table contents slot is where we think it is. */
1768verify (offsetof (struct Lisp_Sub_Char_Table, contents) 1768verify (offsetof (struct Lisp_Sub_Char_Table, contents)
1769 == offsetof (struct Lisp_Vector, contents[SUB_CHAR_TABLE_OFFSET])); 1769 == (offsetof (struct Lisp_Vector, contents)
1770 + SUB_CHAR_TABLE_OFFSET * sizeof (Lisp_Object)));
1770 1771
1771/*********************************************************************** 1772/***********************************************************************
1772 Symbols 1773 Symbols