]> code.delx.au - gnu-emacs/commit
Fix compiler warnings in Cygwin-w32 build
authorKen Brown <kbrown@cornell.edu>
Tue, 21 Jun 2016 03:05:12 +0000 (23:05 -0400)
committerKen Brown <kbrown@cornell.edu>
Tue, 21 Jun 2016 03:05:12 +0000 (23:05 -0400)
commit560c4ab1c32eacc48f62e4176a1e9fb10ac7665b
tree22aa9842a1d770f810634f21a2620b8ab1f8ac44
parentd4c1535c6321318e3ba96a482303bfc790a47266
Fix compiler warnings in Cygwin-w32 build

* src/conf_post.h (DebPrint) [!EMACSDEBUG]: Add empty do-while
loop to avoid compiler warnings about empty body of 'if'
statement.

* src/image.c [HAVE_NTGUI] (DefaultDepthOfScreen): Disable unused
macro.
(x_create_bitmap_from_data): Declare 'frame'.
(x_create_bitmap_from_file): Don't declare unused variable
'dpyinfo'.

* src/lisp.h (AUTO_STRING_WITH_LEN): Avoid initialization to
prevent "jump-misses-init" compiler warnings.

* src/w32fns.c (check_w32_winkey_state): Define and use only if
WINDOWSNT.
(Fx_show_tip): Declare 'f'.
(Fx_file_dialog): Declare 'filter_a' only if not NTGUI_UNICODE.
(w32_strerror): Use format specifier %d for sprintf argument of
type int.
(emacs_abort): Cast sprintf argument of type DWORD to unsigned
int, and use format specifier %x, for compatibility with Cygwin.
(unicode_append_menu) [NTGUI_UNICODE]:
* src/w32menu.c [NTGUI_UNICODE] (get_menu_item_info)
(set_menu_item_info, unicode_append_menu)
(unicode_message_box):
* src/menu.c [NTGUI_UNICODE] (unicode_append_menu): Define as
functions rather than macros to avoid "address will always
evaluate as true" compiler warnings.

* src/w32font.c (w32_to_x_charset): Use format specifier %d for
sprintf argument of type int.

* src/w32term.c (x_draw_glyphless_glyph_string_foreground): Cast
sprintf argument of type int to unsigned int to match %X format
specifier.
(w32_scroll_bar_handle_click):
(w32_horizontal_scroll_bar_handle_click): Declare 'f'.

* src/w32term.h (FRAME_DISPLAY_INFO): Explicitly discard unused
argument.
src/conf_post.h
src/image.c
src/lisp.h
src/menu.c
src/w32fns.c
src/w32font.c
src/w32menu.c
src/w32term.c
src/w32term.h