Commit 015172d1 authored by Eli Zaretskii's avatar Eli Zaretskii

Avoid compilation warnings with GCC 7 on MS-Windows

* src/w32term.c (w32_setup_relief_color, construct_mouse_click)
(w32_read_socket): Initialize variables to shut up bogus
compilation warnings from GCC 7.
* src/unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Cast to DWORD_PTR
to avoid compiler warnings about printing signed values using %x
format spec.
* src/dispnew.c (adjust_glyph_matrix): Add eassert to avoid
compiler warning about possible NULL pointer dereference.
* src/lisp.h (pI): Tweak the definition some more for MinGW64.
parent 025e2165
...@@ -386,6 +386,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y ...@@ -386,6 +386,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
Do nothing if MATRIX' size, position, vscroll, and marginal areas Do nothing if MATRIX' size, position, vscroll, and marginal areas
haven't changed. This optimization is important because preserving haven't changed. This optimization is important because preserving
the matrix means preventing redisplay. */ the matrix means preventing redisplay. */
eassert (w != NULL || matrix->pool != NULL);
if (matrix->pool == NULL) if (matrix->pool == NULL)
{ {
left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols); left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols);
......
...@@ -101,7 +101,8 @@ enum { EMACS_INT_WIDTH = LLONG_WIDTH, EMACS_UINT_WIDTH = ULLONG_WIDTH }; ...@@ -101,7 +101,8 @@ enum { EMACS_INT_WIDTH = LLONG_WIDTH, EMACS_UINT_WIDTH = ULLONG_WIDTH };
which will cause a warning for %lld etc. */ which will cause a warning for %lld etc. */
# if defined __MINGW32__ \ # if defined __MINGW32__ \
&& (!defined __USE_MINGW_ANSI_STDIO \ && (!defined __USE_MINGW_ANSI_STDIO \
|| !(GNUC_PREREQ (6, 0, 0) && __MINGW32_MAJOR_VERSION >= 5)) || (!defined MINGW_W64 \
&& !(GNUC_PREREQ (6, 0, 0) && __MINGW32_MAJOR_VERSION >= 5)))
# define pI "I64" # define pI "I64"
# else /* ! MinGW */ # else /* ! MinGW */
# define pI "ll" # define pI "ll"
......
...@@ -500,8 +500,8 @@ copy_executable_and_dump_data (file_data *p_infile, ...@@ -500,8 +500,8 @@ copy_executable_and_dump_data (file_data *p_infile,
if (verbose) \ if (verbose) \
{ \ { \
printf ("%s\n", (message)); \ printf ("%s\n", (message)); \
printf ("\t0x%"pDWP" Offset in input file.\n", s - p_infile->file_base); \ printf ("\t0x%"pDWP" Offset in input file.\n", (DWORD_PTR)(s - p_infile->file_base)); \
printf ("\t0x%"pDWP" Offset in output file.\n", dst - p_outfile->file_base); \ printf ("\t0x%"pDWP" Offset in output file.\n", (DWORD_PTR)(dst - p_outfile->file_base)); \
printf ("\t0x%"pDWP" Size in bytes.\n", count); \ printf ("\t0x%"pDWP" Size in bytes.\n", count); \
} \ } \
memcpy (dst, s, count); \ memcpy (dst, s, count); \
...@@ -517,7 +517,7 @@ copy_executable_and_dump_data (file_data *p_infile, ...@@ -517,7 +517,7 @@ copy_executable_and_dump_data (file_data *p_infile,
printf ("%s\n", (message)); \ printf ("%s\n", (message)); \
printf ("\t0x%p Address in process.\n", s); \ printf ("\t0x%p Address in process.\n", s); \
printf ("\t0x%p Base output file.\n", p_outfile->file_base); \ printf ("\t0x%p Base output file.\n", p_outfile->file_base); \
printf ("\t0x%"pDWP" Offset in output file.\n", dst - p_outfile->file_base); \ printf ("\t0x%"pDWP" Offset in output file.\n", (DWORD_PTR)(dst - p_outfile->file_base)); \
printf ("\t0x%p Address in output file.\n", dst); \ printf ("\t0x%p Address in output file.\n", dst); \
printf ("\t0x%"pDWP" Size in bytes.\n", count); \ printf ("\t0x%"pDWP" Size in bytes.\n", count); \
} \ } \
......
...@@ -1645,6 +1645,7 @@ w32_setup_relief_color (struct frame *f, struct relief *relief, double factor, ...@@ -1645,6 +1645,7 @@ w32_setup_relief_color (struct frame *f, struct relief *relief, double factor,
if (w32_alloc_lighter_color (f, &pixel, factor, delta)) if (w32_alloc_lighter_color (f, &pixel, factor, delta))
xgcv.foreground = relief->pixel = pixel; xgcv.foreground = relief->pixel = pixel;
xgcv.font = NULL; /* avoid compiler warnings */
if (relief->gc == 0) if (relief->gc == 0)
{ {
#if 0 /* TODO: stipple */ #if 0 /* TODO: stipple */
...@@ -3087,8 +3088,8 @@ parse_button (int message, int xbutton, int * pbutton, int * pup) ...@@ -3087,8 +3088,8 @@ parse_button (int message, int xbutton, int * pbutton, int * pup)
static Lisp_Object static Lisp_Object
construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f) construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f)
{ {
int button; int button = 0;
int up; int up = 0;
parse_button (msg->msg.message, HIWORD (msg->msg.wParam), parse_button (msg->msg.message, HIWORD (msg->msg.wParam),
&button, &up); &button, &up);
...@@ -4976,8 +4977,8 @@ w32_read_socket (struct terminal *terminal, ...@@ -4976,8 +4977,8 @@ w32_read_socket (struct terminal *terminal,
/* If we decide we want to generate an event to be seen /* If we decide we want to generate an event to be seen
by the rest of Emacs, we put it here. */ by the rest of Emacs, we put it here. */
bool tool_bar_p = 0; bool tool_bar_p = 0;
int button; int button = 0;
int up; int up = 0;
f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame
: x_window_to_frame (dpyinfo, msg.msg.hwnd)); : x_window_to_frame (dpyinfo, msg.msg.hwnd));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment