refactor(uncrustify): change rules to better align with the style guide

Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
This commit is contained in:
Dundar Goc
2022-04-29 13:53:42 +02:00
parent 0b3ae64480
commit eef8de4df0
91 changed files with 583 additions and 682 deletions

View File

@@ -619,10 +619,10 @@ static int color_numbers_256[28] = { 0, 4, 2, 6,
static int color_numbers_8[28] = { 0, 4, 2, 6,
1, 5, 3, 3,
7, 7, 7, 7,
0+8, 0+8,
4+8, 4+8, 2+8, 2+8,
6+8, 6+8, 1+8, 1+8, 5+8,
5+8, 3+8, 3+8, 7+8, -1 };
0 + 8, 0 + 8,
4 + 8, 4 + 8, 2 + 8, 2 + 8,
6 + 8, 6 + 8, 1 + 8, 1 + 8, 5 + 8,
5 + 8, 3 + 8, 3 + 8, 7 + 8, -1 };
// Lookup the "cterm" value to be used for color with index "idx" in
// color_names[].
@@ -964,7 +964,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
if (strcmp(key, "NONE") == 0) {
if (!init || HL_TABLE()[idx].sg_set == 0) {
if (!init) {
HL_TABLE()[idx].sg_set |= SG_CTERM+SG_GUI;
HL_TABLE()[idx].sg_set |= SG_CTERM + SG_GUI;
}
highlight_clear(idx);
}
@@ -1385,7 +1385,7 @@ static void highlight_list_one(const int id)
0, sgp->sg_rgb_sp_name, "guisp");
didh = highlight_list_arg(id, didh, LIST_INT,
sgp->sg_blend+1, NULL, "blend");
sgp->sg_blend + 1, NULL, "blend");
if (sgp->sg_link && !got_int) {
(void)syn_list_header(didh, 0, id, true);
@@ -1643,10 +1643,10 @@ static void set_hl_attr(int idx)
at_en.rgb_sp_color = sgp->sg_rgb_sp_name ? sgp->sg_rgb_sp : -1;
at_en.hl_blend = sgp->sg_blend;
sgp->sg_attr = hl_get_syn_attr(0, idx+1, at_en);
sgp->sg_attr = hl_get_syn_attr(0, idx + 1, at_en);
// a cursor style uses this syn_id, make sure its attribute is updated.
if (cursor_mode_uses_syn_id(idx+1)) {
if (cursor_mode_uses_syn_id(idx + 1)) {
ui_mode_info_set();
}
}
@@ -2787,7 +2787,7 @@ int name_to_ctermcolor(const char *name)
int off = TOUPPER_ASC(*name);
for (i = ARRAY_SIZE(color_names); --i >= 0;) {
if (off == color_names[i][0]
&& STRICMP(name+1, color_names[i]+1) == 0) {
&& STRICMP(name + 1, color_names[i] + 1) == 0) {
break;
}
}