emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-26 71a9151: * src/character.c (char_width): Support glyphs wit


From: Robert Pluim
Subject: Re: emacs-26 71a9151: * src/character.c (char_width): Support glyphs with faces. (Bug#32276)
Date: Sun, 29 Jul 2018 12:16:22 +0200

address@hidden (Eli Zaretskii) writes:

> @@ -288,13 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
>        if (VECTORP (disp))
>       for (i = 0, width = 0; i < ASIZE (disp); i++)
>         {
> +         int c;
>           ch = AREF (disp, i);
> -         if (CHARACTERP (ch))
> -           {
> -             int w = CHARACTER_WIDTH (XFASTINT (ch));
> -             if (INT_ADD_WRAPV (width, w, &width))
> -               string_overflow ();
> -           }
> +         if (GLYPH_CODE_P (ch))
> +           c = GLYPH_CODE_CHAR (ch);
> +         else if (CHARACTERP (ch))
> +           c = XFASTINT (ch);
> +         int w = CHARACTER_WIDTH (c);
> +         if (INT_ADD_WRAPV (width, w, &width))
> +           string_overflow ();
>         }
>      }
>    return width;

With gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 
this gives me the following warning:

In file included from character.c:34:0:
character.c: In function ‘char_width’:
lisp.h:1772:11: warning: ‘c’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]
    ? ((a) + (unsigned) 0) op ((b) + (unsigned) 0)   \
           ^
character.c:292:10: note: ‘c’ was declared here
      int c;
          ^



reply via email to

[Prev in Thread] Current Thread [Next in Thread]