From: Paul Eggert Date: Mon, 4 Oct 2021 00:52:04 +0000 (-0700) Subject: Remove encode_terminal_code UNINITs X-Git-Tag: emacs-28.0.90~428 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7e871dcd27bdb827573ca97e609632e178e76f64;p=emacs.git Remove encode_terminal_code UNINITs * src/term.c (encode_terminal_code): Clarify by removing a couple of UNINITs and testing the local variable ‘cmp’ instead of retesting src->u.cmp.automatic. This pacifies gcc 11.2.1 -Wanalyzer-null-dereference. --- diff --git a/src/term.c b/src/term.c index 7d9fe8cee30..0858f816851 100644 --- a/src/term.c +++ b/src/term.c @@ -549,13 +549,14 @@ encode_terminal_code (struct glyph *src, int src_len, { if (src->type == COMPOSITE_GLYPH) { - struct composition *cmp UNINIT; - Lisp_Object gstring UNINIT; + struct composition *cmp; + Lisp_Object gstring; int i; nbytes = buf - encode_terminal_src; if (src->u.cmp.automatic) { + cmp = NULL; gstring = composition_gstring_from_id (src->u.cmp.id); required = src->slice.cmp.to - src->slice.cmp.from + 1; } @@ -575,7 +576,7 @@ encode_terminal_code (struct glyph *src, int src_len, buf = encode_terminal_src + nbytes; } - if (src->u.cmp.automatic) + if (!cmp) for (i = src->slice.cmp.from; i <= src->slice.cmp.to; i++) { Lisp_Object g = LGSTRING_GLYPH (gstring, i);