Mercurial > vim
comparison src/gui_w32.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 | 3ff714d765ba |
children | 8590a462ad46 |
comparison
equal
deleted
inserted
replaced
20006:aee3c9266968 | 20007:aadd1cae2ff5 |
---|---|
3502 } | 3502 } |
3503 | 3503 |
3504 // Convert the filter to Windows format. | 3504 // Convert the filter to Windows format. |
3505 filterp = convert_filterW(filter); | 3505 filterp = convert_filterW(filter); |
3506 | 3506 |
3507 vim_memset(&fileStruct, 0, sizeof(OPENFILENAMEW)); | 3507 CLEAR_FIELD(fileStruct); |
3508 # ifdef OPENFILENAME_SIZE_VERSION_400W | 3508 # ifdef OPENFILENAME_SIZE_VERSION_400W |
3509 // be compatible with Windows NT 4.0 | 3509 // be compatible with Windows NT 4.0 |
3510 fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W; | 3510 fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W; |
3511 # else | 3511 # else |
3512 fileStruct.lStructSize = sizeof(fileStruct); | 3512 fileStruct.lStructSize = sizeof(fileStruct); |
4265 oparg_T oa; | 4265 oparg_T oa; |
4266 | 4266 |
4267 // Mouse hovers over popup window, scroll it if possible. | 4267 // Mouse hovers over popup window, scroll it if possible. |
4268 mouse_row = wp->w_winrow; | 4268 mouse_row = wp->w_winrow; |
4269 mouse_col = wp->w_wincol; | 4269 mouse_col = wp->w_wincol; |
4270 vim_memset(&cap, 0, sizeof(cap)); | 4270 CLEAR_FIELD(cap); |
4271 cap.arg = zDelta < 0 ? MSCR_UP : MSCR_DOWN; | 4271 cap.arg = zDelta < 0 ? MSCR_UP : MSCR_DOWN; |
4272 cap.cmdchar = zDelta < 0 ? K_MOUSEUP : K_MOUSEDOWN; | 4272 cap.cmdchar = zDelta < 0 ? K_MOUSEUP : K_MOUSEDOWN; |
4273 clear_oparg(&oa); | 4273 clear_oparg(&oa); |
4274 cap.oap = &oa; | 4274 cap.oap = &oa; |
4275 nv_mousescroll(&cap); | 4275 nv_mousescroll(&cap); |
6476 # ifdef FEAT_TOOLBAR | 6476 # ifdef FEAT_TOOLBAR |
6477 if (menu_is_toolbar(parent->name)) | 6477 if (menu_is_toolbar(parent->name)) |
6478 { | 6478 { |
6479 TBBUTTON newtb; | 6479 TBBUTTON newtb; |
6480 | 6480 |
6481 vim_memset(&newtb, 0, sizeof(newtb)); | 6481 CLEAR_FIELD(newtb); |
6482 if (menu_is_separator(menu->name)) | 6482 if (menu_is_separator(menu->name)) |
6483 { | 6483 { |
6484 newtb.iBitmap = 0; | 6484 newtb.iBitmap = 0; |
6485 newtb.fsStyle = TBSTYLE_SEP; | 6485 newtb.fsStyle = TBSTYLE_SEP; |
6486 } | 6486 } |