diff options
| author | Eli Zaretskii | 2017-09-09 18:50:50 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-09-09 18:50:50 +0300 |
| commit | 2b84c1666274edcb6b810649fa0d6fc09e9e7a66 (patch) | |
| tree | 77c5d68dfc12306eb39b9328a3960eba411562cf /src | |
| parent | e91da7f8f2523057fa93ea4aace36863315abb5b (diff) | |
| download | emacs-2b84c1666274edcb6b810649fa0d6fc09e9e7a66.tar.gz emacs-2b84c1666274edcb6b810649fa0d6fc09e9e7a66.zip | |
Fix compilation warnings in MinGW64 build using GCC 7
Reported by Richard Copley <rcopley@gmail.com>.
* src/w32heap.c (init_heap): Declare enable_lfh only for
mingw.org's MinGW build.
* src/w32console.c (w32con_write_glyphs):
* src/unexw32.c (get_section_info, COPY_CHUNK, unexec): Fix some
mismatches of data type vs format spec.
* src/w32fns.c (compute_tip_xy):
* src/w32proc.c (stop_timer_thread):
* src/w32notify.c (remove_watch):
* src/eval.c (internal_lisp_condition_case):
* src/editfns.c (Ftranslate_region_internal):
* src/data.c (Fmake_variable_buffer_local, cons_to_unsigned)
(cons_to_signed):
* src/buffer.c (fix_overlays_before): Initialize variables to
avoid compiler warnings.
* lib-src/etags.c (TeX_commands, process_file_name): Initialize
variables to avoid compilation warnings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/data.c | 6 | ||||
| -rw-r--r-- | src/editfns.c | 2 | ||||
| -rw-r--r-- | src/eval.c | 2 | ||||
| -rw-r--r-- | src/unexw32.c | 8 | ||||
| -rw-r--r-- | src/w32console.c | 4 | ||||
| -rw-r--r-- | src/w32fns.c | 3 | ||||
| -rw-r--r-- | src/w32heap.c | 2 | ||||
| -rw-r--r-- | src/w32notify.c | 2 | ||||
| -rw-r--r-- | src/w32proc.c | 2 |
10 files changed, 17 insertions, 16 deletions
diff --git a/src/buffer.c b/src/buffer.c index 2d508f35cf6..0827e9ba445 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -3764,7 +3764,7 @@ fix_overlays_before (struct buffer *bp, ptrdiff_t prev, ptrdiff_t pos) | |||
| 3764 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ | 3764 | /* If parent is nil, replace overlays_before; otherwise, parent->next. */ |
| 3765 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; | 3765 | struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair; |
| 3766 | Lisp_Object tem; | 3766 | Lisp_Object tem; |
| 3767 | ptrdiff_t end; | 3767 | ptrdiff_t end = prev; |
| 3768 | 3768 | ||
| 3769 | /* After the insertion, the several overlays may be in incorrect | 3769 | /* After the insertion, the several overlays may be in incorrect |
| 3770 | order. The possibility is that, in the list `overlays_before', | 3770 | order. The possibility is that, in the list `overlays_before', |
diff --git a/src/data.c b/src/data.c index 559844b03fd..87010e3fb28 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1823,7 +1823,7 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1823 | struct Lisp_Symbol *sym; | 1823 | struct Lisp_Symbol *sym; |
| 1824 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1824 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| 1825 | union Lisp_Val_Fwd valcontents; | 1825 | union Lisp_Val_Fwd valcontents; |
| 1826 | bool forwarded; | 1826 | bool forwarded = false; |
| 1827 | 1827 | ||
| 1828 | CHECK_SYMBOL (variable); | 1828 | CHECK_SYMBOL (variable); |
| 1829 | sym = XSYMBOL (variable); | 1829 | sym = XSYMBOL (variable); |
| @@ -2607,7 +2607,7 @@ uintmax_t | |||
| 2607 | cons_to_unsigned (Lisp_Object c, uintmax_t max) | 2607 | cons_to_unsigned (Lisp_Object c, uintmax_t max) |
| 2608 | { | 2608 | { |
| 2609 | bool valid = false; | 2609 | bool valid = false; |
| 2610 | uintmax_t val; | 2610 | uintmax_t val = max; |
| 2611 | if (INTEGERP (c)) | 2611 | if (INTEGERP (c)) |
| 2612 | { | 2612 | { |
| 2613 | valid = XINT (c) >= 0; | 2613 | valid = XINT (c) >= 0; |
| @@ -2661,7 +2661,7 @@ intmax_t | |||
| 2661 | cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) | 2661 | cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) |
| 2662 | { | 2662 | { |
| 2663 | bool valid = false; | 2663 | bool valid = false; |
| 2664 | intmax_t val; | 2664 | intmax_t val = max; |
| 2665 | if (INTEGERP (c)) | 2665 | if (INTEGERP (c)) |
| 2666 | { | 2666 | { |
| 2667 | val = XINT (c); | 2667 | val = XINT (c); |
diff --git a/src/editfns.c b/src/editfns.c index d599fcfec80..95f35549e4e 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3613,7 +3613,7 @@ It returns the number of characters changed. */) | |||
| 3613 | for (; pos < end_pos; ) | 3613 | for (; pos < end_pos; ) |
| 3614 | { | 3614 | { |
| 3615 | register unsigned char *p = BYTE_POS_ADDR (pos_byte); | 3615 | register unsigned char *p = BYTE_POS_ADDR (pos_byte); |
| 3616 | unsigned char *str, buf[MAX_MULTIBYTE_LENGTH]; | 3616 | unsigned char *str = tt, buf[MAX_MULTIBYTE_LENGTH]; |
| 3617 | int len, str_len; | 3617 | int len, str_len; |
| 3618 | int oc; | 3618 | int oc; |
| 3619 | Lisp_Object val; | 3619 | Lisp_Object val; |
diff --git a/src/eval.c b/src/eval.c index e3e7d8e26b2..c2cd6c60ea4 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1226,7 +1226,7 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, | |||
| 1226 | Lisp_Object handlers) | 1226 | Lisp_Object handlers) |
| 1227 | { | 1227 | { |
| 1228 | struct handler *oldhandlerlist = handlerlist; | 1228 | struct handler *oldhandlerlist = handlerlist; |
| 1229 | ptrdiff_t clausenb = 0; | 1229 | volatile ptrdiff_t clausenb = 0; |
| 1230 | 1230 | ||
| 1231 | CHECK_SYMBOL (var); | 1231 | CHECK_SYMBOL (var); |
| 1232 | 1232 | ||
diff --git a/src/unexw32.c b/src/unexw32.c index 904447c3ec9..5259b2a52b0 100644 --- a/src/unexw32.c +++ b/src/unexw32.c | |||
| @@ -357,7 +357,7 @@ get_section_info (file_data *p_infile) | |||
| 357 | /* Check the NT header signature ... */ | 357 | /* Check the NT header signature ... */ |
| 358 | if (nt_header->Signature != IMAGE_NT_SIGNATURE) | 358 | if (nt_header->Signature != IMAGE_NT_SIGNATURE) |
| 359 | { | 359 | { |
| 360 | printf ("Invalid IMAGE_NT_SIGNATURE 0x%x in %s...bailing.\n", | 360 | printf ("Invalid IMAGE_NT_SIGNATURE 0x%lx in %s...bailing.\n", |
| 361 | nt_header->Signature, p_infile->name); | 361 | nt_header->Signature, p_infile->name); |
| 362 | exit (1); | 362 | exit (1); |
| 363 | } | 363 | } |
| @@ -496,7 +496,7 @@ copy_executable_and_dump_data (file_data *p_infile, | |||
| 496 | printf ("%s\n", (message)); \ | 496 | printf ("%s\n", (message)); \ |
| 497 | printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ | 497 | printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ |
| 498 | printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ | 498 | printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ |
| 499 | printf ("\t0x%08x Size in bytes.\n", count); \ | 499 | printf ("\t0x%08lx Size in bytes.\n", count); \ |
| 500 | } \ | 500 | } \ |
| 501 | memcpy (dst, s, count); \ | 501 | memcpy (dst, s, count); \ |
| 502 | dst += count; \ | 502 | dst += count; \ |
| @@ -739,7 +739,7 @@ unexec (const char *new_name, const char *old_name) | |||
| 739 | /* Open the undumped executable file. */ | 739 | /* Open the undumped executable file. */ |
| 740 | if (!open_input_file (&in_file, in_filename)) | 740 | if (!open_input_file (&in_file, in_filename)) |
| 741 | { | 741 | { |
| 742 | printf ("Failed to open %s (%d)...bailing.\n", | 742 | printf ("Failed to open %s (%lu)...bailing.\n", |
| 743 | in_filename, GetLastError ()); | 743 | in_filename, GetLastError ()); |
| 744 | exit (1); | 744 | exit (1); |
| 745 | } | 745 | } |
| @@ -754,7 +754,7 @@ unexec (const char *new_name, const char *old_name) | |||
| 754 | extra_bss_size_static; | 754 | extra_bss_size_static; |
| 755 | if (!open_output_file (&out_file, out_filename, size)) | 755 | if (!open_output_file (&out_file, out_filename, size)) |
| 756 | { | 756 | { |
| 757 | printf ("Failed to open %s (%d)...bailing.\n", | 757 | printf ("Failed to open %s (%lu)...bailing.\n", |
| 758 | out_filename, GetLastError ()); | 758 | out_filename, GetLastError ()); |
| 759 | exit (1); | 759 | exit (1); |
| 760 | } | 760 | } |
diff --git a/src/w32console.c b/src/w32console.c index 8df6379d407..a4c089fa964 100644 --- a/src/w32console.c +++ b/src/w32console.c | |||
| @@ -333,7 +333,7 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string, | |||
| 333 | coding->produced, cursor_coords, | 333 | coding->produced, cursor_coords, |
| 334 | &r)) | 334 | &r)) |
| 335 | { | 335 | { |
| 336 | printf ("Failed writing console attributes: %d\n", | 336 | printf ("Failed writing console attributes: %lu\n", |
| 337 | GetLastError ()); | 337 | GetLastError ()); |
| 338 | fflush (stdout); | 338 | fflush (stdout); |
| 339 | } | 339 | } |
| @@ -343,7 +343,7 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string, | |||
| 343 | coding->produced, cursor_coords, | 343 | coding->produced, cursor_coords, |
| 344 | &r)) | 344 | &r)) |
| 345 | { | 345 | { |
| 346 | printf ("Failed writing console characters: %d\n", | 346 | printf ("Failed writing console characters: %lu\n", |
| 347 | GetLastError ()); | 347 | GetLastError ()); |
| 348 | fflush (stdout); | 348 | fflush (stdout); |
| 349 | } | 349 | } |
diff --git a/src/w32fns.c b/src/w32fns.c index bf3c1d5d303..60682ae3a1a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -4413,7 +4413,6 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 4413 | TranslateMessage (&windows_msg); | 4413 | TranslateMessage (&windows_msg); |
| 4414 | goto dflt; | 4414 | goto dflt; |
| 4415 | } | 4415 | } |
| 4416 | |||
| 4417 | /* Fall through */ | 4416 | /* Fall through */ |
| 4418 | 4417 | ||
| 4419 | case WM_SYSCHAR: | 4418 | case WM_SYSCHAR: |
| @@ -7171,7 +7170,7 @@ compute_tip_xy (struct frame *f, | |||
| 7171 | int width, int height, int *root_x, int *root_y) | 7170 | int width, int height, int *root_x, int *root_y) |
| 7172 | { | 7171 | { |
| 7173 | Lisp_Object left, top, right, bottom; | 7172 | Lisp_Object left, top, right, bottom; |
| 7174 | int min_x = 0, min_y, max_x = 0, max_y; | 7173 | int min_x = 0, min_y = 0, max_x = 0, max_y = 0; |
| 7175 | 7174 | ||
| 7176 | /* User-specified position? */ | 7175 | /* User-specified position? */ |
| 7177 | left = Fcdr (Fassq (Qleft, parms)); | 7176 | left = Fcdr (Fassq (Qleft, parms)); |
diff --git a/src/w32heap.c b/src/w32heap.c index 54de9617494..cd1324cc867 100644 --- a/src/w32heap.c +++ b/src/w32heap.c | |||
| @@ -228,7 +228,9 @@ init_heap (void) | |||
| 228 | { | 228 | { |
| 229 | if (using_dynamic_heap) | 229 | if (using_dynamic_heap) |
| 230 | { | 230 | { |
| 231 | #ifndef MINGW_W64 | ||
| 231 | unsigned long enable_lfh = 2; | 232 | unsigned long enable_lfh = 2; |
| 233 | #endif | ||
| 232 | 234 | ||
| 233 | /* After dumping, use a new private heap. We explicitly enable | 235 | /* After dumping, use a new private heap. We explicitly enable |
| 234 | the low fragmentation heap (LFH) here, for the sake of pre | 236 | the low fragmentation heap (LFH) here, for the sake of pre |
diff --git a/src/w32notify.c b/src/w32notify.c index e8bdef8bdd3..7987d9f6562 100644 --- a/src/w32notify.c +++ b/src/w32notify.c | |||
| @@ -423,7 +423,7 @@ remove_watch (struct notification *dirwatch) | |||
| 423 | { | 423 | { |
| 424 | int i; | 424 | int i; |
| 425 | BOOL status; | 425 | BOOL status; |
| 426 | DWORD exit_code = 0, err; | 426 | DWORD exit_code = 0, err = 0; |
| 427 | 427 | ||
| 428 | /* Only the thread that issued the outstanding I/O call can call | 428 | /* Only the thread that issued the outstanding I/O call can call |
| 429 | CancelIo on it. (CancelIoEx is available only since Vista.) | 429 | CancelIo on it. (CancelIoEx is available only since Vista.) |
diff --git a/src/w32proc.c b/src/w32proc.c index 085995df58a..4459ebe324b 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -485,7 +485,7 @@ stop_timer_thread (int which) | |||
| 485 | struct itimer_data *itimer = | 485 | struct itimer_data *itimer = |
| 486 | (which == ITIMER_REAL) ? &real_itimer : &prof_itimer; | 486 | (which == ITIMER_REAL) ? &real_itimer : &prof_itimer; |
| 487 | int i; | 487 | int i; |
| 488 | DWORD err, exit_code = 255; | 488 | DWORD err = 0, exit_code = 255; |
| 489 | BOOL status; | 489 | BOOL status; |
| 490 | 490 | ||
| 491 | /* Signal the thread that it should terminate. */ | 491 | /* Signal the thread that it should terminate. */ |