summaryrefslogtreecommitdiff
path: root/src/spell.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-17 20:37:43 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-17 20:37:43 +0200
commit840268400dc8fda62a14f8a084e8b1ea46619454 (patch)
treeb0e1ff5ffdb4a9cf5862d41f6a1f3e11f27f3ff1 /src/spell.c
parente87e6dddc2b2a99572ec0db0833c052214c4fbd3 (diff)
downloadvim-git-840268400dc8fda62a14f8a084e8b1ea46619454.tar.gz
patch 7.4.2062v7.4.2062
Problem: Using dummy variable to compute struct member offset. Solution: Use offsetof().
Diffstat (limited to 'src/spell.c')
-rw-r--r--src/spell.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/spell.c b/src/spell.c
index af9689107..f6ab0dffb 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -600,8 +600,7 @@ typedef struct wordcount_S
char_u wc_word[1]; /* word, actually longer */
} wordcount_T;
-static wordcount_T dumwc;
-#define WC_KEY_OFF (unsigned)(dumwc.wc_word - (char_u *)&dumwc)
+#define WC_KEY_OFF offsetof(wordcount_T, wc_word)
#define HI2WC(hi) ((wordcount_T *)((hi)->hi_key - WC_KEY_OFF))
#define MAXWORDCOUNT 0xffff