refactor(uncrustify): format all c files

This commit is contained in:
Dundar Göc 2022-03-09 21:19:37 +01:00
parent d0cb8744d8
commit 7e3bdc75e4
26 changed files with 151 additions and 158 deletions

View File

@ -965,8 +965,7 @@ void nvim_buf_set_keymap(uint64_t channel_id, Buffer buffer, String mode, String
/// @see |nvim_del_keymap()|
///
/// @param buffer Buffer handle, or 0 for current buffer
void nvim_buf_del_keymap(uint64_t channel_id, Buffer buffer, String mode,
String lhs, Error *err)
void nvim_buf_del_keymap(uint64_t channel_id, Buffer buffer, String mode, String lhs, Error *err)
FUNC_API_SINCE(6)
{
String rhs = { .data = "", .size = 0 };
@ -1380,8 +1379,8 @@ Object nvim_buf_call(Buffer buffer, LuaRef fun, Error *err)
/// @param buffer Buffer handle, or 0 for current buffer.
/// @param[out] err Error details, if any.
/// @see nvim_add_user_command
void nvim_buf_add_user_command(Buffer buffer, String name, Object command,
Dict(user_command) *opts, Error *err)
void nvim_buf_add_user_command(Buffer buffer, String name, Object command, Dict(user_command) *opts,
Error *err)
FUNC_API_SINCE(9)
{
buf_T *target_buf = find_buffer_by_handle(buffer, err);

View File

@ -34,9 +34,9 @@
#include "nvim/channel.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
#include "nvim/diff.h"
#include "nvim/digraph.h"
#include "nvim/decoration.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
@ -4508,7 +4508,7 @@ int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use
char_u *start = stl_items[stl_separator_locations[i]].start;
char_u *seploc = start + dislocation;
STRMOVE(seploc, start);
for (char_u *s = start; s < seploc; ) {
for (char_u *s = start; s < seploc;) {
MB_CHAR2BYTES(fillchar, s);
}

View File

@ -11,8 +11,8 @@
#include "nvim/event/loop.h"
#include "nvim/event/rstream.h"
#include "nvim/log.h"
#include "nvim/memory.h"
#include "nvim/main.h"
#include "nvim/memory.h"
#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -1,8 +1,8 @@
#ifndef NVIM_EX_DOCMD_H
#define NVIM_EX_DOCMD_H
#include "nvim/ex_cmds_defs.h"
#include "nvim/eval/funcs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/globals.h"
// flags for do_cmdline()

View File

@ -2,8 +2,8 @@
#define NVIM_EXTMARK_H
#include "nvim/buffer_defs.h"
#include "nvim/extmark_defs.h"
#include "nvim/decoration.h"
#include "nvim/extmark_defs.h"
#include "nvim/marktree.h"
#include "nvim/pos.h"

View File

@ -819,7 +819,7 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
bool cterm_mask_provided = false;
#define CHECK_FLAG(d, m, name, extra, flag) \
if (api_object_to_bool(d->name ## extra, #name, false, err)) { \
if (api_object_to_bool(d->name##extra, #name, false, err)) { \
m = m | flag; \
}
@ -906,7 +906,6 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
CHECK_FLAG(cterm, cterm_mask, reverse, , HL_INVERSE);
CHECK_FLAG(cterm, cterm_mask, strikethrough, , HL_STRIKETHROUGH);
CHECK_FLAG(cterm, cterm_mask, nocombine, , HL_NOCOMBINE);
} else if (dict->cterm.type == kObjectTypeArray && dict->cterm.data.array.size == 0) {
// empty list from Lua API should clear all cterm attributes
// TODO(clason): handle via gen_api_dispatch

View File

@ -9,9 +9,9 @@
#include "nvim/func_attr.h"
#include "nvim/getchar.h"
#include "nvim/input.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/input.h"
#include "nvim/mouse.h"
#include "nvim/os/input.h"
#include "nvim/ui.h"

View File

@ -15,8 +15,8 @@
#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/cursor.h"
#include "nvim/eval/userfunc.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/userfunc.h"
#include "nvim/event/loop.h"
#include "nvim/event/time.h"
#include "nvim/ex_cmds2.h"
@ -189,21 +189,18 @@ static int nlua_luv_cfpcall(lua_State *lstate, int nargs, int nresult, int flags
return retval;
}
static int nlua_luv_thread_cb_cfpcall(lua_State *lstate, int nargs, int nresult,
int flags)
static int nlua_luv_thread_cb_cfpcall(lua_State *lstate, int nargs, int nresult, int flags)
{
return nlua_luv_thread_common_cfpcall(lstate, nargs, nresult, flags, true);
}
static int nlua_luv_thread_cfpcall(lua_State *lstate, int nargs, int nresult,
int flags)
static int nlua_luv_thread_cfpcall(lua_State *lstate, int nargs, int nresult, int flags)
FUNC_ATTR_NONNULL_ALL
{
return nlua_luv_thread_common_cfpcall(lstate, nargs, nresult, flags, false);
}
static int nlua_luv_thread_cfcpcall(lua_State *lstate, lua_CFunction func,
void *ud, int flags)
static int nlua_luv_thread_cfcpcall(lua_State *lstate, lua_CFunction func, void *ud, int flags)
FUNC_ATTR_NONNULL_ARG(1, 2)
{
lua_pushcfunction(lstate, func);
@ -212,8 +209,8 @@ static int nlua_luv_thread_cfcpcall(lua_State *lstate, lua_CFunction func,
return retval;
}
static int nlua_luv_thread_common_cfpcall(lua_State *lstate, int nargs, int nresult,
int flags, bool is_callback)
static int nlua_luv_thread_common_cfpcall(lua_State *lstate, int nargs, int nresult, int flags,
bool is_callback)
FUNC_ATTR_NONNULL_ALL
{
int retval;

View File

@ -4,8 +4,8 @@
#include <lauxlib.h>
#include <lua.h>
#include "nvim/assert.h"
#include "nvim/api/private/defs.h"
#include "nvim/assert.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"

View File

@ -1,12 +1,12 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include <lua.h>
#include <lauxlib.h>
#include <lua.h>
#include "nvim/lua/spell.h"
#include "nvim/spell.h"
#include "nvim/vim.h"
#include "nvim/lua/spell.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "lua/spell.c.generated.h"
@ -45,7 +45,7 @@ int nlua_spell_check(lua_State *lstate)
size_t pos = 0;
int capcol = -1;
int no_res = 0;
const char * result;
const char *result;
lua_createtable(lstate, 0, 0);
@ -90,7 +90,7 @@ int nlua_spell_check(lua_State *lstate)
static const luaL_Reg spell_functions[] = {
{ "check", nlua_spell_check },
{ NULL , NULL }
{ NULL, NULL }
};
int luaopen_spell(lua_State *L)

View File

@ -28,10 +28,10 @@
#include "nvim/globals.h"
#include "nvim/lua/converter.h"
#include "nvim/lua/executor.h"
#include "nvim/lua/spell.h"
#include "nvim/lua/stdlib.h"
#include "nvim/lua/treesitter.h"
#include "nvim/lua/xdiff.h"
#include "nvim/lua/spell.h"
#include "nvim/macros.h"
#include "nvim/map.h"
#include "nvim/memline.h"

View File

@ -558,7 +558,7 @@ void marktree_revise(MarkTree *b, MarkTreeIter *itr, uint8_t decor_level, mtkey_
{
// TODO(bfredl): clean up this mess and re-instantiate &= and |= forms
// once we upgrade to a non-broken version of gcc in functionaltest-lua CI
rawkey(itr).flags = (uint16_t)(rawkey(itr).flags & (uint16_t)~MT_FLAG_DECOR_MASK);
rawkey(itr).flags = (uint16_t)(rawkey(itr).flags & (uint16_t) ~MT_FLAG_DECOR_MASK);
rawkey(itr).flags = (uint16_t)(rawkey(itr).flags
| (uint16_t)(decor_level << MT_FLAG_DECOR_OFFSET)
| (uint16_t)(key.flags & MT_FLAG_DECOR_MASK));

View File

@ -1,14 +1,14 @@
#ifndef NVIM_MARKTREE_H
#define NVIM_MARKTREE_H
#include <stdint.h>
#include <assert.h>
#include <stdint.h>
#include "nvim/assert.h"
#include "nvim/garray.h"
#include "nvim/map.h"
#include "nvim/types.h"
#include "nvim/pos.h"
#include "nvim/types.h"
#define MT_MAX_DEPTH 20
#define MT_BRANCH_FACTOR 10

View File

@ -14,7 +14,7 @@
#endif
#if !defined(NAME_MAX) && defined(_XOPEN_NAME_MAX)
#define NAME_MAX _XOPEN_NAME_MAX
# define NAME_MAX _XOPEN_NAME_MAX
#endif
#define BASENAMELEN (NAME_MAX - 5)

View File

@ -16,11 +16,11 @@
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
# include <util.h>
#elif defined(__sun)
# include <fcntl.h>
# include <signal.h>
# include <sys/stream.h>
# include <sys/syscall.h>
# include <fcntl.h>
# include <unistd.h>
# include <signal.h>
#else
# include <pty.h>
#endif
@ -49,10 +49,10 @@
// this header defines STR, just as nvim.h, but it is defined as ('S'<<8),
// to avoid #undef STR, #undef STR, #define STR ('S'<<8) just delay the
// inclusion of the header even though it gets include out of order.
#include <sys/stropts.h>
# include <sys/stropts.h>
static int openpty(int *amaster, int *aslave, char *name,
struct termios *termp, struct winsize *winp)
static int openpty(int *amaster, int *aslave, char *name, struct termios *termp,
struct winsize *winp)
{
int slave = -1;
int master = open("/dev/ptmx", O_RDWR);
@ -63,7 +63,7 @@ static int openpty(int *amaster, int *aslave, char *name,
// grantpt will invoke a setuid program to change permissions
// and might fail if SIGCHLD handler is set, temporarily reset
// while running
void(*sig_saved)(int) = signal(SIGCHLD, SIG_DFL);
void (*sig_saved)(int) = signal(SIGCHLD, SIG_DFL);
int res = grantpt(master);
signal(SIGCHLD, sig_saved);
@ -129,8 +129,7 @@ static int login_tty(int fd)
return 0;
}
static pid_t forkpty(int *amaster, char *name,
struct termios *termp, struct winsize *winp)
static pid_t forkpty(int *amaster, char *name, struct termios *termp, struct winsize *winp)
{
int master, slave;
if (openpty(&master, &slave, name, termp, winp) == -1) {

View File

@ -9,10 +9,10 @@
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/eval.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/rstream.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds.h"
#include "nvim/fileio.h"
#include "nvim/lib/kvec.h"
@ -27,8 +27,8 @@
#include "nvim/path.h"
#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/types.h"
#include "nvim/tag.h"
#include "nvim/types.h"
#include "nvim/ui.h"
#include "nvim/vim.h"

View File

@ -5421,9 +5421,8 @@ static int vgr_process_args(exarg_T *eap, vgr_args_T *args)
/// Search for a pattern in a list of files and populate the quickfix list with
/// the matches.
static int vgr_process_files(win_T *wp, qf_info_T *qi, vgr_args_T *cmd_args,
bool *redraw_for_dummy, buf_T **first_match_buf,
char_u **target_dir)
static int vgr_process_files(win_T *wp, qf_info_T *qi, vgr_args_T *cmd_args, bool *redraw_for_dummy,
buf_T **first_match_buf, char_u **target_dir)
{
int status = FAIL;
unsigned save_qfid = qf_get_curlist(qi)->qf_id;

View File

@ -4680,9 +4680,9 @@ static bool use_cursor_line_sign(win_T *wp, linenr_T lnum)
// @param[in, out] sign_idxp Index of the displayed sign
static void get_sign_display_info(bool nrcol, win_T *wp, linenr_T lnum, sign_attrs_T sattrs[],
int row, int startrow, int filler_lines, int filler_todo,
int *c_extrap, int *c_finalp, char_u *extra,
size_t extra_size, char_u **pp_extra, int *n_extrap,
int *char_attrp, int *draw_statep, int *sign_idxp)
int *c_extrap, int *c_finalp, char_u *extra, size_t extra_size,
char_u **pp_extra, int *n_extrap, int *char_attrp,
int *draw_statep, int *sign_idxp)
{
int count = wp->w_scwidth;
// Draw cells with the sign value or blank.

View File

@ -13,8 +13,8 @@
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/edit.h"
#include "nvim/eval.h"