Hi Bram, 2016/7/18 Mon 3:38:34 UTC+9 Bram Moolenaar wrote: > Patch 7.4.2062 > Problem: Using dummy variable to compute struct member offset. > Solution: Use offsetof(). > Files: src/globals.h, src/macros.h, src/vim.h, src/spell.c
I found one more dummy variable. Please check the attached patch. Regards, Ken Takata -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
# HG changeset patch # Parent 5cd519b5506b5e18068ac9942aba1e1608a48380 diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -59,9 +59,8 @@ struct ufunc #define FC_DICT 4 /* Dict function, uses "self" */ /* From user function to hashitem and back. */ -static ufunc_T dumuf; #define UF2HIKEY(fp) ((fp)->uf_name) -#define HIKEY2UF(p) ((ufunc_T *)(p - (dumuf.uf_name - (char_u *)&dumuf))) +#define HIKEY2UF(p) ((ufunc_T *)(p - offsetof(ufunc_T, uf_name))) #define HI2UF(hi) HIKEY2UF((hi)->hi_key) #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j]
