diff options
| author | Eli Zaretskii | 2016-05-21 20:06:33 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-05-21 20:06:33 +0300 |
| commit | cb5af79249c2c9e21405e6237db11935b50dd1c5 (patch) | |
| tree | 1f2abf3854f399b16861afaeca9648554b906421 /src/w32term.c | |
| parent | 99848b37d2c3e14c0af45fc6da437a806aa58a80 (diff) | |
| download | emacs-cb5af79249c2c9e21405e6237db11935b50dd1c5.tar.gz emacs-cb5af79249c2c9e21405e6237db11935b50dd1c5.zip | |
Fix compiler warnings in the MinGW build
* configure.ac [mingw32]: Don't add -Wpointer-sign, and add
-Wno-pointer-sign, to keep the noise level down.
* nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
-Wredundant-decls, as that produces a lot of noise due to
redeclaration of time-related functions by gnulib.
* nt/runemacs.c (set_user_model_id): Fix argument type of
'SetCurrentProcessExplicitAppUserModelID'.
* src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
declare 'dpyinfo', as it is unused.
(xpm_load): Fix warnings about pointer signedness.
* src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
prototypes.
(sys_spawnve): Avoid warnings about discarding 'const' qualifier.
(sys_select): Provide prototype.
(g_b_init_compare_string_w): Move declaration to file scope.
* src/w32heap.c (dumped_data_commit): Now static.
(FREEABLE_P): Avoid warnings about pointer comparison with integer.
(mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
* src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
(evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
Provide prototypes.
* src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
redundant prototypes.
(w32_get_internal_run_time, map_w32_filename): Provide prototype.
(init_environment, sys_ctime): Avoid warnings about discarding
'const' qualifier.
Include utimens.h.
(sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
(sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
(sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
prototypes.
(sys_rename_replace): Use %d to avoid compiler warnings.
(_wsa_errlist): Make the message text 'const char *', to avoid
compilation warnings.
(dynlib_reset_last_error): Move prototype to file scope.
(w32_get_resource): First argument is now 'const char *'.
* src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
(otf_features): Second argument is no 'const char *'.
* src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
(x_set_window_size): Remove redundant prototypes.
(XChangeGC, XGetGCValues, w32_draw_underwave)
(w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
(x_calc_absolute_position, x_destroy_window): Now static.
(menubar_selection_callback): Move prototype to file scope.
* src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
declaration.
(w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
(w32font_full_name): Fix warnings about implicit conversion of
'float' to 'double'.
* src/w32reg.c (w32_get_rdb_resource): Fix warnings about
discarding 'const' qualifier.
* src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
(set_frame_menubar): Remove redundant prototypes.
(menubar_selection_callback, w32_menu_display_help): Provide
prototypes.
(simple_dialog_show): Avoid warnings about discarding 'const'
qualifier.
* src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
(free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
(x_set_tool_bar_lines, x_set_internal_border_width): Remove
redundant prototypes.
(current_popup_menu): Remove redundant declaration.
(colormap_t): Member 'name' is now 'const char *'.
(add_system_logical_colors_to_map): Fix signed/unsigned warnings.
(x_decode_color, x_set_border_pixel)
(x_clear_under_internal_border, x_set_name, hook_w32_key)
(reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
static.
(w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
(w32_msg_worker, w32_last_error): Provide prototypes.
(funhook, lookup_vk_code): Avoid warnings about missing
parentheses.
(x_default_font_parameter, Fw32_notification_notify): Avoid
warnings about discarding 'const' qualifier.
(Fx_create_frame): Avoid warnings about empty body of 'else'.
(x_screen_planes): Ifdef away unused function.
(Fx_show_tip): Remove unused variables.
(Fw32_battery_status): Avoid warnings about implicit promotion
from float to double.
(Fw32_notification_notify): Initialize 'timeout'.
* src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
define the TIMER_SETTIME_RUNNING value if it will be used.
* src/w32notify.c (send_notifications): Ifdef away an empty if
clause. Remove unused variable.
(watch_end, watch_completion): Provide prototypes.
* src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
* src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
warning with pointer signedness.
* src/gnutls.c (gnutls_x509_crt_get_signature)
(gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
don't load them from the GnuTLS library, as they are no longer
used.
* src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
define, as it's unused.
* src/unexw32.c (open_input_file, open_output_file)
(close_file_data): Remove redundant prototypes.
(_start): provide prototype.
(mainCRTStartup): Move prototype to file level.
(find_section): Use type-cast to shut up compiler warnings.
(offset_to_section, relocate_offset): Now static.
(find_section): First argument is now a 'const char *'.
(offset_to_section): Ifdef away, as it's unused.
* src/w32heap.h (find_section): Adjust prototype.
* src/dynlib.c (dynlib_reset_last_error): Provide prototype.
* src/dired.c (directory_files_internal_w32_unwind): Avoid
warnings about missing prototypes.
(is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
(directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
signedness.
* src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
Fix warnings about pointer signedness.
* src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
unused.
* src/sysdep.c (_getpid): Remove redundant prototype.
(sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
[!MSDOS]: Don't define 'st', it's unused.
(init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
(str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
* src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
n_to_read, as it is not used.
(MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
* src/w32font.h (syms_of_w32font): Remove redundant prototype.
* src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
* src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
not used by DOS_NT builds, to avoid compiler warnings.
* src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
declaration.
* src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
up compiler warnings.
* src/w32term.h (x_set_window_size, x_get_focus_frame)
(x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
(x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
(x_free_frame_resources, x_real_positions)
(display_x_get_resource): Remove redundant prototypes.
* lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
(sys_rename, gettimeofday): Provide prototypes.
* lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
declarations.
* lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
(xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
(close_winsock, initialize_sockets, w32_set_user_model_id)
(w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
prototypes.
(w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
difference.
(w32_set_user_model_id): Update prototype of
SetCurrentProcessExplicitAppUserModelID to avoid compiler
warnings.
(start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
shut up compiler warnings.
* lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/w32term.c b/src/w32term.c index 14a43c15641..c16c8f4eecc 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -83,8 +83,6 @@ static int any_help_event_p; | |||
| 83 | 83 | ||
| 84 | extern unsigned int msh_mousewheel; | 84 | extern unsigned int msh_mousewheel; |
| 85 | 85 | ||
| 86 | extern void free_frame_menubar (struct frame *); | ||
| 87 | |||
| 88 | extern int w32_codepage_for_font (char *fontname); | 86 | extern int w32_codepage_for_font (char *fontname); |
| 89 | extern Cursor w32_load_cursor (LPCTSTR name); | 87 | extern Cursor w32_load_cursor (LPCTSTR name); |
| 90 | 88 | ||
| @@ -178,9 +176,7 @@ static void w32_define_cursor (Window, Cursor); | |||
| 178 | 176 | ||
| 179 | void x_lower_frame (struct frame *); | 177 | void x_lower_frame (struct frame *); |
| 180 | void x_scroll_bar_clear (struct frame *); | 178 | void x_scroll_bar_clear (struct frame *); |
| 181 | void x_wm_set_size_hint (struct frame *, long, bool); | ||
| 182 | void x_raise_frame (struct frame *); | 179 | void x_raise_frame (struct frame *); |
| 183 | void x_set_window_size (struct frame *, bool, int, int, bool); | ||
| 184 | void x_wm_set_window_state (struct frame *, int); | 180 | void x_wm_set_window_state (struct frame *, int); |
| 185 | void x_wm_set_icon_pixmap (struct frame *, int); | 181 | void x_wm_set_icon_pixmap (struct frame *, int); |
| 186 | static void w32_initialize (void); | 182 | static void w32_initialize (void); |
| @@ -248,7 +244,7 @@ record_event (char *locus, int type) | |||
| 248 | #endif /* 0 */ | 244 | #endif /* 0 */ |
| 249 | 245 | ||
| 250 | 246 | ||
| 251 | void | 247 | static void |
| 252 | XChangeGC (void *ignore, XGCValues *gc, unsigned long mask, | 248 | XChangeGC (void *ignore, XGCValues *gc, unsigned long mask, |
| 253 | XGCValues *xgcv) | 249 | XGCValues *xgcv) |
| 254 | { | 250 | { |
| @@ -270,12 +266,14 @@ XCreateGC (void *ignore, Window window, unsigned long mask, XGCValues *xgcv) | |||
| 270 | return gc; | 266 | return gc; |
| 271 | } | 267 | } |
| 272 | 268 | ||
| 273 | void | 269 | #if 0 /* unused for now, see x_draw_image_glyph_string below */ |
| 270 | static void | ||
| 274 | XGetGCValues (void *ignore, XGCValues *gc, | 271 | XGetGCValues (void *ignore, XGCValues *gc, |
| 275 | unsigned long mask, XGCValues *xgcv) | 272 | unsigned long mask, XGCValues *xgcv) |
| 276 | { | 273 | { |
| 277 | XChangeGC (ignore, xgcv, mask, gc); | 274 | XChangeGC (ignore, xgcv, mask, gc); |
| 278 | } | 275 | } |
| 276 | #endif | ||
| 279 | 277 | ||
| 280 | static void | 278 | static void |
| 281 | w32_set_clip_rectangle (HDC hdc, RECT *rect) | 279 | w32_set_clip_rectangle (HDC hdc, RECT *rect) |
| @@ -321,7 +319,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s) | |||
| 321 | 319 | ||
| 322 | */ | 320 | */ |
| 323 | 321 | ||
| 324 | void | 322 | static void |
| 325 | w32_draw_underwave (struct glyph_string *s, COLORREF color) | 323 | w32_draw_underwave (struct glyph_string *s, COLORREF color) |
| 326 | { | 324 | { |
| 327 | int wave_height = 3, wave_length = 2; | 325 | int wave_height = 3, wave_length = 2; |
| @@ -384,7 +382,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color) | |||
| 384 | } | 382 | } |
| 385 | 383 | ||
| 386 | /* Draw a hollow rectangle at the specified position. */ | 384 | /* Draw a hollow rectangle at the specified position. */ |
| 387 | void | 385 | static void |
| 388 | w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y, | 386 | w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y, |
| 389 | int width, int height) | 387 | int width, int height) |
| 390 | { | 388 | { |
| @@ -2579,7 +2577,7 @@ x_draw_glyph_string (struct glyph_string *s) | |||
| 2579 | 2577 | ||
| 2580 | /* Shift display to make room for inserted glyphs. */ | 2578 | /* Shift display to make room for inserted glyphs. */ |
| 2581 | 2579 | ||
| 2582 | void | 2580 | static void |
| 2583 | w32_shift_glyphs_for_insert (struct frame *f, int x, int y, | 2581 | w32_shift_glyphs_for_insert (struct frame *f, int x, int y, |
| 2584 | int width, int height, int shift_by) | 2582 | int width, int height, int shift_by) |
| 2585 | { | 2583 | { |
| @@ -2876,13 +2874,15 @@ w32_detect_focus_change (struct w32_display_info *dpyinfo, W32Msg *event, | |||
| 2876 | } | 2874 | } |
| 2877 | 2875 | ||
| 2878 | 2876 | ||
| 2877 | #if 0 /* unused */ | ||
| 2879 | /* Handle an event saying the mouse has moved out of an Emacs frame. */ | 2878 | /* Handle an event saying the mouse has moved out of an Emacs frame. */ |
| 2880 | 2879 | ||
| 2881 | void | 2880 | static void |
| 2882 | x_mouse_leave (struct w32_display_info *dpyinfo) | 2881 | x_mouse_leave (struct w32_display_info *dpyinfo) |
| 2883 | { | 2882 | { |
| 2884 | x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame); | 2883 | x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame); |
| 2885 | } | 2884 | } |
| 2885 | #endif | ||
| 2886 | 2886 | ||
| 2887 | /* The focus has changed, or we have redirected a frame's focus to | 2887 | /* The focus has changed, or we have redirected a frame's focus to |
| 2888 | another frame (this happens when a frame uses a surrogate | 2888 | another frame (this happens when a frame uses a surrogate |
| @@ -4550,6 +4550,8 @@ static char dbcs_lead = 0; | |||
| 4550 | recursively with different messages by the system. | 4550 | recursively with different messages by the system. |
| 4551 | */ | 4551 | */ |
| 4552 | 4552 | ||
| 4553 | extern void menubar_selection_callback (struct frame *, void *); | ||
| 4554 | |||
| 4553 | static int | 4555 | static int |
| 4554 | w32_read_socket (struct terminal *terminal, | 4556 | w32_read_socket (struct terminal *terminal, |
| 4555 | struct input_event *hold_quit) | 4557 | struct input_event *hold_quit) |
| @@ -5281,8 +5283,6 @@ w32_read_socket (struct terminal *terminal, | |||
| 5281 | 5283 | ||
| 5282 | if (f) | 5284 | if (f) |
| 5283 | { | 5285 | { |
| 5284 | extern void menubar_selection_callback | ||
| 5285 | (struct frame *f, void * client_data); | ||
| 5286 | menubar_selection_callback (f, (void *)msg.msg.wParam); | 5286 | menubar_selection_callback (f, (void *)msg.msg.wParam); |
| 5287 | } | 5287 | } |
| 5288 | 5288 | ||
| @@ -5899,7 +5899,7 @@ xim_close_dpy (dpyinfo) | |||
| 5899 | /* Calculate the absolute position in frame F | 5899 | /* Calculate the absolute position in frame F |
| 5900 | from its current recorded position values and gravity. */ | 5900 | from its current recorded position values and gravity. */ |
| 5901 | 5901 | ||
| 5902 | void | 5902 | static void |
| 5903 | x_calc_absolute_position (struct frame *f) | 5903 | x_calc_absolute_position (struct frame *f) |
| 5904 | { | 5904 | { |
| 5905 | int flags = f->size_hint_flags; | 5905 | int flags = f->size_hint_flags; |
| @@ -6575,7 +6575,7 @@ x_free_frame_resources (struct frame *f) | |||
| 6575 | 6575 | ||
| 6576 | 6576 | ||
| 6577 | /* Destroy the window of frame F. */ | 6577 | /* Destroy the window of frame F. */ |
| 6578 | void | 6578 | static void |
| 6579 | x_destroy_window (struct frame *f) | 6579 | x_destroy_window (struct frame *f) |
| 6580 | { | 6580 | { |
| 6581 | struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); | 6581 | struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); |