Skip to content

Commit abab0b0

Browse files
committed
patch 8.1.1086: too many curly braces
Problem: Too many curly braces. Solution: Remove curly braces where they are not needed. (Hirohito Higashi, closes #3982)
1 parent bd9bf26 commit abab0b0

42 files changed

Lines changed: 26 additions & 189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/autocmd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,7 @@ au_del_group(char_u *name)
517517
}
518518
vim_free(AUGROUP_NAME(i));
519519
if (in_use)
520-
{
521520
AUGROUP_NAME(i) = get_deleted_augroup();
522-
}
523521
else
524522
AUGROUP_NAME(i) = NULL;
525523
}

src/buffer.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,9 +1595,7 @@ do_buffer(
15951595
set_curbuf(buf, action);
15961596

15971597
if (action == DOBUF_SPLIT)
1598-
{
15991598
RESET_BINDING(curwin); /* reset 'scrollbind' and 'cursorbind' */
1600-
}
16011599

16021600
#if defined(FEAT_EVAL)
16031601
if (aborting()) /* autocmds may abort script processing */
@@ -3054,9 +3052,8 @@ buflist_list(exarg_T *eap)
30543052
/* put "line 999" in column 40 or after the file name */
30553053
i = 40 - vim_strsize(IObuff);
30563054
do
3057-
{
30583055
IObuff[len++] = ' ';
3059-
} while (--i > 0 && len < IOSIZE - 18);
3056+
while (--i > 0 && len < IOSIZE - 18);
30603057
vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - len),
30613058
_("line %ld"), buf == curbuf ? curwin->w_cursor.lnum
30623059
: (long)buflist_findlnum(buf));

src/crypt_zip.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ make_crc_tab(void)
6868
/*
6969
* Update the encryption keys with the next byte of plain text.
7070
*/
71-
#define UPDATE_KEYS_ZIP(keys, c) { \
71+
#define UPDATE_KEYS_ZIP(keys, c) do { \
7272
keys[0] = CRC32(keys[0], (c)); \
7373
keys[1] += keys[0] & 0xff; \
7474
keys[1] = keys[1] * 134775813L + 1; \
7575
keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
76-
}
76+
} while (0)
7777

7878
/*
7979
* Initialize for encryption/decryption.
@@ -98,9 +98,7 @@ crypt_zip_init(
9898
zs->keys[1] = 591751049L;
9999
zs->keys[2] = 878082192L;
100100
for (p = key; *p != NUL; ++p)
101-
{
102101
UPDATE_KEYS_ZIP(zs->keys, (int)*p);
103-
}
104102
}
105103

106104
/*

src/dosinst.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ install_bat_choice(int idx)
849849
* for MSDOS and NT.
850850
* The order of preference is:
851851
* 1. $VIMRUNTIME/vim.exe (user preference)
852-
* 2. $VIM/vim70/vim.exe (hard coded version)
852+
* 2. $VIM/vim81/vim.exe (hard coded version)
853853
* 3. installdir/vim.exe (hard coded install directory)
854854
*/
855855
fprintf(fd, "set VIM_EXE_DIR=%s\n", installdir);
@@ -1568,9 +1568,7 @@ register_openwith(
15681568

15691569
for (i = 0; ERROR_SUCCESS == lRet
15701570
&& i < sizeof(openwith) / sizeof(openwith[0]); i++)
1571-
{
15721571
lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag);
1573-
}
15741572
}
15751573

15761574
return lRet;

src/edit.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5363,9 +5363,8 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
53635363
if (end == NULL && vpeekc() == NUL)
53645364
break;
53655365
do
5366-
{
53675366
c = vgetc();
5368-
} while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
5367+
while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
53695368
if (c == NUL || got_int)
53705369
// When CTRL-C was encountered the typeahead will be flushed and we
53715370
// won't get the end sequence.

src/evalfunc.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,9 +3568,7 @@ f_expand(typval_T *argvars, typval_T *rettv)
35683568
&& argvars[2].v_type != VAR_UNKNOWN
35693569
&& tv_get_number_chk(&argvars[2], &error)
35703570
&& !error)
3571-
{
35723571
rettv_list_set(rettv, NULL);
3573-
}
35743572

35753573
s = tv_get_string(&argvars[0]);
35763574
if (*s == '%' || *s == '#' || *s == '<')
@@ -6081,9 +6079,7 @@ f_glob(typval_T *argvars, typval_T *rettv)
60816079
if (argvars[2].v_type != VAR_UNKNOWN)
60826080
{
60836081
if (tv_get_number_chk(&argvars[2], &error))
6084-
{
60856082
rettv_list_set(rettv, NULL);
6086-
}
60876083
if (argvars[3].v_type != VAR_UNKNOWN
60886084
&& tv_get_number_chk(&argvars[3], &error))
60896085
options |= WILD_ALLLINKS;
@@ -6137,9 +6133,7 @@ f_globpath(typval_T *argvars, typval_T *rettv)
61376133
if (argvars[3].v_type != VAR_UNKNOWN)
61386134
{
61396135
if (tv_get_number_chk(&argvars[3], &error))
6140-
{
61416136
rettv_list_set(rettv, NULL);
6142-
}
61436137
if (argvars[4].v_type != VAR_UNKNOWN
61446138
&& tv_get_number_chk(&argvars[4], &error))
61456139
flags |= WILD_ALLLINKS;

src/ex_cmds.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3361,9 +3361,7 @@ do_write(exarg_T *eap)
33613361
/* Change directories when the 'acd' option is set and the file name
33623362
* got changed or set. */
33633363
if (eap->cmdidx == CMD_saveas || name_was_missing)
3364-
{
33653364
DO_AUTOCHDIR;
3366-
}
33673365
}
33683366

33693367
theend:

src/ex_docmd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8407,9 +8407,7 @@ ex_splitview(exarg_T *eap)
84078407
|| cmdmod.browse
84088408
# endif
84098409
)
8410-
{
84118410
RESET_BINDING(curwin);
8412-
}
84138411
else
84148412
do_check_scrollbind(FALSE);
84158413
do_exedit(eap, old_curwin);

src/ex_getln.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,9 +1029,8 @@ getcmdline_int(
10291029
/* Get a character. Ignore K_IGNORE and K_NOP, they should not do
10301030
* anything, such as stop completion. */
10311031
do
1032-
{
10331032
c = safe_vgetc();
1034-
} while (c == K_IGNORE || c == K_NOP);
1033+
while (c == K_IGNORE || c == K_NOP);
10351034

10361035
if (KeyTyped)
10371036
{
@@ -2833,9 +2832,8 @@ getexmodeline(
28332832
if (*p == TAB)
28342833
{
28352834
do
2836-
{
28372835
msg_putchar(' ');
2838-
} while (++vcol % 8);
2836+
while (++vcol % 8);
28392837
++p;
28402838
}
28412839
else
@@ -2908,9 +2906,8 @@ getexmodeline(
29082906
{
29092907
/* Don't use chartabsize(), 'ts' can be different */
29102908
do
2911-
{
29122909
msg_putchar(' ');
2913-
} while (++vcol % 8);
2910+
while (++vcol % 8);
29142911
}
29152912
else
29162913
{

src/getchar.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,9 +1813,8 @@ plain_vgetc(void)
18131813
int c;
18141814

18151815
do
1816-
{
18171816
c = safe_vgetc();
1818-
} while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
1817+
while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
18191818

18201819
if (c == K_PS)
18211820
/* Only handle the first pasted character. Drop the rest, since we

0 commit comments

Comments
 (0)