diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 6 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 2 | ||||
-rw-r--r-- | src/nvim/fold.c | 4 | ||||
-rw-r--r-- | src/nvim/path.c | 2 | ||||
-rw-r--r-- | src/nvim/regexp.c | 2 | ||||
-rw-r--r-- | src/nvim/spell.c | 18 | ||||
-rw-r--r-- | src/nvim/syntax.c | 4 | ||||
-rw-r--r-- | src/nvim/undo.c | 2 |
9 files changed, 21 insertions, 21 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index cca81e7d94..6b6c3c51a4 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -18397,7 +18397,7 @@ char_u *get_user_func_name(expand_T *xp, int idx) cat_func_name(IObuff, fp); if (xp->xp_context != EXPAND_USER_FUNC) { STRCAT(IObuff, "("); - if (!fp->uf_varargs && fp->uf_args.ga_len == 0) + if (!fp->uf_varargs && GA_EMPTY(&fp->uf_args)) STRCAT(IObuff, ")"); } return IObuff; diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 33fa7c3f30..3f20c59b2b 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -594,7 +594,7 @@ void ex_breakdel(exarg_T *eap) } /* If all breakpoints were removed clear the array. */ - if (gap->ga_len == 0) + if (GA_EMPTY(gap)) ga_clear(gap); } } @@ -607,7 +607,7 @@ void ex_breaklist(exarg_T *eap) struct debuggy *bp; int i; - if (dbg_breakp.ga_len == 0) + if (GA_EMPTY(&dbg_breakp)) MSG(_("No breakpoints defined")); else for (i = 0; i < dbg_breakp.ga_len; ++i) { @@ -670,7 +670,7 @@ debuggy_find ( int prev_got_int; /* Return quickly when there are no breakpoints. */ - if (gap->ga_len == 0) + if (GA_EMPTY(gap)) return (linenr_T)0; /* Replace K_SNR in function name with "<SNR>". */ diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index db9a483040..99915525ae 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4187,7 +4187,7 @@ static int ExpandRTDir(char_u *pat, int *num_file, char_u ***file, char *dirname } free(matches); } - if (ga.ga_len == 0) + if (GA_EMPTY(&ga)) return FAIL; /* Sort and remove duplicates which can happen when specifying multiple diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 8320b905b2..d12d364f49 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1013,7 +1013,7 @@ void cloneFoldGrowArray(garray_T *from, garray_T *to) ga_init(to, from->ga_itemsize, from->ga_growsize); - if (from->ga_len == 0) + if (GA_EMPTY(from)) return; ga_grow(to, from->ga_len); @@ -1302,7 +1302,7 @@ static void deleteFoldEntry(garray_T *gap, int idx, int recursive) fold_T *nfp; fp = (fold_T *)gap->ga_data + idx; - if (recursive || fp->fd_nested.ga_len == 0) { + if (recursive || GA_EMPTY(&fp->fd_nested)) { /* recursively delete the contained folds */ deleteFoldRecurse(&fp->fd_nested); --gap->ga_len; diff --git a/src/nvim/path.c b/src/nvim/path.c index 87c967edbb..7a3c644499 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -893,7 +893,7 @@ expand_in_path ( ga_init(&path_ga, (int)sizeof(char_u *), 1); expand_path_option(curdir, &path_ga); free(curdir); - if (path_ga.ga_len == 0) + if (GA_EMPTY(&path_ga)) return 0; paths = ga_concat_strings(&path_ga); diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 8241770bd3..cade4bd1c1 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -5021,7 +5021,7 @@ regmatch ( /* * If the regstack is empty or something failed we are done. */ - if (regstack.ga_len == 0 || status == RA_FAIL) { + if (GA_EMPTY(®stack) || status == RA_FAIL) { if (scan == NULL) { /* * We get here only if there's trouble -- normally "case END" is diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 659ea65ac2..0f35681546 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -997,7 +997,7 @@ spell_check ( return 1; // Return here when loading language files failed. - if (wp->w_s->b_langp.ga_len == 0) + if (GA_EMPTY(&wp->w_s->b_langp)) return 1; memset(&mi, 0, sizeof(matchinf_T)); @@ -1947,7 +1947,7 @@ spell_valid_case ( static int no_spell_checking(win_T *wp) { if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL - || wp->w_s->b_langp.ga_len == 0) { + || GA_EMPTY(&wp->w_s->b_langp)) { EMSG(_("E756: Spell checking is not enabled")); return TRUE; } @@ -4557,16 +4557,16 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) spell_message(spin, IObuff); // Only do REP lines when not done in another .aff file already. - do_rep = spin->si_rep.ga_len == 0; + do_rep = GA_EMPTY(&spin->si_rep); // Only do REPSAL lines when not done in another .aff file already. - do_repsal = spin->si_repsal.ga_len == 0; + do_repsal = GA_EMPTY(&spin->si_repsal); // Only do SAL lines when not done in another .aff file already. - do_sal = spin->si_sal.ga_len == 0; + do_sal = GA_EMPTY(&spin->si_sal); // Only do MAP lines when not done in another .aff file already. - do_mapline = spin->si_map.ga_len == 0; + do_mapline = GA_EMPTY(&spin->si_map); // Allocate and init the afffile_T structure. aff = (afffile_T *)getroom(spin, sizeof(afffile_T), TRUE); @@ -6938,7 +6938,7 @@ static int write_vim_spell(spellinfo_T *spin, char_u *fname) gap = &spin->si_repsal; // Don't write the section if there are no items. - if (gap->ga_len == 0) + if (GA_EMPTY(gap)) continue; // Sort the REP/REPSAL items. @@ -8691,7 +8691,7 @@ void spell_suggest(int count) spell_find_suggest(line + curwin->w_cursor.col, badlen, &sug, limit, TRUE, need_cap, TRUE); - if (sug.su_ga.ga_len == 0) + if (GA_EMPTY(&sug.su_ga)) MSG(_("Sorry, no suggestions")); else if (count > 0) { if (count > sug.su_ga.ga_len) @@ -11680,7 +11680,7 @@ add_suggestion ( // the first "the" to itself. return; - if (gap->ga_len == 0) + if (GA_EMPTY(gap)) i = -1; else { // Check if the word is already there. Also check the length that is diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 6fc62aed9a..c1fb1d50ba 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -2376,12 +2376,12 @@ static void check_state_ends(void) pop_current_state(); - if (current_state.ga_len == 0) + if (GA_EMPTY(¤t_state)) break; if (had_extend && keepend_level >= 0) { syn_update_ends(FALSE); - if (current_state.ga_len == 0) + if (GA_EMPTY(¤t_state)) break; } diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 439cb9b2a5..4d499cc28e 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -2419,7 +2419,7 @@ void ex_undolist(exarg_T *eap) } } - if (ga.ga_len == 0) + if (GA_EMPTY(&ga)) MSG(_("Nothing to undo")); else { sort_strings((char_u **)ga.ga_data, ga.ga_len); |