diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/autocmd.c | 3 | ||||
-rw-r--r-- | src/nvim/mark.c | 2 | ||||
-rw-r--r-- | src/nvim/normal.c | 1 | ||||
-rw-r--r-- | src/nvim/option.c | 6 | ||||
-rw-r--r-- | src/nvim/popupmnu.c | 7 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 4 |
6 files changed, 8 insertions, 15 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index a850e5c1a0..dfcdfd8203 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -2428,9 +2428,8 @@ char *aucmd_exec_default_desc(AucmdExecutable acc) default: return NULL; } - - abort(); } + char *aucmd_exec_to_string(AutoCmd *ac, AucmdExecutable acc) { switch (acc.type) { diff --git a/src/nvim/mark.c b/src/nvim/mark.c index 8b29aa3676..b770fef05c 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -630,7 +630,7 @@ static char_u *mark_line(pos_T *mp, int lead_len) if (mp->lnum == 0 || mp->lnum > curbuf->b_ml.ml_line_count) { return vim_strsave((char_u *)"-invalid-"); } - assert(Columns >= 0 && (size_t)Columns <= SIZE_MAX); + assert(Columns >= 0); // Allow for up to 5 bytes per character. s = vim_strnsave(skipwhite(ml_get(mp->lnum)), (size_t)Columns * 5); diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 5c39e9c8bf..0e5e0ab403 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -3568,7 +3568,6 @@ static void nv_zet(cmdarg_T *cap) bool undo = false; int l_p_siso = (int)get_sidescrolloff_value(curwin); - assert(l_p_siso <= INT_MAX); if (ascii_isdigit(nchar)) { /* diff --git a/src/nvim/option.c b/src/nvim/option.c index a0706dfa14..191b635dc0 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5664,12 +5664,10 @@ void comp_col(void) } } assert(sc_col >= 0 - && INT_MIN + sc_col <= Columns - && Columns - sc_col <= INT_MAX); + && INT_MIN + sc_col <= Columns); sc_col = Columns - sc_col; assert(ru_col >= 0 - && INT_MIN + ru_col <= Columns - && Columns - ru_col <= INT_MAX); + && INT_MIN + ru_col <= Columns); ru_col = Columns - ru_col; if (sc_col <= 0) { // screen too narrow, will become a mess sc_col = 1; diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index d7726409b5..e354a589a5 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -289,8 +289,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i if (pum_rl) { pum_width = pum_col - pum_scrollbar + 1; } else { - assert(Columns - pum_col - pum_scrollbar >= INT_MIN - && Columns - pum_col - pum_scrollbar <= INT_MAX); + assert(Columns - pum_col - pum_scrollbar >= 0); pum_width = Columns - pum_col - pum_scrollbar; } @@ -356,7 +355,6 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i } else { pum_col = 0; } - assert(Columns - 1 >= INT_MIN); pum_width = Columns - 1; } else { if (max_width > p_pw) { @@ -367,8 +365,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i if (pum_rl) { pum_col = max_width - 1; } else { - assert(Columns - max_width >= INT_MIN - && Columns - max_width <= INT_MAX); + assert(Columns - max_width >= 0); pum_col = Columns - max_width; } pum_width = max_width - pum_scrollbar; diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 1ad82b7290..79a6b9ed0e 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1475,8 +1475,8 @@ static void tui_guess_size(UI *ui) // 1 - look for non-default 'columns' and 'lines' options during startup if (data->is_starting && (Columns != DFLT_COLS || Rows != DFLT_ROWS)) { did_user_set_dimensions = true; - assert(Columns >= INT_MIN && Columns <= INT_MAX); - assert(Rows >= INT_MIN && Rows <= INT_MAX); + assert(Columns >= 0); + assert(Rows >= 0); width = Columns; height = Rows; goto end; |