refactor: format with uncrustify #15872

* refactor: format with uncrustify
* refactor: fix function parameter comments
This commit is contained in:
dundargoc 2021-10-02 23:41:50 +02:00 committed by GitHub
parent 09307e64df
commit 8c74c895b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1243 additions and 1168 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,14 +2,14 @@
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include <assert.h> #include <assert.h>
#include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#include "nvim/assert.h" #include "nvim/assert.h"
#include "nvim/vim.h"
#include "nvim/ui.h"
#include "nvim/ugrid.h" #include "nvim/ugrid.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ugrid.c.generated.h" # include "ugrid.c.generated.h"
@ -79,8 +79,7 @@ void ugrid_scroll(UGrid *grid, int top, int bot, int left, int right, int count)
} }
} }
static void clear_region(UGrid *grid, int top, int bot, int left, int right, static void clear_region(UGrid *grid, int top, int bot, int left, int right, sattr_T attr)
sattr_T attr)
{ {
for (int row = top; row <= bot; row++) { for (int row = top; row <= bot; row++) {
UGRID_FOREACH_CELL(grid, row, left, right+1, { UGRID_FOREACH_CELL(grid, row, left, right+1, {

View File

@ -3,40 +3,40 @@
#include <assert.h> #include <assert.h>
#include <inttypes.h> #include <inttypes.h>
#include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "nvim/vim.h" #include "nvim/ascii.h"
#include "nvim/log.h"
#include "nvim/aucmd.h" #include "nvim/aucmd.h"
#include "nvim/ui.h"
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/cursor.h" #include "nvim/cursor.h"
#include "nvim/cursor_shape.h"
#include "nvim/diff.h" #include "nvim/diff.h"
#include "nvim/event/loop.h"
#include "nvim/ex_cmds2.h" #include "nvim/ex_cmds2.h"
#include "nvim/ex_getln.h" #include "nvim/ex_getln.h"
#include "nvim/fold.h" #include "nvim/fold.h"
#include "nvim/main.h"
#include "nvim/ascii.h"
#include "nvim/misc1.h"
#include "nvim/mbyte.h"
#include "nvim/garray.h" #include "nvim/garray.h"
#include "nvim/highlight.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/misc1.h"
#include "nvim/move.h" #include "nvim/move.h"
#include "nvim/normal.h" #include "nvim/normal.h"
#include "nvim/option.h" #include "nvim/option.h"
#include "nvim/os_unix.h"
#include "nvim/event/loop.h"
#include "nvim/os/time.h"
#include "nvim/os/input.h" #include "nvim/os/input.h"
#include "nvim/os/signal.h" #include "nvim/os/signal.h"
#include "nvim/os/time.h"
#include "nvim/os_unix.h"
#include "nvim/popupmnu.h" #include "nvim/popupmnu.h"
#include "nvim/screen.h" #include "nvim/screen.h"
#include "nvim/highlight.h" #include "nvim/ui.h"
#include "nvim/ui_compositor.h" #include "nvim/ui_compositor.h"
#include "nvim/vim.h"
#include "nvim/window.h" #include "nvim/window.h"
#include "nvim/cursor_shape.h"
#ifdef FEAT_TUI #ifdef FEAT_TUI
# include "nvim/tui/tui.h" # include "nvim/tui/tui.h"
#else #else
@ -382,8 +382,8 @@ void ui_set_ext_option(UI *ui, UIExtension ext, bool active)
} }
} }
void ui_line(ScreenGrid *grid, int row, int startcol, int endcol, int clearcol, void ui_line(ScreenGrid *grid, int row, int startcol, int endcol, int clearcol, int clearattr,
int clearattr, bool wrap) bool wrap)
{ {
assert(0 <= row && row < grid->Rows); assert(0 <= row && row < grid->Rows);
LineFlags flags = wrap ? kLineFlagWrap : 0; LineFlags flags = wrap ? kLineFlagWrap : 0;

View File

@ -5,18 +5,18 @@
// Used by the built-in TUI and libnvim-based UIs. // Used by the built-in TUI and libnvim-based UIs.
#include <assert.h> #include <assert.h>
#include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#include "nvim/api/private/helpers.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/main.h" #include "nvim/main.h"
#include "nvim/vim.h"
#include "nvim/ui.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/ui_bridge.h"
#include "nvim/ugrid.h" #include "nvim/ugrid.h"
#include "nvim/api/private/helpers.h" #include "nvim/ui.h"
#include "nvim/ui_bridge.h"
#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui_bridge.c.generated.h" # include "ui_bridge.c.generated.h"
@ -26,8 +26,7 @@
// Schedule a function call on the UI bridge thread. // Schedule a function call on the UI bridge thread.
#define UI_BRIDGE_CALL(ui, name, argc, ...) \ #define UI_BRIDGE_CALL(ui, name, argc, ...) \
((UIBridgeData *)ui)->scheduler( \ ((UIBridgeData *)ui)->scheduler(event_create(ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui))
event_create(ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui))
#define INT2PTR(i) ((void *)(intptr_t)i) #define INT2PTR(i) ((void *)(intptr_t)i)
#define PTR2INT(p) ((Integer)(intptr_t)p) #define PTR2INT(p) ((Integer)(intptr_t)p)
@ -138,8 +137,8 @@ static void ui_bridge_stop_event(void **argv)
ui->stop(ui); ui->stop(ui);
} }
static void ui_bridge_hl_attr_define(UI *ui, Integer id, HlAttrs attrs, static void ui_bridge_hl_attr_define(UI *ui, Integer id, HlAttrs attrs, HlAttrs cterm_attrs,
HlAttrs cterm_attrs, Array info) Array info)
{ {
HlAttrs *a = xmalloc(sizeof(HlAttrs)); HlAttrs *a = xmalloc(sizeof(HlAttrs));
*a = attrs; *a = attrs;
@ -163,11 +162,9 @@ static void ui_bridge_raw_line_event(void **argv)
xfree(argv[8]); xfree(argv[8]);
xfree(argv[9]); xfree(argv[9]);
} }
static void ui_bridge_raw_line(UI *ui, Integer grid, Integer row, static void ui_bridge_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Integer endcol,
Integer startcol, Integer endcol, Integer clearcol, Integer clearattr, LineFlags flags,
Integer clearcol, Integer clearattr, const schar_T *chunk, const sattr_T *attrs)
LineFlags flags, const schar_T *chunk,
const sattr_T *attrs)
{ {
size_t ncol = (size_t)(endcol-startcol); size_t ncol = (size_t)(endcol-startcol);
schar_T *c = xmemdup(chunk, ncol * sizeof(schar_T)); schar_T *c = xmemdup(chunk, ncol * sizeof(schar_T));

View File

@ -7,27 +7,27 @@
// Layer-based compositing: https://en.wikipedia.org/wiki/Digital_compositing // Layer-based compositing: https://en.wikipedia.org/wiki/Digital_compositing
#include <assert.h> #include <assert.h>
#include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <limits.h>
#include "nvim/api/private/helpers.h"
#include "nvim/ascii.h"
#include "nvim/highlight.h"
#include "nvim/lib/kvec.h" #include "nvim/lib/kvec.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/lua/executor.h"
#include "nvim/main.h" #include "nvim/main.h"
#include "nvim/ascii.h"
#include "nvim/vim.h"
#include "nvim/ui.h"
#include "nvim/highlight.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/message.h" #include "nvim/message.h"
#include "nvim/os/os.h"
#include "nvim/popupmnu.h" #include "nvim/popupmnu.h"
#include "nvim/ui_compositor.h"
#include "nvim/ugrid.h"
#include "nvim/screen.h" #include "nvim/screen.h"
#include "nvim/syntax.h" #include "nvim/syntax.h"
#include "nvim/api/private/helpers.h" #include "nvim/ugrid.h"
#include "nvim/lua/executor.h" #include "nvim/ui.h"
#include "nvim/os/os.h" #include "nvim/ui_compositor.h"
#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui_compositor.c.generated.h" # include "ui_compositor.c.generated.h"
@ -123,8 +123,8 @@ bool ui_comp_should_draw(void)
/// TODO(bfredl): later on the compositor should just use win_float_pos events, /// TODO(bfredl): later on the compositor should just use win_float_pos events,
/// though that will require slight event order adjustment: emit the win_pos /// though that will require slight event order adjustment: emit the win_pos
/// events in the beginning of update_screen(0), rather than in ui_flush() /// events in the beginning of update_screen(0), rather than in ui_flush()
bool ui_comp_put_grid(ScreenGrid *grid, int row, int col, int height, int width, bool ui_comp_put_grid(ScreenGrid *grid, int row, int col, int height, int width, bool valid,
bool valid, bool on_top) bool on_top)
{ {
bool moved; bool moved;
@ -257,8 +257,7 @@ static void ui_comp_raise_grid(ScreenGrid *grid, size_t new_index)
} }
} }
static void ui_comp_grid_cursor_goto(UI *ui, Integer grid_handle, static void ui_comp_grid_cursor_goto(UI *ui, Integer grid_handle, Integer r, Integer c)
Integer r, Integer c)
{ {
if (!ui_comp_should_draw() || !ui_comp_set_grid((int)grid_handle)) { if (!ui_comp_should_draw() || !ui_comp_set_grid((int)grid_handle)) {
return; return;
@ -304,8 +303,7 @@ ScreenGrid *ui_comp_mouse_focus(int row, int col)
/// Baseline implementation. This is always correct, but we can sometimes /// Baseline implementation. This is always correct, but we can sometimes
/// do something more efficient (where efficiency means smaller deltas to /// do something more efficient (where efficiency means smaller deltas to
/// the downstream UI.) /// the downstream UI.)
static void compose_line(Integer row, Integer startcol, Integer endcol, static void compose_line(Integer row, Integer startcol, Integer endcol, LineFlags flags)
LineFlags flags)
{ {
// If rightleft is set, startcol may be -1. In such cases, the assertions // If rightleft is set, startcol may be -1. In such cases, the assertions
// will fail because no overlap is found. Adjust startcol to prevent it. // will fail because no overlap is found. Adjust startcol to prevent it.
@ -447,8 +445,8 @@ static void compose_line(Integer row, Integer startcol, Integer endcol,
(const sattr_T *)attrbuf+skipstart); (const sattr_T *)attrbuf+skipstart);
} }
static void compose_debug(Integer startrow, Integer endrow, Integer startcol, static void compose_debug(Integer startrow, Integer endrow, Integer startcol, Integer endcol,
Integer endcol, int syn_id, bool delay) int syn_id, bool delay)
{ {
if (!(rdb_flags & RDB_COMPOSITOR)) { if (!(rdb_flags & RDB_COMPOSITOR)) {
return; return;
@ -479,8 +477,7 @@ static void debug_delay(Integer lines)
} }
static void compose_area(Integer startrow, Integer endrow, static void compose_area(Integer startrow, Integer endrow, Integer startcol, Integer endcol)
Integer startcol, Integer endcol)
{ {
compose_debug(startrow, endrow, startcol, endcol, dbghl_recompose, true); compose_debug(startrow, endrow, startcol, endcol, dbghl_recompose, true);
endrow = MIN(endrow, default_grid.Rows); endrow = MIN(endrow, default_grid.Rows);
@ -505,11 +502,9 @@ void ui_comp_compose_grid(ScreenGrid *grid)
} }
} }
static void ui_comp_raw_line(UI *ui, Integer grid, Integer row, static void ui_comp_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Integer endcol,
Integer startcol, Integer endcol, Integer clearcol, Integer clearattr, LineFlags flags,
Integer clearcol, Integer clearattr, const schar_T *chunk, const sattr_T *attrs)
LineFlags flags, const schar_T *chunk,
const sattr_T *attrs)
{ {
if (!ui_comp_should_draw() || !ui_comp_set_grid((int)grid)) { if (!ui_comp_should_draw() || !ui_comp_set_grid((int)grid)) {
return; return;
@ -572,8 +567,8 @@ void ui_comp_set_screen_valid(bool valid)
} }
} }
static void ui_comp_msg_set_pos(UI *ui, Integer grid, Integer row, static void ui_comp_msg_set_pos(UI *ui, Integer grid, Integer row, Boolean scrolled,
Boolean scrolled, String sep_char) String sep_char)
{ {
msg_grid.comp_row = (int)row; msg_grid.comp_row = (int)row;
if (scrolled && row > 0) { if (scrolled && row > 0) {
@ -617,9 +612,8 @@ static bool curgrid_covered_above(int row)
return kv_size(layers)-(above_msg?1:0) > curgrid->comp_index+1; return kv_size(layers)-(above_msg?1:0) > curgrid->comp_index+1;
} }
static void ui_comp_grid_scroll(UI *ui, Integer grid, Integer top, static void ui_comp_grid_scroll(UI *ui, Integer grid, Integer top, Integer bot, Integer left,
Integer bot, Integer left, Integer right, Integer right, Integer rows, Integer cols)
Integer rows, Integer cols)
{ {
if (!ui_comp_should_draw() || !ui_comp_set_grid((int)grid)) { if (!ui_comp_should_draw() || !ui_comp_set_grid((int)grid)) {
return; return;
@ -653,8 +647,7 @@ static void ui_comp_grid_scroll(UI *ui, Integer grid, Integer top,
} }
} }
static void ui_comp_grid_resize(UI *ui, Integer grid, static void ui_comp_grid_resize(UI *ui, Integer grid, Integer width, Integer height)
Integer width, Integer height)
{ {
if (grid == 1) { if (grid == 1) {
ui_composed_call_grid_resize(1, width, height); ui_composed_call_grid_resize(1, width, height);

File diff suppressed because it is too large Load Diff

View File

@ -6,23 +6,23 @@
/// Nvim was forked from Vim 7.4.160. /// Nvim was forked from Vim 7.4.160.
/// Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred). /// Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred).
#include <inttypes.h>
#include <assert.h> #include <assert.h>
#include <inttypes.h>
#include <limits.h> #include <limits.h>
#include "nvim/api/private/helpers.h" #include "nvim/api/private/helpers.h"
#include "nvim/vim.h"
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/buffer.h" #include "nvim/buffer.h"
#include "nvim/iconv.h"
#include "nvim/version.h"
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/iconv.h"
#include "nvim/lua/executor.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/message.h" #include "nvim/message.h"
#include "nvim/screen.h" #include "nvim/screen.h"
#include "nvim/strings.h" #include "nvim/strings.h"
#include "nvim/lua/executor.h" #include "nvim/version.h"
#include "nvim/vim.h"
// version info generated by the build system // version info generated by the build system
#include "auto/versiondef.h" #include "auto/versiondef.h"

View File

@ -1,4 +1,4 @@
# Uncrustify-0.73.0-186-03faf73c5 # Uncrustify-0.73.0-195-1f883c691
# #
# General options # General options
@ -535,14 +535,21 @@ sp_inside_braces_struct = ignore # ignore/add/remove/force/not_defined
sp_inside_braces_oc_dict = ignore # ignore/add/remove/force/not_defined sp_inside_braces_oc_dict = ignore # ignore/add/remove/force/not_defined
# Add or remove space after open brace in an unnamed temporary # Add or remove space after open brace in an unnamed temporary
# direct-list-initialization. # direct-list-initialization
# if statement is a brace_init_lst
# works only if sp_brace_brace is set to ignore.
sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force/not_defined sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force/not_defined
# Add or remove space before close brace in an unnamed temporary # Add or remove space before close brace in an unnamed temporary
# direct-list-initialization. # direct-list-initialization
# if statement is a brace_init_lst
# works only if sp_brace_brace is set to ignore.
sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force/not_defined sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force/not_defined
# Add or remove space inside an unnamed temporary direct-list-initialization. # Add or remove space inside an unnamed temporary direct-list-initialization
# if statement is a brace_init_lst
# works only if sp_brace_brace is set to ignore
# works only if sp_before_type_brace_init_lst_close is set to ignore.
sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force/not_defined sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force/not_defined
# Add or remove space inside '{' and '}'. # Add or remove space inside '{' and '}'.