refactor: reformat with uncrustify #15736

* fix function parameter comments
* remove space after star in function names
This commit is contained in:
dundargoc 2021-09-20 18:35:41 +02:00 committed by GitHub
parent 1f8c91bf72
commit f4ca3a29dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1412 additions and 1262 deletions

View File

@ -208,7 +208,7 @@ sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force/not_defined
# prototype or function definition. # prototype or function definition.
# #
# Overrides sp_after_ptr_star and sp_type_func. # Overrides sp_after_ptr_star and sp_type_func.
sp_after_ptr_star_func = ignore # ignore/add/remove/force/not_defined sp_after_ptr_star_func = remove # ignore/add/remove/force/not_defined
# Add or remove space after a pointer star '*' in the trailing return of a # Add or remove space after a pointer star '*' in the trailing return of a
# function prototype or function definition. # function prototype or function definition.
@ -3279,5 +3279,5 @@ set PREPROC REAL_FATTR_CONST
set PREPROC REAL_FATTR_NONNULL_ALL set PREPROC REAL_FATTR_NONNULL_ALL
set PREPROC REAL_FATTR_PURE set PREPROC REAL_FATTR_PURE
set PREPROC REAL_FATTR_WARN_UNUSED_RESULT set PREPROC REAL_FATTR_WARN_UNUSED_RESULT
# option(s) with 'not default' value: 61 # option(s) with 'not default' value: 62
# #

View File

@ -2938,7 +2938,7 @@ buf_T *setaltfname(char_u *ffname, char_u *sfname, linenr_T lnum)
* Get alternate file name for current window. * Get alternate file name for current window.
* Return NULL if there isn't any, and give error message if requested. * Return NULL if there isn't any, and give error message if requested.
*/ */
char_u * getaltfname(bool errmsg // give error message char_u *getaltfname(bool errmsg // give error message
) )
{ {
char_u *fname; char_u *fname;

View File

@ -417,7 +417,7 @@ char *transstr(const char *const s)
/// ///
/// When "buf" is NULL, return an allocated string. /// When "buf" is NULL, return an allocated string.
/// Otherwise, put the result in buf, limited by buflen, and return buf. /// Otherwise, put the result in buf, limited by buflen, and return buf.
char_u * str_foldcase(char_u *str, int orglen, char_u *buf, int buflen) char_u *str_foldcase(char_u *str, int orglen, char_u *buf, int buflen)
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_RET
{ {
garray_T ga; garray_T ga;
@ -1209,7 +1209,7 @@ char_u *skipdigits(const char_u *q)
/// @param q pointer to string /// @param q pointer to string
/// ///
/// @return Pointer to the character after the skipped digits. /// @return Pointer to the character after the skipped digits.
const char * skipbin(const char *q) const char *skipbin(const char *q)
FUNC_ATTR_PURE FUNC_ATTR_PURE
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_RET
@ -1228,7 +1228,7 @@ const char * skipbin(const char *q)
/// ///
/// @return Pointer to the character after the skipped digits and hex /// @return Pointer to the character after the skipped digits and hex
/// characters. /// characters.
char_u * skiphex(char_u *q) char_u *skiphex(char_u *q)
{ {
char_u *p = q; char_u *p = q;
while (ascii_isxdigit(*p)) { while (ascii_isxdigit(*p)) {
@ -1243,7 +1243,7 @@ char_u * skiphex(char_u *q)
/// @param q /// @param q
/// ///
/// @return Pointer to the digit or (NUL after the string). /// @return Pointer to the digit or (NUL after the string).
char_u * skiptodigit(char_u *q) char_u *skiptodigit(char_u *q)
{ {
char_u *p = q; char_u *p = q;
while (*p != NUL && !ascii_isdigit(*p)) { while (*p != NUL && !ascii_isdigit(*p)) {
@ -1258,7 +1258,7 @@ char_u * skiptodigit(char_u *q)
/// @param q pointer to string /// @param q pointer to string
/// ///
/// @return Pointer to the binary character or (NUL after the string). /// @return Pointer to the binary character or (NUL after the string).
const char * skiptobin(const char *q) const char *skiptobin(const char *q)
FUNC_ATTR_PURE FUNC_ATTR_PURE
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_RET
@ -1276,7 +1276,7 @@ const char * skiptobin(const char *q)
/// @param q /// @param q
/// ///
/// @return Pointer to the hex character or (NUL after the string). /// @return Pointer to the hex character or (NUL after the string).
char_u * skiptohex(char_u *q) char_u *skiptohex(char_u *q)
{ {
char_u *p = q; char_u *p = q;
while (*p != NUL && !ascii_isxdigit(*p)) { while (*p != NUL && !ascii_isxdigit(*p)) {
@ -1305,7 +1305,7 @@ char_u *skiptowhite(const char_u *p)
/// @param p /// @param p
/// ///
/// @return Pointer to the next whitespace character. /// @return Pointer to the next whitespace character.
char_u * skiptowhite_esc(char_u *p) { char_u *skiptowhite_esc(char_u *p) {
while (*p != ' ' && *p != '\t' && *p != NUL) { while (*p != ' ' && *p != '\t' && *p != NUL) {
if (((*p == '\\') || (*p == Ctrl_V)) && (*(p + 1) != NUL)) { if (((*p == '\\') || (*p == Ctrl_V)) && (*(p + 1) != NUL)) {
++p; ++p;

View File

@ -507,7 +507,7 @@ static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, linenr_T
/// @param dp /// @param dp
/// ///
/// @return The new diff block. /// @return The new diff block.
static diff_T * diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) static diff_T *diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
{ {
diff_T *dnew = xmalloc(sizeof(*dnew)); diff_T *dnew = xmalloc(sizeof(*dnew));

View File

@ -1821,7 +1821,7 @@ typedef struct {
/// @return NULL if OK, an error message for failure. This only needs to be /// @return NULL if OK, an error message for failure. This only needs to be
/// used when setting the option, not later when the value has already /// used when setting the option, not later when the value has already
/// been checked. /// been checked.
char_u * keymap_init(void) char_u *keymap_init(void)
{ {
curbuf->b_kmap_state &= ~KEYMAP_INIT; curbuf->b_kmap_state &= ~KEYMAP_INIT;

View File

@ -3327,7 +3327,7 @@ void get_complete_info(list_T *what_list, dict_T *retdict)
} }
// Return Insert completion mode name string // Return Insert completion mode name string
static char_u * ins_compl_mode(void) static char_u *ins_compl_mode(void)
{ {
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || compl_started) { if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET || compl_started) {
return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT]; return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT];

View File

@ -6367,7 +6367,7 @@ int assert_match_common(typval_T *argvars, assert_type_T atype)
/// Find a window: When using a Window ID in any tab page, when using a number /// Find a window: When using a Window ID in any tab page, when using a number
/// in the current tab page. /// in the current tab page.
win_T * find_win_by_nr_or_id(typval_T *vp) win_T *find_win_by_nr_or_id(typval_T *vp)
{ {
int nr = (int)tv_get_number_chk(vp, NULL); int nr = (int)tv_get_number_chk(vp, NULL);

View File

@ -803,7 +803,7 @@ buf_T *tv_get_buf_from_arg(typval_T *const tv) FUNC_ATTR_NONNULL_ALL
/// Get the buffer from "arg" and give an error and return NULL if it is not /// Get the buffer from "arg" and give an error and return NULL if it is not
/// valid. /// valid.
buf_T * get_buf_arg(typval_T *arg) buf_T *get_buf_arg(typval_T *arg)
{ {
buf_T *buf; buf_T *buf;
@ -1081,7 +1081,7 @@ static void f_cindent(typval_T *argvars, typval_T *rettv, FunPtr fptr)
} }
} }
static win_T * get_optional_window(typval_T *argvars, int idx) static win_T *get_optional_window(typval_T *argvars, int idx)
{ {
win_T *win = curwin; win_T *win = curwin;

View File

@ -203,7 +203,7 @@ static void register_closure(ufunc_T *fp)
/// Get a name for a lambda. Returned in static memory. /// Get a name for a lambda. Returned in static memory.
char_u * get_lambda_name(void) char_u *get_lambda_name(void)
{ {
static char_u name[30]; static char_u name[30];
static int lambda_no = 0; static int lambda_no = 0;

View File

@ -1030,7 +1030,7 @@ int getline_equal(LineGetter fgetline, void *cookie, LineGetter func)
/// getline function. Otherwise return "cookie". /// getline function. Otherwise return "cookie".
/// ///
/// @param cookie argument for fgetline() /// @param cookie argument for fgetline()
void * getline_cookie(LineGetter fgetline, void *cookie) void *getline_cookie(LineGetter fgetline, void *cookie)
{ {
LineGetter gp; LineGetter gp;
struct loop_cookie *cp; struct loop_cookie *cp;
@ -1250,7 +1250,7 @@ static char_u *skip_colon_white(const char_u *p, bool skipleadingwhite)
/// This function may be called recursively! /// This function may be called recursively!
/// ///
/// @param cookie argument for fgetline() /// @param cookie argument for fgetline()
static char_u * do_one_cmd(char_u **cmdlinep, int flags, cstack_T *cstack, LineGetter fgetline, static char_u *do_one_cmd(char_u **cmdlinep, int flags, cstack_T *cstack, LineGetter fgetline,
void *cookie) void *cookie)
{ {
char_u *p; char_u *p;
@ -2905,7 +2905,7 @@ int cmd_exists(const char *const name)
/// probably won't change that much -- webb. /// probably won't change that much -- webb.
/// ///
/// @param buff buffer for command string /// @param buff buffer for command string
const char * set_one_cmd_context(expand_T *xp, const char *buff) const char *set_one_cmd_context(expand_T *xp, const char *buff)
{ {
size_t len = 0; size_t len = 0;
exarg_T ea; exarg_T ea;

View File

@ -2401,7 +2401,7 @@ void text_locked_msg(void)
EMSG(_(get_text_locked_msg())); EMSG(_(get_text_locked_msg()));
} }
char_u * get_text_locked_msg(void) { char_u *get_text_locked_msg(void) {
if (cmdwin_type != 0) { if (cmdwin_type != 0) {
return e_cmdwin; return e_cmdwin;
} else { } else {
@ -5218,8 +5218,8 @@ static void expand_shellcmd(char_u *filepat, int *num_file, char_u ***file, int
/// Call "user_expand_func()" to invoke a user defined Vim script function and /// Call "user_expand_func()" to invoke a user defined Vim script function and
/// return the result (either a string, a List or NULL). /// return the result (either a string, a List or NULL).
static void * call_user_expand_func(user_expand_func_T user_expand_func, expand_T *xp, static void *call_user_expand_func(user_expand_func_T user_expand_func, expand_T *xp, int *num_file,
int *num_file, char_u ***file) char_u ***file)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
char_u keep = 0; char_u keep = 0;

File diff suppressed because it is too large Load Diff

View File

@ -5538,7 +5538,7 @@ bool match_file_list(char_u *list, char_u *sfname, char_u *ffname)
/// @param no_bslash Don't use a backward slash as pathsep /// @param no_bslash Don't use a backward slash as pathsep
/// ///
/// @return NULL on failure. /// @return NULL on failure.
char_u * file_pat_to_reg_pat(const char_u *pat, const char_u *pat_end, char *allow_dirs, char_u *file_pat_to_reg_pat(const char_u *pat, const char_u *pat_end, char *allow_dirs,
int no_bslash) int no_bslash)
FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(1)
{ {

View File

@ -5,16 +5,16 @@
/// ///
/// Functions for handling growing arrays. /// Functions for handling growing arrays.
#include <string.h>
#include <inttypes.h> #include <inttypes.h>
#include <string.h>
#include "nvim/vim.h"
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/garray.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/path.h" #include "nvim/path.h"
#include "nvim/garray.h"
#include "nvim/strings.h" #include "nvim/strings.h"
#include "nvim/vim.h"
// #include "nvim/globals.h" // #include "nvim/globals.h"
#include "nvim/memline.h" #include "nvim/memline.h"
@ -146,11 +146,11 @@ void ga_remove_duplicate_strings(garray_T *gap)
char_u *ga_concat_strings_sep(const garray_T *gap, const char *sep) char_u *ga_concat_strings_sep(const garray_T *gap, const char *sep)
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_RET
{ {
const size_t nelem = (size_t) gap->ga_len; const size_t nelem = (size_t)gap->ga_len;
const char **strings = gap->ga_data; const char **strings = gap->ga_data;
if (nelem == 0) { if (nelem == 0) {
return (char_u *) xstrdup(""); return (char_u *)xstrdup("");
} }
size_t len = 0; size_t len = 0;
@ -169,7 +169,7 @@ char_u *ga_concat_strings_sep(const garray_T *gap, const char *sep)
} }
strcpy(s, strings[nelem - 1]); strcpy(s, strings[nelem - 1]);
return (char_u *) ret; return (char_u *)ret;
} }
/// For a growing array that contains a list of strings: concatenate all the /// For a growing array that contains a list of strings: concatenate all the
@ -178,7 +178,7 @@ char_u *ga_concat_strings_sep(const garray_T *gap, const char *sep)
/// @param gap /// @param gap
/// ///
/// @returns the concatenated strings /// @returns the concatenated strings
char_u* ga_concat_strings(const garray_T *gap) FUNC_ATTR_NONNULL_RET char_u *ga_concat_strings(const garray_T *gap) FUNC_ATTR_NONNULL_RET
{ {
return ga_concat_strings_sep(gap, ","); return ga_concat_strings_sep(gap, ",");
} }
@ -198,7 +198,7 @@ void ga_concat(garray_T *gap, const char_u *restrict s)
return; return;
} }
ga_concat_len(gap, (const char *restrict) s, strlen((char *) s)); ga_concat_len(gap, (const char *restrict)s, strlen((char *)s));
} }
/// Concatenate a string to a growarray which contains characters /// Concatenate a string to a growarray which contains characters
@ -206,15 +206,14 @@ void ga_concat(garray_T *gap, const char_u *restrict s)
/// @param[out] gap Growarray to modify. /// @param[out] gap Growarray to modify.
/// @param[in] s String to concatenate. /// @param[in] s String to concatenate.
/// @param[in] len String length. /// @param[in] len String length.
void ga_concat_len(garray_T *const gap, const char *restrict s, void ga_concat_len(garray_T *const gap, const char *restrict s, const size_t len)
const size_t len)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
if (len) { if (len) {
ga_grow(gap, (int) len); ga_grow(gap, (int)len);
char *data = gap->ga_data; char *data = gap->ga_data;
memcpy(data + gap->ga_len, s, len); memcpy(data + gap->ga_len, s, len);
gap->ga_len += (int) len; gap->ga_len += (int)len;
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,15 +22,15 @@
/// memory). /// memory).
#include <assert.h> #include <assert.h>
#include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "nvim/vim.h"
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/hashtab.h" #include "nvim/hashtab.h"
#include "nvim/message.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/vim.h"
// Magic value for algorithm that walks through the array. // Magic value for algorithm that walks through the array.
#define PERTURB_SHIFT 5 #define PERTURB_SHIFT 5
@ -102,8 +102,7 @@ hashitem_T *hash_find(const hashtab_T *const ht, const char_u *const key)
/// ///
/// @warning Returned pointer becomes invalid as soon as the hash table /// @warning Returned pointer becomes invalid as soon as the hash table
/// is changed in any way. /// is changed in any way.
hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const key, hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const key, const size_t len)
const size_t len)
{ {
return hash_lookup(ht, key, len, hash_hash_len(key, len)); return hash_lookup(ht, key, len, hash_hash_len(key, len));
} }
@ -119,8 +118,7 @@ hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const key,
/// used for that key. /// used for that key.
/// WARNING: Returned pointer becomes invalid as soon as the hash table /// WARNING: Returned pointer becomes invalid as soon as the hash table
/// is changed in any way. /// is changed in any way.
hashitem_T *hash_lookup(const hashtab_T *const ht, hashitem_T *hash_lookup(const hashtab_T *const ht, const char *const key, const size_t key_len,
const char *const key, const size_t key_len,
const hash_T hash) const hash_T hash)
{ {
#ifdef HT_DEBUG #ifdef HT_DEBUG

View File

@ -3,9 +3,11 @@
// highlight.c: low level code for UI and syntax highlighting // highlight.c: low level code for UI and syntax highlighting
#include "nvim/vim.h" #include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/highlight.h" #include "nvim/highlight.h"
#include "nvim/highlight_defs.h" #include "nvim/highlight_defs.h"
#include "nvim/lua/executor.h"
#include "nvim/map.h" #include "nvim/map.h"
#include "nvim/message.h" #include "nvim/message.h"
#include "nvim/option.h" #include "nvim/option.h"
@ -13,9 +15,7 @@
#include "nvim/screen.h" #include "nvim/screen.h"
#include "nvim/syntax.h" #include "nvim/syntax.h"
#include "nvim/ui.h" #include "nvim/ui.h"
#include "nvim/api/private/defs.h" #include "nvim/vim.h"
#include "nvim/api/private/helpers.h"
#include "nvim/lua/executor.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "highlight.c.generated.h" # include "highlight.c.generated.h"
@ -648,23 +648,23 @@ static int hl_cterm2rgb_color(int nr)
}; };
static char_u ansi_table[16][4] = { static char_u ansi_table[16][4] = {
// R G B idx // R G B idx
{ 0, 0, 0, 1 } , // black { 0, 0, 0, 1 }, // black
{ 224, 0, 0, 2 } , // dark red { 224, 0, 0, 2 }, // dark red
{ 0, 224, 0, 3 } , // dark green { 0, 224, 0, 3 }, // dark green
{ 224, 224, 0, 4 } , // dark yellow / brown { 224, 224, 0, 4 }, // dark yellow / brown
{ 0, 0, 224, 5 } , // dark blue { 0, 0, 224, 5 }, // dark blue
{ 224, 0, 224, 6 } , // dark magenta { 224, 0, 224, 6 }, // dark magenta
{ 0, 224, 224, 7 } , // dark cyan { 0, 224, 224, 7 }, // dark cyan
{ 224, 224, 224, 8 } , // light grey { 224, 224, 224, 8 }, // light grey
{ 128, 128, 128, 9 } , // dark grey { 128, 128, 128, 9 }, // dark grey
{ 255, 64, 64, 10 } , // light red { 255, 64, 64, 10 }, // light red
{ 64, 255, 64, 11 } , // light green { 64, 255, 64, 11 }, // light green
{ 255, 255, 64, 12 } , // yellow { 255, 255, 64, 12 }, // yellow
{ 64, 64, 255, 13 } , // light blue { 64, 64, 255, 13 }, // light blue
{ 255, 64, 255, 14 } , // light magenta { 255, 64, 255, 14 }, // light magenta
{ 64, 255, 255, 15 } , // light cyan { 64, 255, 255, 15 }, // light cyan
{ 255, 255, 255, 16 } , // white { 255, 255, 255, 16 }, // white
}; };
int r = 0; int r = 0;

View File

@ -7,13 +7,14 @@
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/assert.h" #include "nvim/assert.h"
#include "nvim/buffer.h"
#include "nvim/change.h" #include "nvim/change.h"
#include "nvim/indent.h"
#include "nvim/eval.h"
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/cursor.h" #include "nvim/cursor.h"
#include "nvim/mark.h" #include "nvim/eval.h"
#include "nvim/extmark.h" #include "nvim/extmark.h"
#include "nvim/indent.h"
#include "nvim/mark.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/misc1.h" #include "nvim/misc1.h"
@ -25,7 +26,6 @@
#include "nvim/search.h" #include "nvim/search.h"
#include "nvim/strings.h" #include "nvim/strings.h"
#include "nvim/undo.h" #include "nvim/undo.h"
#include "nvim/buffer.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
@ -533,15 +533,14 @@ int get_expr_indent(void)
colnr_T save_curswant; colnr_T save_curswant;
int save_set_curswant; int save_set_curswant;
int save_State; int save_State;
int use_sandbox = was_set_insecurely( int use_sandbox = was_set_insecurely(curwin, (char_u *)"indentexpr", OPT_LOCAL);
curwin, (char_u *)"indentexpr", OPT_LOCAL);
// Save and restore cursor position and curswant, in case it was changed // Save and restore cursor position and curswant, in case it was changed
// * via :normal commands. // * via :normal commands.
save_pos = curwin->w_cursor; save_pos = curwin->w_cursor;
save_curswant = curwin->w_curswant; save_curswant = curwin->w_curswant;
save_set_curswant = curwin->w_set_curswant; save_set_curswant = curwin->w_set_curswant;
set_vim_var_nr(VV_LNUM, (varnumber_T) curwin->w_cursor.lnum); set_vim_var_nr(VV_LNUM, (varnumber_T)curwin->w_cursor.lnum);
if (use_sandbox) { if (use_sandbox) {
sandbox++; sandbox++;

View File

@ -5,16 +5,16 @@
#include <inttypes.h> #include <inttypes.h>
#include <limits.h> #include <limits.h>
#include "nvim/vim.h"
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/keymap.h"
#include "nvim/charset.h" #include "nvim/charset.h"
#include "nvim/memory.h"
#include "nvim/edit.h" #include "nvim/edit.h"
#include "nvim/eval.h" #include "nvim/eval.h"
#include "nvim/keymap.h"
#include "nvim/memory.h"
#include "nvim/message.h" #include "nvim/message.h"
#include "nvim/strings.h"
#include "nvim/mouse.h" #include "nvim/mouse.h"
#include "nvim/strings.h"
#include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "keymap.c.generated.h" # include "keymap.c.generated.h"
@ -51,48 +51,48 @@ static const struct modmasktable {
static char_u modifier_keys_table[] = static char_u modifier_keys_table[] =
{ {
/* mod mask with modifier without modifier */ // mod mask with modifier without modifier
MOD_MASK_SHIFT, '&', '9', '@', '1', /* begin */ MOD_MASK_SHIFT, '&', '9', '@', '1', // begin
MOD_MASK_SHIFT, '&', '0', '@', '2', /* cancel */ MOD_MASK_SHIFT, '&', '0', '@', '2', // cancel
MOD_MASK_SHIFT, '*', '1', '@', '4', /* command */ MOD_MASK_SHIFT, '*', '1', '@', '4', // command
MOD_MASK_SHIFT, '*', '2', '@', '5', /* copy */ MOD_MASK_SHIFT, '*', '2', '@', '5', // copy
MOD_MASK_SHIFT, '*', '3', '@', '6', /* create */ MOD_MASK_SHIFT, '*', '3', '@', '6', // create
MOD_MASK_SHIFT, '*', '4', 'k', 'D', /* delete char */ MOD_MASK_SHIFT, '*', '4', 'k', 'D', // delete char
MOD_MASK_SHIFT, '*', '5', 'k', 'L', /* delete line */ MOD_MASK_SHIFT, '*', '5', 'k', 'L', // delete line
MOD_MASK_SHIFT, '*', '7', '@', '7', /* end */ MOD_MASK_SHIFT, '*', '7', '@', '7', // end
MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_END, '@', '7', /* end */ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_END, '@', '7', // end
MOD_MASK_SHIFT, '*', '9', '@', '9', /* exit */ MOD_MASK_SHIFT, '*', '9', '@', '9', // exit
MOD_MASK_SHIFT, '*', '0', '@', '0', /* find */ MOD_MASK_SHIFT, '*', '0', '@', '0', // find
MOD_MASK_SHIFT, '#', '1', '%', '1', /* help */ MOD_MASK_SHIFT, '#', '1', '%', '1', // help
MOD_MASK_SHIFT, '#', '2', 'k', 'h', /* home */ MOD_MASK_SHIFT, '#', '2', 'k', 'h', // home
MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_HOME, 'k', 'h', /* home */ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_HOME, 'k', 'h', // home
MOD_MASK_SHIFT, '#', '3', 'k', 'I', /* insert */ MOD_MASK_SHIFT, '#', '3', 'k', 'I', // insert
MOD_MASK_SHIFT, '#', '4', 'k', 'l', /* left arrow */ MOD_MASK_SHIFT, '#', '4', 'k', 'l', // left arrow
MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_LEFT, 'k', 'l', /* left arrow */ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_LEFT, 'k', 'l', // left arrow
MOD_MASK_SHIFT, '%', 'a', '%', '3', /* message */ MOD_MASK_SHIFT, '%', 'a', '%', '3', // message
MOD_MASK_SHIFT, '%', 'b', '%', '4', /* move */ MOD_MASK_SHIFT, '%', 'b', '%', '4', // move
MOD_MASK_SHIFT, '%', 'c', '%', '5', /* next */ MOD_MASK_SHIFT, '%', 'c', '%', '5', // next
MOD_MASK_SHIFT, '%', 'd', '%', '7', /* options */ MOD_MASK_SHIFT, '%', 'd', '%', '7', // options
MOD_MASK_SHIFT, '%', 'e', '%', '8', /* previous */ MOD_MASK_SHIFT, '%', 'e', '%', '8', // previous
MOD_MASK_SHIFT, '%', 'f', '%', '9', /* print */ MOD_MASK_SHIFT, '%', 'f', '%', '9', // print
MOD_MASK_SHIFT, '%', 'g', '%', '0', /* redo */ MOD_MASK_SHIFT, '%', 'g', '%', '0', // redo
MOD_MASK_SHIFT, '%', 'h', '&', '3', /* replace */ MOD_MASK_SHIFT, '%', 'h', '&', '3', // replace
MOD_MASK_SHIFT, '%', 'i', 'k', 'r', /* right arr. */ MOD_MASK_SHIFT, '%', 'i', 'k', 'r', // right arr.
MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_RIGHT, 'k', 'r', /* right arr. */ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_RIGHT, 'k', 'r', // right arr.
MOD_MASK_SHIFT, '%', 'j', '&', '5', /* resume */ MOD_MASK_SHIFT, '%', 'j', '&', '5', // resume
MOD_MASK_SHIFT, '!', '1', '&', '6', /* save */ MOD_MASK_SHIFT, '!', '1', '&', '6', // save
MOD_MASK_SHIFT, '!', '2', '&', '7', /* suspend */ MOD_MASK_SHIFT, '!', '2', '&', '7', // suspend
MOD_MASK_SHIFT, '!', '3', '&', '8', /* undo */ MOD_MASK_SHIFT, '!', '3', '&', '8', // undo
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_UP, 'k', 'u', /* up arrow */ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_UP, 'k', 'u', // up arrow
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_DOWN, 'k', 'd', /* down arrow */ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_DOWN, 'k', 'd', // down arrow
/* vt100 F1 */ // vt100 F1
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF1, KS_EXTRA, (int)KE_XF1, MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF1, KS_EXTRA, (int)KE_XF1,
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF2, KS_EXTRA, (int)KE_XF2, MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF2, KS_EXTRA, (int)KE_XF2,
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF3, KS_EXTRA, (int)KE_XF3, MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF3, KS_EXTRA, (int)KE_XF3,
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF4, KS_EXTRA, (int)KE_XF4, MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF4, KS_EXTRA, (int)KE_XF4,
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F1, 'k', '1', /* F1 */ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F1, 'k', '1', // F1
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F2, 'k', '2', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F2, 'k', '2',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F3, 'k', '3', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F3, 'k', '3',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F4, 'k', '4', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F4, 'k', '4',
@ -101,7 +101,7 @@ static char_u modifier_keys_table[] =
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F7, 'k', '7', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F7, 'k', '7',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F8, 'k', '8', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F8, 'k', '8',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F9, 'k', '9', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F9, 'k', '9',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F10, 'k', ';', /* F10 */ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F10, 'k', ';', // F10
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F11, 'F', '1', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F11, 'F', '1',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F12, 'F', '2', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F12, 'F', '2',
@ -133,7 +133,7 @@ static char_u modifier_keys_table[] =
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F36, 'F', 'Q', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F36, 'F', 'Q',
MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F37, 'F', 'R', MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F37, 'F', 'R',
/* TAB pseudo code*/ // TAB pseudo code
MOD_MASK_SHIFT, 'k', 'B', KS_EXTRA, (int)KE_TAB, MOD_MASK_SHIFT, 'k', 'B', KS_EXTRA, (int)KE_TAB,
NUL NUL
@ -397,22 +397,38 @@ int handle_x_keys(const int key)
FUNC_ATTR_CONST FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_CONST FUNC_ATTR_WARN_UNUSED_RESULT
{ {
switch (key) { switch (key) {
case K_XUP: return K_UP; case K_XUP:
case K_XDOWN: return K_DOWN; return K_UP;
case K_XLEFT: return K_LEFT; case K_XDOWN:
case K_XRIGHT: return K_RIGHT; return K_DOWN;
case K_XHOME: return K_HOME; case K_XLEFT:
case K_ZHOME: return K_HOME; return K_LEFT;
case K_XEND: return K_END; case K_XRIGHT:
case K_ZEND: return K_END; return K_RIGHT;
case K_XF1: return K_F1; case K_XHOME:
case K_XF2: return K_F2; return K_HOME;
case K_XF3: return K_F3; case K_ZHOME:
case K_XF4: return K_F4; return K_HOME;
case K_S_XF1: return K_S_F1; case K_XEND:
case K_S_XF2: return K_S_F2; return K_END;
case K_S_XF3: return K_S_F3; case K_ZEND:
case K_S_XF4: return K_S_F4; return K_END;
case K_XF1:
return K_F1;
case K_XF2:
return K_F2;
case K_XF3:
return K_F3;
case K_XF4:
return K_F4;
case K_S_XF1:
return K_S_F1;
case K_S_XF2:
return K_S_F2;
case K_S_XF3:
return K_S_F3;
case K_S_XF4:
return K_S_F4;
} }
return key; return key;
} }
@ -432,17 +448,18 @@ char_u *get_special_key_name(int c, int modifiers)
string[0] = '<'; string[0] = '<';
idx = 1; idx = 1;
/* Key that stands for a normal character. */ // Key that stands for a normal character.
if (IS_SPECIAL(c) && KEY2TERMCAP0(c) == KS_KEY) if (IS_SPECIAL(c) && KEY2TERMCAP0(c) == KS_KEY) {
c = KEY2TERMCAP1(c); c = KEY2TERMCAP1(c);
}
/* /*
* Translate shifted special keys into unshifted keys and set modifier. * Translate shifted special keys into unshifted keys and set modifier.
* Same for CTRL and ALT modifiers. * Same for CTRL and ALT modifiers.
*/ */
if (IS_SPECIAL(c)) { if (IS_SPECIAL(c)) {
for (i = 0; modifier_keys_table[i] != 0; i += MOD_KEYS_ENTRY_SIZE) for (i = 0; modifier_keys_table[i] != 0; i += MOD_KEYS_ENTRY_SIZE) {
if ( KEY2TERMCAP0(c) == (int)modifier_keys_table[i + 1] if (KEY2TERMCAP0(c) == (int)modifier_keys_table[i + 1]
&& (int)KEY2TERMCAP1(c) == (int)modifier_keys_table[i + 2]) { && (int)KEY2TERMCAP1(c) == (int)modifier_keys_table[i + 2]) {
modifiers |= modifier_keys_table[i]; modifiers |= modifier_keys_table[i];
c = TERMCAP2KEY(modifier_keys_table[i + 3], c = TERMCAP2KEY(modifier_keys_table[i + 3],
@ -450,8 +467,9 @@ char_u *get_special_key_name(int c, int modifiers)
break; break;
} }
} }
}
/* try to find the key in the special key table */ // try to find the key in the special key table
table_idx = find_special_key_in_table(c); table_idx = find_special_key_in_table(c);
/* /*
@ -459,14 +477,13 @@ char_u *get_special_key_name(int c, int modifiers)
* extract modifiers. * extract modifiers.
*/ */
if (c > 0 if (c > 0
&& (*mb_char2len)(c) == 1 && (*mb_char2len)(c) == 1) {
) {
if (table_idx < 0 if (table_idx < 0
&& (!vim_isprintc(c) || (c & 0x7f) == ' ') && (!vim_isprintc(c) || (c & 0x7f) == ' ')
&& (c & 0x80)) { && (c & 0x80)) {
c &= 0x7f; c &= 0x7f;
modifiers |= MOD_MASK_ALT; modifiers |= MOD_MASK_ALT;
/* try again, to find the un-alted key in the special key table */ // try again, to find the un-alted key in the special key table
table_idx = find_special_key_in_table(c); table_idx = find_special_key_in_table(c);
} }
if (table_idx < 0 && !vim_isprintc(c) && c < ' ') { if (table_idx < 0 && !vim_isprintc(c) && c < ' ') {
@ -475,15 +492,16 @@ char_u *get_special_key_name(int c, int modifiers)
} }
} }
/* translate the modifier into a string */ // translate the modifier into a string
for (i = 0; mod_mask_table[i].name != 'A'; i++) for (i = 0; mod_mask_table[i].name != 'A'; i++) {
if ((modifiers & mod_mask_table[i].mod_mask) if ((modifiers & mod_mask_table[i].mod_mask)
== mod_mask_table[i].mod_flag) { == mod_mask_table[i].mod_flag) {
string[idx++] = mod_mask_table[i].name; string[idx++] = mod_mask_table[i].name;
string[idx++] = (char_u)'-'; string[idx++] = (char_u)'-';
} }
}
if (table_idx < 0) { /* unknown special key, may output t_xx */ if (table_idx < 0) { // unknown special key, may output t_xx
if (IS_SPECIAL(c)) { if (IS_SPECIAL(c)) {
string[idx++] = 't'; string[idx++] = 't';
string[idx++] = '_'; string[idx++] = '_';
@ -497,10 +515,11 @@ char_u *get_special_key_name(int c, int modifiers)
string[idx++] = (char_u)c; string[idx++] = (char_u)c;
} else { } else {
s = transchar(c); s = transchar(c);
while (*s) while (*s) {
string[idx++] = *s++; string[idx++] = *s++;
} }
} }
}
} else { // use name of special key } else { // use name of special key
size_t len = STRLEN(key_names_table[table_idx].name); size_t len = STRLEN(key_names_table[table_idx].name);
@ -525,9 +544,8 @@ char_u *get_special_key_name(int c, int modifiers)
/// @param[in] in_string Inside a double quoted string /// @param[in] in_string Inside a double quoted string
/// ///
/// @return Number of characters added to dst, zero for no match. /// @return Number of characters added to dst, zero for no match.
unsigned int trans_special(const char_u **srcp, const size_t src_len, unsigned int trans_special(const char_u **srcp, const size_t src_len, char_u *const dst,
char_u *const dst, const bool keycode, const bool keycode, const bool in_string)
const bool in_string)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{ {
int modifiers = 0; int modifiers = 0;
@ -582,9 +600,8 @@ unsigned int special_to_buf(int key, int modifiers, bool keycode, char_u *dst)
/// @param[in] in_string In string, double quote is escaped /// @param[in] in_string In string, double quote is escaped
/// ///
/// @return Key and modifiers or 0 if there is no match. /// @return Key and modifiers or 0 if there is no match.
int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, const bool keycode,
const bool keycode, const bool keep_x_key, const bool keep_x_key, const bool in_string)
const bool in_string)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{ {
const char_u *last_dash; const char_u *last_dash;
@ -641,7 +658,7 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp,
if (bp <= end && *bp == '>') { // found matching '>' if (bp <= end && *bp == '>') { // found matching '>'
end_of_name = bp + 1; end_of_name = bp + 1;
/* Which modifiers are given? */ // Which modifiers are given?
modifiers = 0x0; modifiers = 0x0;
for (bp = src + 1; bp < last_dash; bp++) { for (bp = src + 1; bp < last_dash; bp++) {
if (*bp != '-') { if (*bp != '-') {
@ -795,13 +812,14 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag)
{ {
int i; int i;
for (i = 0; mouse_table[i].pseudo_code; i++) for (i = 0; mouse_table[i].pseudo_code; i++) {
if (code == mouse_table[i].pseudo_code) { if (code == mouse_table[i].pseudo_code) {
*is_click = mouse_table[i].is_click; *is_click = mouse_table[i].is_click;
*is_drag = mouse_table[i].is_drag; *is_drag = mouse_table[i].is_drag;
return mouse_table[i].button; return mouse_table[i].button;
} }
return 0; /* Shouldn't get here */ }
return 0; // Shouldn't get here
} }
/// Replace any terminal code strings with the equivalent internal /// Replace any terminal code strings with the equivalent internal
@ -829,9 +847,8 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag)
/// @return Pointer to an allocated memory in case of success, "from" in case of /// @return Pointer to an allocated memory in case of success, "from" in case of
/// failure. In case of success returned pointer is also saved to /// failure. In case of success returned pointer is also saved to
/// "bufp". /// "bufp".
char_u *replace_termcodes(const char_u *from, const size_t from_len, char_u *replace_termcodes(const char_u *from, const size_t from_len, char_u **bufp,
char_u **bufp, const bool from_part, const bool do_lt, const bool from_part, const bool do_lt, const bool special, int cpo_flags)
const bool special, int cpo_flags)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
ssize_t i; ssize_t i;

View File

@ -17,9 +17,9 @@
#include "auto/config.h" #include "auto/config.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/types.h"
#include "nvim/os/os.h" #include "nvim/os/os.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/types.h"
#define LOG_FILE_ENV "NVIM_LOG_FILE" #define LOG_FILE_ENV "NVIM_LOG_FILE"
@ -124,8 +124,8 @@ void log_unlock(void)
/// @param line_num Source line number, or -1 /// @param line_num Source line number, or -1
/// @param eol Append linefeed "\n" /// @param eol Append linefeed "\n"
/// @param fmt printf-style format string /// @param fmt printf-style format string
bool logmsg(int log_level, const char *context, const char *func_name, bool logmsg(int log_level, const char *context, const char *func_name, int line_num, bool eol,
int line_num, bool eol, const char *fmt, ...) const char *fmt, ...)
FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6, 7) FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6, 7)
{ {
if (log_level < MIN_LOG_LEVEL) { if (log_level < MIN_LOG_LEVEL) {
@ -215,8 +215,7 @@ FILE *open_log_file(void)
} }
#ifdef HAVE_EXECINFO_BACKTRACE #ifdef HAVE_EXECINFO_BACKTRACE
void log_callstack_to_file(FILE *log_file, const char *const func_name, void log_callstack_to_file(FILE *log_file, const char *const func_name, const int line_num)
const int line_num)
{ {
void *trace[100]; void *trace[100];
int trace_size = backtrace(trace, ARRAY_SIZE(trace)); int trace_size = backtrace(trace, ARRAY_SIZE(trace));
@ -268,8 +267,7 @@ end:
#endif #endif
static bool do_log_to_file(FILE *log_file, int log_level, const char *context, static bool do_log_to_file(FILE *log_file, int log_level, const char *context,
const char *func_name, int line_num, bool eol, const char *func_name, int line_num, bool eol, const char *fmt, ...)
const char *fmt, ...)
FUNC_ATTR_PRINTF(7, 8) FUNC_ATTR_PRINTF(7, 8)
{ {
va_list args; va_list args;
@ -281,9 +279,8 @@ static bool do_log_to_file(FILE *log_file, int log_level, const char *context,
return ret; return ret;
} }
static bool v_do_log_to_file(FILE *log_file, int log_level, static bool v_do_log_to_file(FILE *log_file, int log_level, const char *context,
const char *context, const char *func_name, const char *func_name, int line_num, bool eol, const char *fmt,
int line_num, bool eol, const char *fmt,
va_list args) va_list args)
{ {
static const char *log_levels[] = { static const char *log_levels[] = {

View File

@ -260,7 +260,7 @@ int tslua_push_parser(lua_State *L)
return 1; return 1;
} }
static TSParser ** parser_check(lua_State *L, uint16_t index) static TSParser **parser_check(lua_State *L, uint16_t index)
{ {
return luaL_checkudata(L, index, TS_META_PARSER); return luaL_checkudata(L, index, TS_META_PARSER);
} }

View File

@ -1999,7 +1999,7 @@ void mb_check_adjust_col(void *win_)
/// @param line start of the string /// @param line start of the string
/// ///
/// @return a pointer to the character before "*p", if there is one. /// @return a pointer to the character before "*p", if there is one.
char_u * mb_prevptr(char_u *line, char_u *p) char_u *mb_prevptr(char_u *line, char_u *p)
{ {
if (p > line) { if (p > line) {
MB_PTR_BACK(line, p); MB_PTR_BACK(line, p);
@ -2099,7 +2099,7 @@ const char *mb_unescape(const char **const pp)
/* /*
* Skip the Vim specific head of a 'encoding' name. * Skip the Vim specific head of a 'encoding' name.
*/ */
char_u * enc_skip(char_u *p) char_u *enc_skip(char_u *p)
{ {
if (STRNCMP(p, "2byte-", 6) == 0) { if (STRNCMP(p, "2byte-", 6) == 0) {
return p + 6; return p + 6;
@ -2202,7 +2202,7 @@ static int enc_alias_search(char_u *name)
* Get the canonicalized encoding of the current locale. * Get the canonicalized encoding of the current locale.
* Returns an allocated string when successful, NULL when not. * Returns an allocated string when successful, NULL when not.
*/ */
char_u * enc_locale(void) char_u *enc_locale(void)
{ {
int i; int i;
char buf[50]; char buf[50];
@ -2274,7 +2274,7 @@ enc_locale_copy_enc:
* Returns (void *)-1 if failed. * Returns (void *)-1 if failed.
* (should return iconv_t, but that causes problems with prototypes). * (should return iconv_t, but that causes problems with prototypes).
*/ */
void * my_iconv_open(char_u *to, char_u *from) void *my_iconv_open(char_u *to, char_u *from)
{ {
iconv_t fd; iconv_t fd;
#define ICONV_TESTLEN 400 #define ICONV_TESTLEN 400
@ -2501,7 +2501,7 @@ char_u *string_convert(const vimconv_T *const vcp, char_u *ptr, size_t *lenp)
* an incomplete sequence at the end it is not converted and "*unconvlenp" is * an incomplete sequence at the end it is not converted and "*unconvlenp" is
* set to the number of remaining bytes. * set to the number of remaining bytes.
*/ */
char_u * string_convert_ext(const vimconv_T *const vcp, char_u *ptr, size_t *lenp, char_u *string_convert_ext(const vimconv_T *const vcp, char_u *ptr, size_t *lenp,
size_t *unconvlenp) size_t *unconvlenp)
{ {
char_u *retval = NULL; char_u *retval = NULL;

View File

@ -1146,7 +1146,7 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst
/// Like home_replace, store the replaced string in allocated memory. /// Like home_replace, store the replaced string in allocated memory.
/// @param buf When not NULL, check for help files /// @param buf When not NULL, check for help files
/// @param src Input file name /// @param src Input file name
char_u * home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET char_u *home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET
{ {
size_t len = 3; // space for "~/" and trailing NUL size_t len = 3; // space for "~/" and trailing NUL
if (src != NULL) { // just in case if (src != NULL) { // just in case

View File

@ -119,7 +119,7 @@ void signal_accept_deadly(void)
rejecting_deadly = false; rejecting_deadly = false;
} }
static char * signal_name(int signum) static char *signal_name(int signum)
{ {
switch (signum) { switch (signum) {
#ifdef SIGPWR #ifdef SIGPWR

View File

@ -93,7 +93,7 @@ typedef struct hl_group {
static garray_T highlight_ga = GA_EMPTY_INIT_VALUE; static garray_T highlight_ga = GA_EMPTY_INIT_VALUE;
Map(cstr_t, int) highlight_unames = MAP_INIT; Map(cstr_t, int) highlight_unames = MAP_INIT;
static inline struct hl_group * HL_TABLE(void) static inline struct hl_group *HL_TABLE(void)
{ {
return ((struct hl_group *)((highlight_ga.ga_data))); return ((struct hl_group *)((highlight_ga.ga_data)));
} }

View File

@ -7058,13 +7058,13 @@ void win_id2tabwin(typval_T *const argvars, typval_T *const rettv)
tv_list_append_number(list, winnr); tv_list_append_number(list, winnr);
} }
win_T * win_id2wp(typval_T *argvars) win_T *win_id2wp(typval_T *argvars)
{ {
return win_id2wp_tp(argvars, NULL); return win_id2wp_tp(argvars, NULL);
} }
// Return the window and tab pointer of window "id". // Return the window and tab pointer of window "id".
win_T * win_id2wp_tp(typval_T *argvars, tabpage_T **tpp) win_T *win_id2wp_tp(typval_T *argvars, tabpage_T **tpp)
{ {
int id = tv_get_number(&argvars[0]); int id = tv_get_number(&argvars[0]);