Skip to content

Commit

Permalink
Merge neovim#16000 refactor: uncrustify
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmk authored Oct 19, 2021
2 parents 29b718d + 6059784 commit aac15cf
Show file tree
Hide file tree
Showing 32 changed files with 1,339 additions and 1,318 deletions.
4 changes: 2 additions & 2 deletions src/nvim/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -6216,8 +6216,8 @@ static void internal_format(int textwidth, int second_indent, int flags, int for
open_line(FORWARD, OPENLINE_DELSPACES + OPENLINE_MARKFIX
+ (fo_white_par ? OPENLINE_KEEPTRAIL : 0)
+ (do_comments ? OPENLINE_DO_COM : 0)
+ ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0)
, ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent));
+ ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0),
((flags & INSCHAR_COM_LIST) ? second_indent : old_indent));
if (!(flags & INSCHAR_COM_LIST)) {
old_indent = 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/nvim/eval/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1963,13 +1963,13 @@ static void f_environ(typval_T *argvars, typval_T *rettv, FunPtr fptr)
os_copy_fullenv(env, env_size);

for (ssize_t i = env_size - 1; i >= 0; i--) {
const char * str = env[i];
const char *str = env[i];
const char * const end = strchr(str + (str[0] == '=' ? 1 : 0),
'=');
assert(end != NULL);
ptrdiff_t len = end - str;
assert(len > 0);
const char * value = str + len + 1;
const char *value = str + len + 1;

char c = env[i][len];
env[i][len] = NUL;
Expand Down Expand Up @@ -5345,7 +5345,7 @@ static const char *required_env_vars[] = {
static dict_T *create_environment(const dictitem_T *job_env, const bool clear_env, const bool pty,
const char * const pty_term_name)
{
dict_T * env = tv_dict_alloc();
dict_T *env = tv_dict_alloc();

if (!clear_env) {
typval_T temp_env = TV_INITIAL_VALUE;
Expand Down Expand Up @@ -9644,7 +9644,7 @@ static void f_sign_jump(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}

// Sign group
const char * sign_group_chk = tv_get_string_chk(&argvars[1]);
const char *sign_group_chk = tv_get_string_chk(&argvars[1]);
if (sign_group_chk == NULL) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/event/loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "nvim/lib/klist.h"
#include "nvim/os/time.h"

typedef void * WatcherPtr;
typedef void *WatcherPtr;

#define _noop(x)
KLIST_INIT(WatcherPtr, WatcherPtr, _noop)
Expand Down
6 changes: 3 additions & 3 deletions src/nvim/ex_docmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5697,7 +5697,7 @@ void ex_comclear(exarg_T *eap)
uc_clear(&curbuf->b_ucmds);
}

static void free_ucmd(ucmd_T * cmd) {
static void free_ucmd(ucmd_T *cmd) {
xfree(cmd->uc_name);
xfree(cmd->uc_rep);
xfree(cmd->uc_compl_arg);
Expand Down Expand Up @@ -7501,8 +7501,8 @@ void do_exedit(exarg_T *eap, win_T *old_curwin)
// After a split we can use an existing buffer.
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0)
+ (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0)
, old_curwin == NULL ? curwin : NULL) == FAIL) {
+ (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0),
old_curwin == NULL ? curwin : NULL) == FAIL) {
// Editing the file failed. If the window was split, close it.
if (old_curwin != NULL) {
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
Expand Down
12 changes: 6 additions & 6 deletions src/nvim/file_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ char_u *vim_findfile(void *search_ctx_arg)
if (stackp->ffs_filearray == NULL
&& ff_check_visited(&search_ctx->ffsc_dir_visited_list
->ffvl_visited_list,
stackp->ffs_fix_path
, stackp->ffs_wc_path
stackp->ffs_fix_path,
stackp->ffs_wc_path
) == FAIL) {
#ifdef FF_VERBOSE
if (p_verbose >= 5) {
Expand Down Expand Up @@ -840,15 +840,15 @@ char_u *vim_findfile(void *search_ctx_arg)
== os_isdir(file_path)))))
#ifndef FF_VERBOSE
&& (ff_check_visited(&search_ctx->ffsc_visited_list->ffvl_visited_list,
file_path
, (char_u *)""
file_path,
(char_u *)""
) == OK)
#endif
) {
#ifdef FF_VERBOSE
if (ff_check_visited(&search_ctx->ffsc_visited_list->ffvl_visited_list,
file_path
, (char_u *)""
file_path,
(char_u *)""
) == FAIL) {
if (p_verbose >= 5) {
verbose_enter_scroll();
Expand Down
6 changes: 3 additions & 3 deletions src/nvim/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3154,8 +3154,8 @@ int buf_write(buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_
O_WRONLY |
(append ?
(forceit ? (O_APPEND | O_CREAT) : O_APPEND)
: (O_CREAT | O_TRUNC))
, perm < 0 ? 0666 : (perm & 0777))) < 0) {
: (O_CREAT | O_TRUNC)),
perm < 0 ? 0666 : (perm & 0777))) < 0) {
// A forced write will try to create a new file if the old one
// is still readonly. This may also happen when the directory
// is read-only. In that case the mch_remove() will fail.
Expand Down Expand Up @@ -4684,7 +4684,7 @@ int vim_rename(const char_u *from, const char_u *to)
}
STRCPY(tempname, from);
for (n = 123; n < 99999; n++) {
char * tail = (char *)path_tail(tempname);
char *tail = (char *)path_tail(tempname);
snprintf(tail, (MAXPATHL + 1) - (tail - (char *)tempname - 1), "%d", n);

if (!os_path_exists(tempname)) {
Expand Down
6 changes: 3 additions & 3 deletions src/nvim/hardcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)

static int prt_add_resource(struct prt_ps_resource_S *resource)
{
FILE * fd_resource;
FILE *fd_resource;
char_u resource_buffer[512];
size_t bytes_read;

Expand Down Expand Up @@ -2696,8 +2696,8 @@ int mch_print_begin(prt_settings_T *psettings)
prt_dsc_resources(NULL, "encoding", buffer);
}
prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
psettings->do_syntax
, prt_num_copies);
psettings->do_syntax,
prt_num_copies);
prt_dsc_noarg("EndComments");

/*
Expand Down
109 changes: 54 additions & 55 deletions src/nvim/highlight_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,62 +49,61 @@ typedef struct attr_entry {
/// Values for index in highlight_attr[].
/// When making changes, also update hlf_names below!
typedef enum {
HLF_8 = 0 // Meta & special keys listed with ":map", text that is
HLF_8 = 0, // Meta & special keys listed with ":map", text that is
// displayed different from what it is
, HLF_EOB // after the last line in the buffer
, HLF_TERM // terminal cursor focused
, HLF_TERMNC // terminal cursor unfocused
, HLF_AT // @ characters at end of screen, characters that
// don't really exist in the text
, HLF_D // directories in CTRL-D listing
, HLF_E // error messages
, HLF_I // incremental search
, HLF_L // last search string
, HLF_M // "--More--" message
, HLF_CM // Mode (e.g., "-- INSERT --")
, HLF_N // line number for ":number" and ":#" commands
, HLF_LNA // LineNrAbove
, HLF_LNB // LineNrBelow
, HLF_CLN // current line number when 'cursorline' is set
, HLF_R // return to continue message and yes/no questions
, HLF_S // status lines
, HLF_SNC // status lines of not-current windows
, HLF_C // column to separate vertically split windows
, HLF_T // Titles for output from ":set all", ":autocmd" etc.
, HLF_V // Visual mode
, HLF_VNC // Visual mode, autoselecting and not clipboard owner
, HLF_W // warning messages
, HLF_WM // Wildmenu highlight
, HLF_FL // Folded line
, HLF_FC // Fold column
, HLF_ADD // Added diff line
, HLF_CHD // Changed diff line
, HLF_DED // Deleted diff line
, HLF_TXD // Text Changed in diff line
, HLF_SC // Sign column
, HLF_CONCEAL // Concealed text
, HLF_SPB // SpellBad
, HLF_SPC // SpellCap
, HLF_SPR // SpellRare
, HLF_SPL // SpellLocal
, HLF_PNI // popup menu normal item
, HLF_PSI // popup menu selected item
, HLF_PSB // popup menu scrollbar
, HLF_PST // popup menu scrollbar thumb
, HLF_TP // tabpage line
, HLF_TPS // tabpage line selected
, HLF_TPF // tabpage line filler
, HLF_CUC // 'cursorcolumn'
, HLF_CUL // 'cursorline'
, HLF_MC // 'colorcolumn'
, HLF_QFL // selected quickfix line
, HLF_0 // Whitespace
, HLF_INACTIVE // NormalNC: Normal text in non-current windows
, HLF_MSGSEP // message separator line
, HLF_NFLOAT // Floating window
, HLF_MSG // Message area
, HLF_BORDER // Floating window border
, HLF_COUNT // MUST be the last one
HLF_EOB, // after the last line in the buffer
HLF_TERM, // terminal cursor focused
HLF_TERMNC, // terminal cursor unfocused
HLF_AT, // @ characters at end of screen, characters that don't really exist in the text
HLF_D, // directories in CTRL-D listing
HLF_E, // error messages
HLF_I, // incremental search
HLF_L, // last search string
HLF_M, // "--More--" message
HLF_CM, // Mode (e.g., "-- INSERT --")
HLF_N, // line number for ":number" and ":#" commands
HLF_LNA, // LineNrAbove
HLF_LNB, // LineNrBelow
HLF_CLN, // current line number when 'cursorline' is set
HLF_R, // return to continue message and yes/no questions
HLF_S, // status lines
HLF_SNC, // status lines of not-current windows
HLF_C, // column to separate vertically split windows
HLF_T, // Titles for output from ":set all", ":autocmd" etc.
HLF_V, // Visual mode
HLF_VNC, // Visual mode, autoselecting and not clipboard owner
HLF_W, // warning messages
HLF_WM, // Wildmenu highlight
HLF_FL, // Folded line
HLF_FC, // Fold column
HLF_ADD, // Added diff line
HLF_CHD, // Changed diff line
HLF_DED, // Deleted diff line
HLF_TXD, // Text Changed in diff line
HLF_SC, // Sign column
HLF_CONCEAL, // Concealed text
HLF_SPB, // SpellBad
HLF_SPC, // SpellCap
HLF_SPR, // SpellRare
HLF_SPL, // SpellLocal
HLF_PNI, // popup menu normal item
HLF_PSI, // popup menu selected item
HLF_PSB, // popup menu scrollbar
HLF_PST, // popup menu scrollbar thumb
HLF_TP, // tabpage line
HLF_TPS, // tabpage line selected
HLF_TPF, // tabpage line filler
HLF_CUC, // 'cursorcolumn'
HLF_CUL, // 'cursorline'
HLF_MC, // 'colorcolumn'
HLF_QFL, // selected quickfix line
HLF_0, // Whitespace
HLF_INACTIVE, // NormalNC: Normal text in non-current windows
HLF_MSGSEP, // message separator line
HLF_NFLOAT, // Floating window
HLF_MSG, // Message area
HLF_BORDER, // Floating window border
HLF_COUNT // MUST be the last one
} hlf_T;

EXTERN const char *hlf_names[] INIT(= {
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/if_cscope.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# include "if_cscope.c.generated.h"
#endif

static csinfo_T * csinfo = NULL;
static csinfo_T *csinfo = NULL;
static size_t csinfo_size = 0; // number of items allocated in csinfo[]

static int eap_arg_len; // length of eap->arg, set in cs_lookup_cmd()
Expand Down
16 changes: 8 additions & 8 deletions src/nvim/if_cscope_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
// See ":help cscope-find" for the possible queries.

typedef struct {
char * name;
char *name;
int (*func)(exarg_T *eap);
char * help;
char * usage;
char *help;
char *usage;
int cansplit; // if supports splitting window
} cscmd_T;

typedef struct csi {
char * fname; // cscope db name
char * ppath; // path to prepend (the -P option)
char * flags; // additional cscope flags/options (e.g, -p2)
char *fname; // cscope db name
char *ppath; // path to prepend (the -P option)
char *flags; // additional cscope flags/options (e.g, -p2)
#if defined(UNIX)
pid_t pid; // PID of the connected cscope process
#else
Expand All @@ -48,8 +48,8 @@ typedef struct csi {
#endif
FileID file_id;

FILE * fr_fp; // from cscope: FILE.
FILE * to_fp; // to cscope: FILE.
FILE *fr_fp; // from cscope: FILE.
FILE *to_fp; // to cscope: FILE.
} csinfo_T;

typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;
Expand Down
Loading

0 comments on commit aac15cf

Please sign in to comment.