diff options
| author | Paul Eggert | 2019-10-18 15:33:13 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-10-18 15:35:15 -0700 |
| commit | f9744a5f09fe3d786de8dfb264598bf4d77ece8c (patch) | |
| tree | b3f9190cbbb85243f7eb88c5cf632ce0c0a09853 /src | |
| parent | f60ed6e3e4f580d9d967fac28e345aca911ca04f (diff) | |
| download | emacs-f9744a5f09fe3d786de8dfb264598bf4d77ece8c.tar.gz emacs-f9744a5f09fe3d786de8dfb264598bf4d77ece8c.zip | |
Pacify x86 GCC 9 in tab bar code
* src/xdisp.c (tty_get_tab_bar_item): Simplify a bit. This
pacifies --enable-gcc-warnings with x86 GCC 9.2.1 20190827
(Red Hat 9.2.1-1) when combined with -fsanitize=undefined.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 457fa4343f1..0d8f9a1edd5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13419,26 +13419,22 @@ static Lisp_Object | |||
| 13419 | tty_get_tab_bar_item (struct frame *f, int x, int *idx, ptrdiff_t *end) | 13419 | tty_get_tab_bar_item (struct frame *f, int x, int *idx, ptrdiff_t *end) |
| 13420 | { | 13420 | { |
| 13421 | ptrdiff_t clen = 0; | 13421 | ptrdiff_t clen = 0; |
| 13422 | Lisp_Object caption; | ||
| 13423 | 13422 | ||
| 13424 | int i, j; | 13423 | for (int i = 0; i < f->n_tab_bar_items; i++) |
| 13425 | for (i = 0, j = 0; i < f->n_tab_bar_items; i++, j += TAB_BAR_ITEM_NSLOTS) | ||
| 13426 | { | 13424 | { |
| 13427 | caption = AREF (f->tab_bar_items, j + TAB_BAR_ITEM_CAPTION); | 13425 | Lisp_Object caption = AREF (f->tab_bar_items, (i * TAB_BAR_ITEM_NSLOTS |
| 13426 | + TAB_BAR_ITEM_CAPTION)); | ||
| 13428 | if (NILP (caption)) | 13427 | if (NILP (caption)) |
| 13429 | return Qnil; | 13428 | return Qnil; |
| 13430 | clen += SCHARS (caption); | 13429 | clen += SCHARS (caption); |
| 13431 | if (x < clen) | 13430 | if (x < clen) |
| 13432 | break; | 13431 | { |
| 13433 | } | 13432 | *idx = i; |
| 13434 | if (i < f->n_tab_bar_items) | 13433 | *end = clen; |
| 13435 | { | 13434 | return caption; |
| 13436 | *idx = i; | 13435 | } |
| 13437 | *end = clen; | ||
| 13438 | return caption; | ||
| 13439 | } | 13436 | } |
| 13440 | else | 13437 | return Qnil; |
| 13441 | return Qnil; | ||
| 13442 | } | 13438 | } |
| 13443 | 13439 | ||
| 13444 | /* Handle a mouse click at X/Y on the tab bar of TTY frame F. If the | 13440 | /* Handle a mouse click at X/Y on the tab bar of TTY frame F. If the |