comparison src/userfunc.c @ 9593:8dced5ab4615 v7.4.2074

commit https://github.com/vim/vim/commit/0a0f641b9841189ba4180758109d04d0a26e50e3 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 19 21:30:13 2016 +0200 patch 7.4.2074 Problem: One more place using a dummy variable. Solution: Use offsetof(). (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Jul 2016 21:45:06 +0200
parents 86af4a48c00a
children 3ca0fd9709b1
comparison
equal deleted inserted replaced
9592:3e42d947b5ad 9593:8dced5ab4615
56 #define FC_ABORT 1 /* abort function on error */ 56 #define FC_ABORT 1 /* abort function on error */
57 #define FC_RANGE 2 /* function accepts range */ 57 #define FC_RANGE 2 /* function accepts range */
58 #define FC_DICT 4 /* Dict function, uses "self" */ 58 #define FC_DICT 4 /* Dict function, uses "self" */
59 59
60 /* From user function to hashitem and back. */ 60 /* From user function to hashitem and back. */
61 static ufunc_T dumuf;
62 #define UF2HIKEY(fp) ((fp)->uf_name) 61 #define UF2HIKEY(fp) ((fp)->uf_name)
63 #define HIKEY2UF(p) ((ufunc_T *)(p - (dumuf.uf_name - (char_u *)&dumuf))) 62 #define HIKEY2UF(p) ((ufunc_T *)(p - offsetof(ufunc_T, uf_name)))
64 #define HI2UF(hi) HIKEY2UF((hi)->hi_key) 63 #define HI2UF(hi) HIKEY2UF((hi)->hi_key)
65 64
66 #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j] 65 #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j]
67 #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] 66 #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j]
68 67