diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-04-26 23:23:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 23:23:44 +0200 |
commit | 3b0df1780e2c8526bda5dead18ee7cc45925caba (patch) | |
tree | c8415dc986f1cd3ddf6044b4ec0318a089db3ed7 /src/nvim/mapping.c | |
parent | 7d0479c55810af9bf9f115ba69d1419ea81ec41e (diff) | |
download | rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.gz rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.bz2 rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.zip |
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove
`int` from `unsigned int`.
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r-- | src/nvim/mapping.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index f88c0deb87..9a835e0eb8 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -706,7 +706,7 @@ static int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev, hash_end = 256; } for (int hash = hash_start; hash < hash_end && !got_int; hash++) { - mpp = is_abbrev ? abbr_table : &(map_table[hash]); + mpp = is_abbrev ? abbr_table : &(map_table[hash]); for (mp = *mpp; mp != NULL && !got_int; mp = *mpp) { if ((mp->m_mode & mode) == 0) { // skip entries with wrong mode @@ -1112,7 +1112,7 @@ int map_to_exists_mode(const char *const rhs, const int mode, const bool abbr) bool exp_buffer = false; // Do it twice: once for global maps and once for local maps. - for (;;) { + while (true) { for (hash = 0; hash < 256; hash++) { if (abbr) { if (hash > 0) { // There is only one abbr list. @@ -1229,7 +1229,7 @@ char *set_context_in_map_cmd(expand_T *xp, char *cmd, char *arg, bool forceit, b expand_isabbrev = isabbrev; xp->xp_context = EXPAND_MAPPINGS; expand_buffer = false; - for (;;) { + while (true) { if (strncmp(arg, "<buffer>", 8) == 0) { expand_buffer = true; arg = skipwhite(arg + 8); @@ -2322,13 +2322,13 @@ static garray_T langmap_mapga = GA_EMPTY_INIT_VALUE; static void langmap_set_entry(int from, int to) { langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data); - unsigned int a = 0; + unsigned a = 0; assert(langmap_mapga.ga_len >= 0); - unsigned int b = (unsigned int)langmap_mapga.ga_len; + unsigned b = (unsigned)langmap_mapga.ga_len; // Do a binary search for an existing entry. while (a != b) { - unsigned int i = (a + b) / 2; + unsigned i = (a + b) / 2; int d = entries[i].from - from; if (d == 0) { @@ -2347,7 +2347,7 @@ static void langmap_set_entry(int from, int to) // insert new entry at position "a" entries = (langmap_entry_T *)(langmap_mapga.ga_data) + a; memmove(entries + 1, entries, - ((unsigned int)langmap_mapga.ga_len - a) * sizeof(langmap_entry_T)); + ((unsigned)langmap_mapga.ga_len - a) * sizeof(langmap_entry_T)); langmap_mapga.ga_len++; entries[0].from = from; entries[0].to = to; |