summaryrefslogtreecommitdiff
path: root/src/w32font.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-09-08 11:00:34 +0300
committerEli Zaretskii <eliz@gnu.org>2017-09-08 11:00:34 +0300
commitbe90cd1412c89cae6b2ba41133b888008ee478dc (patch)
tree6ecafcc06f0f9dfca74f3e9615a3c092be1fcb95 /src/w32font.c
parente2a10d7fa8092ef51a3b61a363061e37224e2ca1 (diff)
downloademacs-be90cd1412c89cae6b2ba41133b888008ee478dc.tar.gz
Avoid compiler warnings on MS-Windows with GCC 6 and 7
* src/w32font.c (SUBRANGE): Use unsigned arithmetic for bit-shifting, to avoid compiler warnings. (w32font_text_extents): Tell GCC NGLYPHS is non-negative, to avoid a warning. For details of the warning, see http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html. * src/term.c (keys) [WINDOWSNT]: Don't define, as it is not used in that build. * src/sound.c (sound_perror): Ifdef away on WINDOWSNT, as this function is not used in that build. * configure.ac: Disable -Wsuggest-attribute=format on MS-Windows.
Diffstat (limited to 'src/w32font.c')
-rw-r--r--src/w32font.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/w32font.c b/src/w32font.c
index 314d7acdcc6..98811192029 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -544,6 +544,7 @@ w32font_text_extents (struct font *font, unsigned *code,
information. */
/* Make array big enough to hold surrogates. */
+ eassume (0 <= nglyphs); /* pacify GCC warning on next line */
wcode = alloca (nglyphs * sizeof (WORD) * 2);
for (i = 0; i < nglyphs; i++)
{
@@ -2188,7 +2189,7 @@ font_supported_scripts (FONTSIGNATURE * sig)
/* Match a single subrange. SYM is set if bit N is set in subranges. */
#define SUBRANGE(n,sym) \
- if (subranges[(n) / 32] & (1 << ((n) % 32))) \
+ if (subranges[(n) / 32] & (1U << ((n) % 32))) \
supported = Fcons ((sym), supported)
/* Match multiple subranges. SYM is set if any MASK bit is set in