diff options
| author | Bram Moolenaar <Bram@vim.org> | 2020-04-12 19:37:17 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2020-04-12 19:37:17 +0200 |
| commit | a80faa8930ed5a554beeb2727762538873135e83 (patch) | |
| tree | e797605e0c781214543fcba103cffede7af611cd /src/vim9execute.c | |
| parent | 82de464f763d6e6d89229be03ce7c6d02fd5fb59 (diff) | |
| download | vim-git-a80faa8930ed5a554beeb2727762538873135e83.tar.gz | |
patch 8.2.0559: clearing a struct is verbosev8.2.0559
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
Diffstat (limited to 'src/vim9execute.c')
| -rw-r--r-- | src/vim9execute.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index a7850d125..f8fb061f8 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -358,7 +358,7 @@ call_ufunc(ufunc_T *ufunc, int argcount, ectx_T *ectx, isn_T *iptr) if (call_prepare(argcount, argvars, ectx) == FAIL) return FAIL; - vim_memset(&funcexe, 0, sizeof(funcexe)); + CLEAR_FIELD(funcexe); funcexe.evaluate = TRUE; // Call the user function. Result goes in last position on the stack. @@ -498,7 +498,7 @@ call_def_function( // Get pointer to a local variable on the stack. Negative for arguments. #define STACK_TV_VAR(idx) (((typval_T *)ectx.ec_stack.ga_data) + ectx.ec_frame + STACK_FRAME_SIZE + idx) - vim_memset(&ectx, 0, sizeof(ectx)); + CLEAR_FIELD(ectx); ga_init2(&ectx.ec_stack, sizeof(typval_T), 500); if (ga_grow(&ectx.ec_stack, 20) == FAIL) return FAIL; |
