Skip to content

Commit 429b0fd

Browse files
committed
style: clang-format (with version 11)
1 parent fd3f27b commit 429b0fd

File tree

16 files changed

+91
-102
lines changed

16 files changed

+91
-102
lines changed

src/buffer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,7 @@ void set_curbuf(buf_T *buf, int action)
15051505
if (prevbuf == curbuf)
15061506
u_sync(FALSE);
15071507
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
1508-
unload ? action : (action == DOBUF_GOTO && !buf_hide(prevbuf) && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD
1509-
: 0,
1508+
unload ? action : (action == DOBUF_GOTO && !buf_hide(prevbuf) && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0,
15101509
FALSE);
15111510
if (curwin != previouswin && win_valid(previouswin))
15121511
/* autocommands changed curwin, Grr! */

src/channel.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,8 +4217,7 @@ void free_job_options(jobopt_T *opt)
42174217
static int
42184218
part_from_char(int c)
42194219
{
4220-
return c == 'i' ? PART_IN : c == 'o' ? PART_OUT
4221-
: PART_ERR;
4220+
return c == 'i' ? PART_IN : c == 'o' ? PART_OUT : PART_ERR;
42224221
}
42234222

42244223
/*

src/edit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4761,8 +4761,8 @@ static void ins_insert(int replaceState)
47614761
set_vim_var_string(VV_INSERTMODE,
47624762
(char_u *)((State & REPLACE_FLAG)
47634763
? "i"
4764-
: replaceState == VREPLACE ? "v"
4765-
: "r"),
4764+
: replaceState == VREPLACE ? "v"
4765+
: "r"),
47664766
1);
47674767
#endif
47684768
ins_apply_autocmds(EVENT_INSERTCHANGE);

src/eval.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6955,9 +6955,9 @@ set_cmdarg(exarg_T *eap, char_u *oldarg)
69556955

69566956
if (eap->force_ff != 0)
69576957
sprintf((char *)newval + STRLEN(newval), " ++ff=%s",
6958-
eap->force_ff == 'u' ? "unix"
6959-
: eap->force_ff == 'd' ? "dos"
6960-
: "mac");
6958+
eap->force_ff == 'u' ? "unix"
6959+
: eap->force_ff == 'd' ? "dos"
6960+
: "mac");
69616961
if (eap->force_enc != 0)
69626962
sprintf((char *)newval + STRLEN(newval), " ++enc=%s",
69636963
eap->cmd + eap->force_enc);
@@ -7478,9 +7478,9 @@ tv_get_string_buf_chk(typval_T *varp, char_u *buf)
74787478

74797479
if (job == NULL)
74807480
return (char_u *)"no process";
7481-
status = job->jv_status == JOB_FAILED ? "fail"
7482-
: job->jv_status >= JOB_ENDED ? "dead"
7483-
: "run";
7481+
status = job->jv_status == JOB_FAILED ? "fail"
7482+
: job->jv_status >= JOB_ENDED ? "dead"
7483+
: "run";
74847484
#ifdef UNIX
74857485
vim_snprintf((char *)buf, NUMBUFLEN,
74867486
"process %ld %s", (long)job->jv_pid, status);
@@ -8071,17 +8071,17 @@ int var_check_lock(int lock, char_u *name, int use_gettext)
80718071
if (lock & VAR_LOCKED)
80728072
{
80738073
semsg(_("E741: Value is locked: %s"),
8074-
name == NULL ? (char_u *)_("Unknown")
8075-
: use_gettext ? (char_u *)_(name)
8076-
: name);
8074+
name == NULL ? (char_u *)_("Unknown")
8075+
: use_gettext ? (char_u *)_(name)
8076+
: name);
80778077
return TRUE;
80788078
}
80798079
if (lock & VAR_FIXED)
80808080
{
80818081
semsg(_("E742: Cannot change value of %s"),
8082-
name == NULL ? (char_u *)_("Unknown")
8083-
: use_gettext ? (char_u *)_(name)
8084-
: name);
8082+
name == NULL ? (char_u *)_("Unknown")
8083+
: use_gettext ? (char_u *)_(name)
8084+
: name);
80858085
return TRUE;
80868086
}
80878087
return FALSE;

src/evalfunc.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8717,13 +8717,13 @@ f_readfile(typval_T *argvars, typval_T *rettv)
87178717
{
87188718
/* Find the two bytes before the 0xbf. If p is at buf, or buf
87198719
* + 1, these may be in the "prev" string. */
8720-
char_u back1 = p >= buf + 1 ? p[-1]
8721-
: prevlen >= 1 ? prev[prevlen - 1]
8722-
: NUL;
8723-
char_u back2 = p >= buf + 2 ? p[-2]
8724-
: p == buf + 1 && prevlen >= 1 ? prev[prevlen - 1]
8725-
: prevlen >= 2 ? prev[prevlen - 2]
8726-
: NUL;
8720+
char_u back1 = p >= buf + 1 ? p[-1]
8721+
: prevlen >= 1 ? prev[prevlen - 1]
8722+
: NUL;
8723+
char_u back2 = p >= buf + 2 ? p[-2]
8724+
: p == buf + 1 && prevlen >= 1 ? prev[prevlen - 1]
8725+
: prevlen >= 2 ? prev[prevlen - 2]
8726+
: NUL;
87278727

87288728
if (back2 == 0xef && back1 == 0xbb)
87298729
{
@@ -11328,8 +11328,7 @@ item_compare(const void *s1, const void *s2)
1132811328
varnumber_T v1 = tv_get_number(tv1);
1132911329
varnumber_T v2 = tv_get_number(tv2);
1133011330

11331-
return v1 == v2 ? 0 : v1 > v2 ? 1
11332-
: -1;
11331+
return v1 == v2 ? 0 : v1 > v2 ? 1 : -1;
1133311332
}
1133411333

1133511334
#ifdef FEAT_FLOAT
@@ -11338,8 +11337,7 @@ item_compare(const void *s1, const void *s2)
1133811337
float_T v1 = tv_get_float(tv1);
1133911338
float_T v2 = tv_get_float(tv2);
1134011339

11341-
return v1 == v2 ? 0 : v1 > v2 ? 1
11342-
: -1;
11340+
return v1 == v2 ? 0 : v1 > v2 ? 1 : -1;
1134311341
}
1134411342
#endif
1134511343

@@ -11380,8 +11378,7 @@ item_compare(const void *s1, const void *s2)
1138011378
double n1, n2;
1138111379
n1 = strtod((char *)p1, (char **)&p1);
1138211380
n2 = strtod((char *)p2, (char **)&p2);
11383-
res = n1 == n2 ? 0 : n1 > n2 ? 1
11384-
: -1;
11381+
res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1;
1138511382
}
1138611383

1138711384
/* When the result would be zero, compare the item indexes. Makes the
@@ -11684,10 +11681,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
1168411681
return;
1168511682

1168611683
list_append_string(rettv->vval.v_list, word, len);
11687-
list_append_string(rettv->vval.v_list, (char_u *)(attr == HLF_SPB ? "bad" : attr == HLF_SPR ? "rare"
11688-
: attr == HLF_SPL ? "local"
11689-
: attr == HLF_SPC ? "caps"
11690-
: ""),
11684+
list_append_string(rettv->vval.v_list, (char_u *)(attr == HLF_SPB ? "bad" : attr == HLF_SPR ? "rare" : attr == HLF_SPL ? "local" : attr == HLF_SPC ? "caps" : ""),
1169111685
-1);
1169211686
}
1169311687

src/ex_cmds.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,15 @@ sort_compare(const void *s1, const void *s2)
333333
if (l1.st_u.num.is_number != l2.st_u.num.is_number)
334334
result = l1.st_u.num.is_number - l2.st_u.num.is_number;
335335
else
336-
result = l1.st_u.num.value == l2.st_u.num.value ? 0
337-
: l1.st_u.num.value > l2.st_u.num.value ? 1
338-
: -1;
336+
result = l1.st_u.num.value == l2.st_u.num.value ? 0
337+
: l1.st_u.num.value > l2.st_u.num.value ? 1
338+
: -1;
339339
}
340340
#ifdef FEAT_FLOAT
341341
else if (sort_flt)
342-
result = l1.st_u.value_flt == l2.st_u.value_flt ? 0
343-
: l1.st_u.value_flt > l2.st_u.value_flt ? 1
344-
: -1;
342+
result = l1.st_u.value_flt == l2.st_u.value_flt ? 0
343+
: l1.st_u.value_flt > l2.st_u.value_flt ? 1
344+
: -1;
345345
#endif
346346
else
347347
{

src/ex_cmds2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,9 +2636,9 @@ void ex_options(
26362636
exarg_T *eap UNUSED)
26372637
{
26382638
vim_setenv((char_u *)"OPTWIN_CMD",
2639-
(char_u *)(cmdmod.tab ? "tab"
2640-
: (cmdmod.split & WSP_VERT) ? "vert"
2641-
: ""));
2639+
(char_u *)(cmdmod.tab ? "tab"
2640+
: (cmdmod.split & WSP_VERT) ? "vert"
2641+
: ""));
26422642
cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
26432643
}
26442644
#endif

src/ex_docmd.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5287,9 +5287,9 @@ ex_bunload(exarg_T *eap)
52875287
if (NOT_IN_POPUP_WINDOW)
52885288
return;
52895289
eap->errmsg = do_bufdel(
5290-
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
5291-
: eap->cmdidx == CMD_bwipeout ? DOBUF_WIPE
5292-
: DOBUF_UNLOAD,
5290+
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
5291+
: eap->cmdidx == CMD_bwipeout ? DOBUF_WIPE
5292+
: DOBUF_UNLOAD,
52935293
eap->arg,
52945294
eap->addr_count, (int)eap->line1, (int)eap->line2, eap->forceit);
52955295
}
@@ -6459,8 +6459,8 @@ void alist_add(
64596459
[al->al_ga.ga_len].ae_fname = fname;
64606460
if (set_fnum > 0)
64616461
AARGLIST(al)
6462-
[al->al_ga.ga_len].ae_fnum =
6463-
buflist_add(fname, BLN_LISTED | (set_fnum == 2 ? BLN_CURBUF : 0));
6462+
[al->al_ga.ga_len].ae_fnum =
6463+
buflist_add(fname, BLN_LISTED | (set_fnum == 2 ? BLN_CURBUF : 0));
64646464
++al->al_ga.ga_len;
64656465
}
64666466

@@ -6642,9 +6642,9 @@ void ex_splitview(exarg_T *eap)
66426642
*/
66436643
if (use_tab)
66446644
{
6645-
if (win_new_tabpage(cmdmod.tab != 0 ? cmdmod.tab
6646-
: eap->addr_count == 0 ? 0
6647-
: (int)eap->line2 + 1) != FAIL)
6645+
if (win_new_tabpage(cmdmod.tab != 0 ? cmdmod.tab
6646+
: eap->addr_count == 0 ? 0
6647+
: (int)eap->line2 + 1) != FAIL)
66486648
{
66496649
do_exedit(eap, old_curwin);
66506650

@@ -8088,8 +8088,7 @@ void ex_redraw(exarg_T *eap)
80888088
p_lz = FALSE;
80898089
validate_cursor();
80908090
update_topline();
8091-
update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED
8092-
: 0);
8091+
update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED : 0);
80938092
RedrawingDisabled = r;
80948093
p_lz = p;
80958094

@@ -8205,8 +8204,7 @@ ex_mkrc(
82058204
{
82068205
browseFile = do_browse(BROWSE_SAVE,
82078206
#ifdef FEAT_SESSION
8208-
eap->cmdidx == CMD_mkview ? (char_u *)_("Save View") : eap->cmdidx == CMD_mksession ? (char_u *)_("Save Session")
8209-
:
8207+
eap->cmdidx == CMD_mkview ? (char_u *)_("Save View") : eap->cmdidx == CMD_mksession ? (char_u *)_("Save Session") :
82108208
#endif
82118209
(char_u *)_("Save Setup"),
82128210
fname, (char_u *)"vim", NULL,
@@ -8941,9 +8939,9 @@ eval_vars(
89418939
if (spec_idx == SPEC_CWORD || spec_idx == SPEC_CCWORD || spec_idx == SPEC_CEXPR)
89428940
{
89438941
resultlen = find_ident_under_cursor(&result,
8944-
spec_idx == SPEC_CWORD ? (FIND_IDENT | FIND_STRING)
8945-
: spec_idx == SPEC_CEXPR ? (FIND_IDENT | FIND_STRING | FIND_EVAL)
8946-
: FIND_STRING);
8942+
spec_idx == SPEC_CWORD ? (FIND_IDENT | FIND_STRING)
8943+
: spec_idx == SPEC_CEXPR ? (FIND_IDENT | FIND_STRING | FIND_EVAL)
8944+
: FIND_STRING);
89478945
if (resultlen == 0)
89488946
{
89498947
*errormsg = "";

src/ex_eval.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,8 +1819,7 @@ void ex_endtry(exarg_T *eap)
18191819
if (!skip)
18201820
{
18211821
report_resume_pending(pending,
1822-
(pending == CSTP_RETURN) ? rettv : (pending & CSTP_THROW) ? (void *)current_exception
1823-
: NULL);
1822+
(pending == CSTP_RETURN) ? rettv : (pending & CSTP_THROW) ? (void *)current_exception : NULL);
18241823
switch (pending)
18251824
{
18261825
case CSTP_NONE:

src/fileio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,9 @@ int readfile(
554554
(errno == EFBIG) ? _("[File too big]") :
555555
#endif
556556
#ifdef EOVERFLOW
557-
(errno == EOVERFLOW) ? _("[File too big]")
558-
:
557+
(errno == EOVERFLOW) ? _("[File too big]") :
559558
#endif
560-
_("[Permission Denied]")),
559+
_("[Permission Denied]")),
561560
0);
562561
curbuf->b_p_ro = TRUE; /* must use "w!" now */
563562
}
@@ -3304,7 +3303,8 @@ int buf_write(
33043303
* second. */
33053304
{
33063305
int
3307-
try;
3306+
try
3307+
;
33083308

33093309
for (try = 0; try < 10; ++try)
33103310
{

0 commit comments

Comments
 (0)