mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	Merge pull request #17663 from dundargoc/refactor/uncrustify
refactor: apply uncrustify
This commit is contained in:
		| @@ -63,26 +63,26 @@ Array nvim_get_autocmds(Dict(get_autocmds) *opts, Error *err) | ||||
|   int group = 0; | ||||
|  | ||||
|   switch (opts->group.type) { | ||||
|     case kObjectTypeNil: | ||||
|       break; | ||||
|     case kObjectTypeString: | ||||
|       group = augroup_find(opts->group.data.string.data); | ||||
|       if (group < 0) { | ||||
|         api_set_error(err, kErrorTypeValidation, "invalid augroup passed."); | ||||
|         goto cleanup; | ||||
|       } | ||||
|       break; | ||||
|     case kObjectTypeInteger: | ||||
|       group = (int)opts->group.data.integer; | ||||
|       char *name = augroup_name(group); | ||||
|       if (!augroup_exists(name)) { | ||||
|         api_set_error(err, kErrorTypeValidation, "invalid augroup passed."); | ||||
|         goto cleanup; | ||||
|       } | ||||
|       break; | ||||
|     default: | ||||
|       api_set_error(err, kErrorTypeValidation, "group must be a string or an integer."); | ||||
|   case kObjectTypeNil: | ||||
|     break; | ||||
|   case kObjectTypeString: | ||||
|     group = augroup_find(opts->group.data.string.data); | ||||
|     if (group < 0) { | ||||
|       api_set_error(err, kErrorTypeValidation, "invalid augroup passed."); | ||||
|       goto cleanup; | ||||
|     } | ||||
|     break; | ||||
|   case kObjectTypeInteger: | ||||
|     group = (int)opts->group.data.integer; | ||||
|     char *name = augroup_name(group); | ||||
|     if (!augroup_exists(name)) { | ||||
|       api_set_error(err, kErrorTypeValidation, "invalid augroup passed."); | ||||
|       goto cleanup; | ||||
|     } | ||||
|     break; | ||||
|   default: | ||||
|     api_set_error(err, kErrorTypeValidation, "group must be a string or an integer."); | ||||
|     goto cleanup; | ||||
|   } | ||||
|  | ||||
|   if (opts->event.type != kObjectTypeNil) { | ||||
| @@ -415,28 +415,28 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc | ||||
|   bool is_nested = api_object_to_bool(opts->nested, "nested", false, err); | ||||
|  | ||||
|   switch (opts->group.type) { | ||||
|     case kObjectTypeNil: | ||||
|       break; | ||||
|     case kObjectTypeString: | ||||
|       au_group = augroup_find(opts->group.data.string.data); | ||||
|       if (au_group == AUGROUP_ERROR) { | ||||
|         api_set_error(err, | ||||
|                       kErrorTypeValidation, | ||||
|                       "invalid augroup: %s", opts->group.data.string.data); | ||||
|         goto cleanup; | ||||
|       } | ||||
|       break; | ||||
|     case kObjectTypeInteger: | ||||
|       au_group = (int)opts->group.data.integer; | ||||
|       char *name = augroup_name(au_group); | ||||
|       if (!augroup_exists(name)) { | ||||
|         api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group); | ||||
|         goto cleanup; | ||||
|       } | ||||
|       break; | ||||
|     default: | ||||
|       api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer."); | ||||
|   case kObjectTypeNil: | ||||
|     break; | ||||
|   case kObjectTypeString: | ||||
|     au_group = augroup_find(opts->group.data.string.data); | ||||
|     if (au_group == AUGROUP_ERROR) { | ||||
|       api_set_error(err, | ||||
|                     kErrorTypeValidation, | ||||
|                     "invalid augroup: %s", opts->group.data.string.data); | ||||
|       goto cleanup; | ||||
|     } | ||||
|     break; | ||||
|   case kObjectTypeInteger: | ||||
|     au_group = (int)opts->group.data.integer; | ||||
|     char *name = augroup_name(au_group); | ||||
|     if (!augroup_exists(name)) { | ||||
|       api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group); | ||||
|       goto cleanup; | ||||
|     } | ||||
|     break; | ||||
|   default: | ||||
|     api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer."); | ||||
|     goto cleanup; | ||||
|   } | ||||
|  | ||||
|   if (opts->pattern.type != kObjectTypeNil && opts->buffer.type != kObjectTypeNil) { | ||||
| @@ -659,28 +659,28 @@ void nvim_do_autocmd(Object event, Dict(do_autocmd) *opts, Error *err) | ||||
|   } | ||||
|  | ||||
|   switch (opts->group.type) { | ||||
|     case kObjectTypeNil: | ||||
|       break; | ||||
|     case kObjectTypeString: | ||||
|       au_group = augroup_find(opts->group.data.string.data); | ||||
|       if (au_group == AUGROUP_ERROR) { | ||||
|         api_set_error(err, | ||||
|                       kErrorTypeValidation, | ||||
|                       "invalid augroup: %s", opts->group.data.string.data); | ||||
|         goto cleanup; | ||||
|       } | ||||
|       break; | ||||
|     case kObjectTypeInteger: | ||||
|       au_group = (int)opts->group.data.integer; | ||||
|       char *name = augroup_name(au_group); | ||||
|       if (!augroup_exists(name)) { | ||||
|         api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group); | ||||
|         goto cleanup; | ||||
|       } | ||||
|       break; | ||||
|     default: | ||||
|       api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer."); | ||||
|   case kObjectTypeNil: | ||||
|     break; | ||||
|   case kObjectTypeString: | ||||
|     au_group = augroup_find(opts->group.data.string.data); | ||||
|     if (au_group == AUGROUP_ERROR) { | ||||
|       api_set_error(err, | ||||
|                     kErrorTypeValidation, | ||||
|                     "invalid augroup: %s", opts->group.data.string.data); | ||||
|       goto cleanup; | ||||
|     } | ||||
|     break; | ||||
|   case kObjectTypeInteger: | ||||
|     au_group = (int)opts->group.data.integer; | ||||
|     char *name = augroup_name(au_group); | ||||
|     if (!augroup_exists(name)) { | ||||
|       api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group); | ||||
|       goto cleanup; | ||||
|     } | ||||
|     break; | ||||
|   default: | ||||
|     api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer."); | ||||
|     goto cleanup; | ||||
|   } | ||||
|  | ||||
|   if (opts->buffer.type != kObjectTypeNil) { | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
| @@ -723,15 +723,15 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err) | ||||
|     break; | ||||
|   case 2: | ||||
|     switch (numval) { | ||||
|       case 0: | ||||
|       case 1: | ||||
|         rv = BOOLEAN_OBJ(numval); | ||||
|         break; | ||||
|       default: | ||||
|         // Boolean options that return something other than 0 or 1 should return nil. Currently this | ||||
|         // only applies to 'autoread' which uses -1 as a local value to indicate "unset" | ||||
|         rv = NIL; | ||||
|         break; | ||||
|     case 0: | ||||
|     case 1: | ||||
|       rv = BOOLEAN_OBJ(numval); | ||||
|       break; | ||||
|     default: | ||||
|       // Boolean options that return something other than 0 or 1 should return nil. Currently this | ||||
|       // only applies to 'autoread' which uses -1 as a local value to indicate "unset" | ||||
|       rv = NIL; | ||||
|       break; | ||||
|     } | ||||
|     break; | ||||
|   default: | ||||
|   | ||||
| @@ -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); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -87,10 +87,10 @@ EXTERN DecorState decor_state INIT(= { 0 }); | ||||
| static inline bool decor_has_sign(Decoration *decor) | ||||
| { | ||||
|   return decor->sign_text | ||||
|     || decor->sign_hl_id | ||||
|     || decor->number_hl_id | ||||
|     || decor->line_hl_id | ||||
|     || decor->cursorline_hl_id; | ||||
|          || decor->sign_hl_id | ||||
|          || decor->number_hl_id | ||||
|          || decor->line_hl_id | ||||
|          || decor->cursorline_hl_id; | ||||
| } | ||||
|  | ||||
| #ifdef INCLUDE_GENERATED_DECLARATIONS | ||||
|   | ||||
| @@ -2710,7 +2710,7 @@ bool next_for_item(void *fi_void, char_u *arg) | ||||
|     tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len); | ||||
|     fi->fi_byte_idx += len; | ||||
|     const int result | ||||
|         = ex_let_vars(arg, &tv, true, fi->fi_semicolon, fi->fi_varcount, false, NULL) == OK; | ||||
|       = ex_let_vars(arg, &tv, true, fi->fi_semicolon, fi->fi_varcount, false, NULL) == OK; | ||||
|     xfree(tv.vval.v_string); | ||||
|     return result; | ||||
|   } | ||||
|   | ||||
| @@ -7066,10 +7066,12 @@ static void init_srand(uint32_t *const x) | ||||
|   if (dev_urandom_state != OK) { | ||||
|     // Reading /dev/urandom doesn't work, fall back to time(). | ||||
| #endif | ||||
|   // uncrustify:off | ||||
|     *x = time(NULL); | ||||
| #ifndef MSWIN | ||||
|   } | ||||
| #endif | ||||
|   // uncrustify:on | ||||
| } | ||||
|  | ||||
| static inline uint32_t splitmix32(uint32_t *const x) | ||||
|   | ||||
| @@ -1171,10 +1171,10 @@ void callback_put(Callback *cb, typval_T *tv) | ||||
|     func_ref(cb->data.funcref); | ||||
|     break; | ||||
|   case kCallbackLua: | ||||
|     // TODO(tjdevries): Unified Callback. | ||||
|     // At this point this isn't possible, but it'd be nice to put | ||||
|     // these handled more neatly in one place. | ||||
|     // So instead, we just do the default and put nil | ||||
|   // TODO(tjdevries): Unified Callback. | ||||
|   // At this point this isn't possible, but it'd be nice to put | ||||
|   // these handled more neatly in one place. | ||||
|   // So instead, we just do the default and put nil | ||||
|   default: | ||||
|     tv->v_type = VAR_SPECIAL; | ||||
|     tv->vval.v_special = kSpecialVarNull; | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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() | ||||
|   | ||||
| @@ -118,7 +118,7 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col | ||||
|   } | ||||
|  | ||||
|   mtkey_t mark = { { row, col }, ns_id, id, 0, | ||||
|                     mt_flags(right_gravity, decor_level), 0, NULL }; | ||||
|                    mt_flags(right_gravity, decor_level), 0, NULL }; | ||||
|   if (decor_full) { | ||||
|     mark.decor_full = decor; | ||||
|   } else if (decor) { | ||||
|   | ||||
| @@ -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" | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,8 @@ | ||||
|  | ||||
| // fileio.c: read from and write to a file | ||||
|  | ||||
| // uncrustify:off | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <errno.h> | ||||
| #include <fcntl.h> | ||||
|   | ||||
| @@ -820,9 +820,9 @@ 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)) { \ | ||||
|       m = m | flag; \ | ||||
|     } | ||||
|   if (api_object_to_bool(d->name##extra, #name, false, err)) { \ | ||||
|     m = m | flag; \ | ||||
|   } | ||||
|  | ||||
|   CHECK_FLAG(dict, mask, bold, , HL_BOLD); | ||||
|   CHECK_FLAG(dict, mask, standout, , HL_STANDOUT); | ||||
| @@ -907,7 +907,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 | ||||
|   | ||||
| @@ -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" | ||||
|   | ||||
| @@ -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" | ||||
| @@ -139,17 +139,17 @@ static void nlua_luv_error_event(void **argv) | ||||
|   luv_err_t type = (luv_err_t)(intptr_t)argv[1]; | ||||
|   msg_ext_set_kind("lua_error"); | ||||
|   switch (type) { | ||||
|     case kCallback: | ||||
|       semsg_multiline("Error executing luv callback:\n%s", error); | ||||
|       break; | ||||
|     case kThread: | ||||
|       semsg_multiline("Error in luv thread:\n%s", error); | ||||
|       break; | ||||
|     case kThreadCallback: | ||||
|       semsg_multiline("Error in luv callback, thread:\n%s", error); | ||||
|       break; | ||||
|     default: | ||||
|       break; | ||||
|   case kCallback: | ||||
|     semsg_multiline("Error executing luv callback:\n%s", error); | ||||
|     break; | ||||
|   case kThread: | ||||
|     semsg_multiline("Error in luv thread:\n%s", error); | ||||
|     break; | ||||
|   case kThreadCallback: | ||||
|     semsg_multiline("Error in luv callback, thread:\n%s", error); | ||||
|     break; | ||||
|   default: | ||||
|     break; | ||||
|   } | ||||
|   xfree(error); | ||||
| } | ||||
| @@ -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; | ||||
| @@ -228,9 +225,9 @@ static int nlua_luv_thread_common_cfpcall(lua_State *lstate, int nargs, int nres | ||||
|       mch_errmsg("\n"); | ||||
|       lua_close(lstate); | ||||
| #ifdef WIN32 | ||||
|     ExitThread(0); | ||||
|       ExitThread(0); | ||||
| #else | ||||
|     pthread_exit(0); | ||||
|       pthread_exit(0); | ||||
| #endif | ||||
|     } | ||||
|     const char *error = lua_tostring(lstate, -1); | ||||
| @@ -565,9 +562,9 @@ static bool nlua_init_packages(lua_State *lstate) | ||||
|   lua_getglobal(lstate, "require"); | ||||
|   lua_pushstring(lstate, "vim._init_packages"); | ||||
|   if (nlua_pcall(lstate, 1, 0)) { | ||||
|       mch_errmsg(lua_tostring(lstate, -1)); | ||||
|       mch_errmsg("\n"); | ||||
|       return false; | ||||
|     mch_errmsg(lua_tostring(lstate, -1)); | ||||
|     mch_errmsg("\n"); | ||||
|     return false; | ||||
|   } | ||||
|  | ||||
|   return true; | ||||
|   | ||||
| @@ -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" | ||||
| @@ -16,9 +16,9 @@ | ||||
| void nlua_add_api_functions(lua_State *lstate) REAL_FATTR_NONNULL_ALL; | ||||
|  | ||||
| typedef struct { | ||||
|   LuaRef         nil_ref; | ||||
|   LuaRef         empty_dict_ref; | ||||
|   int            ref_count; | ||||
|   LuaRef nil_ref; | ||||
|   LuaRef empty_dict_ref; | ||||
|   int ref_count; | ||||
| #if __has_feature(address_sanitizer) | ||||
|   PMap(handle_T) ref_markers; | ||||
| #endif | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
| @@ -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" | ||||
| @@ -411,7 +411,7 @@ int nlua_getvar(lua_State *lstate) | ||||
|   dictitem_T *di = tv_dict_find(dict, name, (ptrdiff_t)len); | ||||
|   if (di == NULL && dict == &globvardict) {  // try to autoload script | ||||
|     if (!script_autoload(name, len, false) || aborting()) { | ||||
|        return 0;  // nil | ||||
|       return 0;  // nil | ||||
|     } | ||||
|     di = tv_dict_find(dict, name, (ptrdiff_t)len); | ||||
|   } | ||||
|   | ||||
| @@ -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)); | ||||
| @@ -1111,7 +1111,7 @@ static void marktree_itr_fix_pos(MarkTree *b, MarkTreeIter *itr) | ||||
| void marktree_put_test(MarkTree *b, uint32_t id, int row, int col, bool right_gravity) | ||||
| { | ||||
|   mtkey_t key = { { row, col }, UINT32_MAX, id, 0, | ||||
|                     mt_flags(right_gravity, 0), 0, NULL }; | ||||
|                   mt_flags(right_gravity, 0), 0, NULL }; | ||||
|   marktree_put(b, key, -1, -1, false); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
| @@ -16,11 +16,11 @@ | ||||
| #elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) | ||||
| # include <util.h> | ||||
| #elif defined(__sun) | ||||
| #  include <sys/stream.h> | ||||
| #  include <sys/syscall.h> | ||||
| #  include <fcntl.h> | ||||
| #  include <unistd.h> | ||||
| #  include <signal.h> | ||||
| # include <fcntl.h> | ||||
| # include <signal.h> | ||||
| # include <sys/stream.h> | ||||
| # include <sys/syscall.h> | ||||
| # include <unistd.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) { | ||||
|   | ||||
| @@ -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" | ||||
|  | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -4578,9 +4578,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. | ||||
|   | ||||
| @@ -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" | ||||
| @@ -5048,8 +5048,8 @@ bool fuzzy_match(char_u *const str, const char_u *const pat_arg, const bool matc | ||||
|     int score = 0; | ||||
|     int recursionCount = 0; | ||||
|     const int matchCount | ||||
|         = fuzzy_match_recursive(pat, str, 0, &score, str, len, NULL, matches + numMatches, | ||||
|                                 maxMatches - numMatches, 0, &recursionCount); | ||||
|       = fuzzy_match_recursive(pat, str, 0, &score, str, len, NULL, matches + numMatches, | ||||
|                               maxMatches - numMatches, 0, &recursionCount); | ||||
|     if (matchCount == 0) { | ||||
|       numMatches = 0; | ||||
|       break; | ||||
|   | ||||
| @@ -217,9 +217,9 @@ enum { FOLD_TEXT_LEN = 51, };  //!< buffer size for get_foldtext() | ||||
|  | ||||
| #define STRLEN(s)           strlen((char *)(s)) | ||||
| #ifdef HAVE_STRNLEN | ||||
| #  define STRNLEN(s, n)     strnlen((char *)(s), (size_t)(n)) | ||||
| # define STRNLEN(s, n)     strnlen((char *)(s), (size_t)(n)) | ||||
| #else | ||||
| #  define STRNLEN(s, n)     xstrnlen((char *)(s), (size_t)(n)) | ||||
| # define STRNLEN(s, n)     xstrnlen((char *)(s), (size_t)(n)) | ||||
| #endif | ||||
| #define STRCPY(d, s)        strcpy((char *)(d), (char *)(s)) | ||||
| #define STRNCPY(d, s, n)    strncpy((char *)(d), (char *)(s), (size_t)(n)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bfredl
					bfredl