Mercurial > vim
comparison src/normal.c @ 20007:aadd1cae2ff5 v8.2.0559
patch 8.2.0559: clearing a struct is verbose
Commit: https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 12 19:37:17 2020 +0200
patch 8.2.0559: clearing a struct is verbose
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Apr 2020 19:45:05 +0200 |
parents | e21c22c58e2b |
children | b790d00d5ccb |
comparison
equal
deleted
inserted
replaced
20006:aee3c9266968 | 20007:aadd1cae2ff5 |
---|---|
498 int idx; | 498 int idx; |
499 #ifdef FEAT_EVAL | 499 #ifdef FEAT_EVAL |
500 int set_prevcount = FALSE; | 500 int set_prevcount = FALSE; |
501 #endif | 501 #endif |
502 | 502 |
503 vim_memset(&ca, 0, sizeof(ca)); // also resets ca.retval | 503 CLEAR_FIELD(ca); // also resets ca.retval |
504 ca.oap = oap; | 504 ca.oap = oap; |
505 | 505 |
506 // Use a count remembered from before entering an operator. After typing | 506 // Use a count remembered from before entering an operator. After typing |
507 // "3d" we return from normal_cmd() and come back here, the "3" is | 507 // "3d" we return from normal_cmd() and come back here, the "3" is |
508 // remembered in "opcount". | 508 // remembered in "opcount". |
3478 { | 3478 { |
3479 oparg_T oa; | 3479 oparg_T oa; |
3480 cmdarg_T ca; | 3480 cmdarg_T ca; |
3481 | 3481 |
3482 clear_oparg(&oa); | 3482 clear_oparg(&oa); |
3483 vim_memset(&ca, 0, sizeof(ca)); | 3483 CLEAR_FIELD(ca); |
3484 ca.oap = &oa; | 3484 ca.oap = &oa; |
3485 ca.cmdchar = c1; | 3485 ca.cmdchar = c1; |
3486 ca.nchar = c2; | 3486 ca.nchar = c2; |
3487 nv_ident(&ca); | 3487 nv_ident(&ca); |
3488 } | 3488 } |
4306 cap->oap->motion_type = MCHAR; | 4306 cap->oap->motion_type = MCHAR; |
4307 cap->oap->inclusive = FALSE; | 4307 cap->oap->inclusive = FALSE; |
4308 cap->oap->use_reg_one = TRUE; | 4308 cap->oap->use_reg_one = TRUE; |
4309 curwin->w_set_curswant = TRUE; | 4309 curwin->w_set_curswant = TRUE; |
4310 | 4310 |
4311 vim_memset(&sia, 0, sizeof(sia)); | 4311 CLEAR_FIELD(sia); |
4312 i = do_search(cap->oap, dir, dir, pat, cap->count1, | 4312 i = do_search(cap->oap, dir, dir, pat, cap->count1, |
4313 opt | SEARCH_OPT | SEARCH_ECHO | SEARCH_MSG, &sia); | 4313 opt | SEARCH_OPT | SEARCH_ECHO | SEARCH_MSG, &sia); |
4314 if (wrapped != NULL) | 4314 if (wrapped != NULL) |
4315 *wrapped = sia.sa_wrapped; | 4315 *wrapped = sia.sa_wrapped; |
4316 if (i == 0) | 4316 if (i == 0) |