diff options
| author | Eli Zaretskii | 2017-09-15 11:46:37 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-09-15 11:46:37 +0300 |
| commit | 015172d1ba36de9ab2ca2cae020b6ab6793dbb8c (patch) | |
| tree | f68751defdad63d9d14462a63d9948d712f7b08d /src | |
| parent | 025e216566312b562bc1b3379e00e97ae539ea5f (diff) | |
| download | emacs-015172d1ba36de9ab2ca2cae020b6ab6793dbb8c.tar.gz emacs-015172d1ba36de9ab2ca2cae020b6ab6793dbb8c.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 1 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | src/unexw32.c | 6 | ||||
| -rw-r--r-- | src/w32term.c | 9 |
4 files changed, 11 insertions, 8 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 2d1df546982..ec9c77ded51 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -386,6 +386,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y | |||
| 386 | Do nothing if MATRIX' size, position, vscroll, and marginal areas | 386 | Do nothing if MATRIX' size, position, vscroll, and marginal areas |
| 387 | haven't changed. This optimization is important because preserving | 387 | haven't changed. This optimization is important because preserving |
| 388 | the matrix means preventing redisplay. */ | 388 | the matrix means preventing redisplay. */ |
| 389 | eassert (w != NULL || matrix->pool != NULL); | ||
| 389 | if (matrix->pool == NULL) | 390 | if (matrix->pool == NULL) |
| 390 | { | 391 | { |
| 391 | left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols); | 392 | left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols); |
diff --git a/src/lisp.h b/src/lisp.h index c5aea9c34cb..c5030824427 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -101,7 +101,8 @@ enum { EMACS_INT_WIDTH = LLONG_WIDTH, EMACS_UINT_WIDTH = ULLONG_WIDTH }; | |||
| 101 | which will cause a warning for %lld etc. */ | 101 | which will cause a warning for %lld etc. */ |
| 102 | # if defined __MINGW32__ \ | 102 | # if defined __MINGW32__ \ |
| 103 | && (!defined __USE_MINGW_ANSI_STDIO \ | 103 | && (!defined __USE_MINGW_ANSI_STDIO \ |
| 104 | || !(GNUC_PREREQ (6, 0, 0) && __MINGW32_MAJOR_VERSION >= 5)) | 104 | || (!defined MINGW_W64 \ |
| 105 | && !(GNUC_PREREQ (6, 0, 0) && __MINGW32_MAJOR_VERSION >= 5))) | ||
| 105 | # define pI "I64" | 106 | # define pI "I64" |
| 106 | # else /* ! MinGW */ | 107 | # else /* ! MinGW */ |
| 107 | # define pI "ll" | 108 | # define pI "ll" |
diff --git a/src/unexw32.c b/src/unexw32.c index d3d6a90f686..0c6b48342e5 100644 --- a/src/unexw32.c +++ b/src/unexw32.c | |||
| @@ -500,8 +500,8 @@ copy_executable_and_dump_data (file_data *p_infile, | |||
| 500 | if (verbose) \ | 500 | if (verbose) \ |
| 501 | { \ | 501 | { \ |
| 502 | printf ("%s\n", (message)); \ | 502 | printf ("%s\n", (message)); \ |
| 503 | printf ("\t0x%"pDWP" Offset in input file.\n", s - p_infile->file_base); \ | 503 | printf ("\t0x%"pDWP" Offset in input file.\n", (DWORD_PTR)(s - p_infile->file_base)); \ |
| 504 | printf ("\t0x%"pDWP" Offset in output file.\n", dst - p_outfile->file_base); \ | 504 | printf ("\t0x%"pDWP" Offset in output file.\n", (DWORD_PTR)(dst - p_outfile->file_base)); \ |
| 505 | printf ("\t0x%"pDWP" Size in bytes.\n", count); \ | 505 | printf ("\t0x%"pDWP" Size in bytes.\n", count); \ |
| 506 | } \ | 506 | } \ |
| 507 | memcpy (dst, s, count); \ | 507 | memcpy (dst, s, count); \ |
| @@ -517,7 +517,7 @@ copy_executable_and_dump_data (file_data *p_infile, | |||
| 517 | printf ("%s\n", (message)); \ | 517 | printf ("%s\n", (message)); \ |
| 518 | printf ("\t0x%p Address in process.\n", s); \ | 518 | printf ("\t0x%p Address in process.\n", s); \ |
| 519 | printf ("\t0x%p Base output file.\n", p_outfile->file_base); \ | 519 | printf ("\t0x%p Base output file.\n", p_outfile->file_base); \ |
| 520 | printf ("\t0x%"pDWP" Offset in output file.\n", dst - p_outfile->file_base); \ | 520 | printf ("\t0x%"pDWP" Offset in output file.\n", (DWORD_PTR)(dst - p_outfile->file_base)); \ |
| 521 | printf ("\t0x%p Address in output file.\n", dst); \ | 521 | printf ("\t0x%p Address in output file.\n", dst); \ |
| 522 | printf ("\t0x%"pDWP" Size in bytes.\n", count); \ | 522 | printf ("\t0x%"pDWP" Size in bytes.\n", count); \ |
| 523 | } \ | 523 | } \ |
diff --git a/src/w32term.c b/src/w32term.c index e62ae7e8426..a7a510b9ecb 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1645,6 +1645,7 @@ w32_setup_relief_color (struct frame *f, struct relief *relief, double factor, | |||
| 1645 | if (w32_alloc_lighter_color (f, &pixel, factor, delta)) | 1645 | if (w32_alloc_lighter_color (f, &pixel, factor, delta)) |
| 1646 | xgcv.foreground = relief->pixel = pixel; | 1646 | xgcv.foreground = relief->pixel = pixel; |
| 1647 | 1647 | ||
| 1648 | xgcv.font = NULL; /* avoid compiler warnings */ | ||
| 1648 | if (relief->gc == 0) | 1649 | if (relief->gc == 0) |
| 1649 | { | 1650 | { |
| 1650 | #if 0 /* TODO: stipple */ | 1651 | #if 0 /* TODO: stipple */ |
| @@ -3087,8 +3088,8 @@ parse_button (int message, int xbutton, int * pbutton, int * pup) | |||
| 3087 | static Lisp_Object | 3088 | static Lisp_Object |
| 3088 | construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f) | 3089 | construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f) |
| 3089 | { | 3090 | { |
| 3090 | int button; | 3091 | int button = 0; |
| 3091 | int up; | 3092 | int up = 0; |
| 3092 | 3093 | ||
| 3093 | parse_button (msg->msg.message, HIWORD (msg->msg.wParam), | 3094 | parse_button (msg->msg.message, HIWORD (msg->msg.wParam), |
| 3094 | &button, &up); | 3095 | &button, &up); |
| @@ -4976,8 +4977,8 @@ w32_read_socket (struct terminal *terminal, | |||
| 4976 | /* If we decide we want to generate an event to be seen | 4977 | /* If we decide we want to generate an event to be seen |
| 4977 | by the rest of Emacs, we put it here. */ | 4978 | by the rest of Emacs, we put it here. */ |
| 4978 | bool tool_bar_p = 0; | 4979 | bool tool_bar_p = 0; |
| 4979 | int button; | 4980 | int button = 0; |
| 4980 | int up; | 4981 | int up = 0; |
| 4981 | 4982 | ||
| 4982 | f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame | 4983 | f = (x_mouse_grabbed (dpyinfo) ? dpyinfo->last_mouse_frame |
| 4983 | : x_window_to_frame (dpyinfo, msg.msg.hwnd)); | 4984 | : x_window_to_frame (dpyinfo, msg.msg.hwnd)); |