]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove encode_terminal_code UNINITs
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Oct 2021 00:52:04 +0000 (17:52 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Oct 2021 00:52:28 +0000 (17:52 -0700)
* 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.

src/term.c

index 7d9fe8cee30c58b316cd944c49d382e70436bb2b..0858f816851418a0eac7ce3abf73761e0f602245 100644 (file)
@@ -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);