From 3b0df1780e2c8526bda5dead18ee7cc45925caba Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Wed, 26 Apr 2023 23:23:44 +0200 Subject: refactor: uncrustify Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`. --- src/nvim/keycodes.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nvim/keycodes.c') diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c index abf31ae344..34442ae5c4 100644 --- a/src/nvim/keycodes.c +++ b/src/nvim/keycodes.c @@ -572,8 +572,8 @@ char *get_special_key_name(int c, int modifiers) /// @param[out] did_simplify found , etc. /// /// @return Number of characters added to dst, zero for no match. -unsigned int trans_special(const char **const srcp, const size_t src_len, char *const dst, - const int flags, const bool escape_ks, bool *const did_simplify) +unsigned trans_special(const char **const srcp, const size_t src_len, char *const dst, + const int flags, const bool escape_ks, bool *const did_simplify) FUNC_ATTR_NONNULL_ARG(1, 3) FUNC_ATTR_WARN_UNUSED_RESULT { int modifiers = 0; @@ -590,9 +590,9 @@ unsigned int trans_special(const char **const srcp, const size_t src_len, char * /// When "escape_ks" is true escape K_SPECIAL bytes in the character. /// The sequence is not NUL terminated. /// This is how characters in a string are encoded. -unsigned int special_to_buf(int key, int modifiers, bool escape_ks, char *dst) +unsigned special_to_buf(int key, int modifiers, bool escape_ks, char *dst) { - unsigned int dlen = 0; + unsigned dlen = 0; // Put the appropriate modifier in a string. if (modifiers != 0) { @@ -608,9 +608,9 @@ unsigned int special_to_buf(int key, int modifiers, bool escape_ks, char *dst) } else if (escape_ks) { char *after = add_char2buf(key, dst + dlen); assert(after >= dst && (uintmax_t)(after - dst) <= UINT_MAX); - dlen = (unsigned int)(after - dst); + dlen = (unsigned)(after - dst); } else { - dlen += (unsigned int)utf_char2bytes(key, dst + dlen); + dlen += (unsigned)utf_char2bytes(key, dst + dlen); } return dlen; -- cgit