Commit 5f75304f authored by Eli Zaretskii's avatar Eli Zaretskii

Avoid compilation warnings

* src/w32fns.c (Fx_file_dialog, w32_parse_and_hook_hot_key):
* src/w32term.c (x_draw_glyph_string):
* src/w32fns.c (compute_tip_xy):
* src/w32font.c (w32font_text_extents):
* src/w32menu.c (set_frame_menubar):
* src/search.c (Freplace_match): Avoid compiler warnings in
optimized builds.
parent 9c2b03fe
...@@ -2630,7 +2630,7 @@ since only regular expressions have distinguished subexpressions. */) ...@@ -2630,7 +2630,7 @@ since only regular expressions have distinguished subexpressions. */)
const unsigned char *add_stuff = NULL; const unsigned char *add_stuff = NULL;
ptrdiff_t add_len = 0; ptrdiff_t add_len = 0;
ptrdiff_t idx = -1; ptrdiff_t idx = -1;
ptrdiff_t begbyte; ptrdiff_t begbyte UNINIT;
if (str_multibyte) if (str_multibyte)
{ {
......
...@@ -7159,7 +7159,7 @@ compute_tip_xy (struct frame *f, ...@@ -7159,7 +7159,7 @@ compute_tip_xy (struct frame *f,
int width, int height, int *root_x, int *root_y) int width, int height, int *root_x, int *root_y)
{ {
Lisp_Object left, top, right, bottom; Lisp_Object left, top, right, bottom;
int min_x, min_y, max_x, max_y; int min_x = 0, min_y, max_x = 0, max_y;
/* User-specified position? */ /* User-specified position? */
left = Fcdr (Fassq (Qleft, parms)); left = Fcdr (Fassq (Qleft, parms));
...@@ -7777,7 +7777,7 @@ value of DIR as in previous invocations; this is standard Windows behavior. */) ...@@ -7777,7 +7777,7 @@ value of DIR as in previous invocations; this is standard Windows behavior. */)
OPENFILENAMEA * file_details_a = &new_file_details_a.details; OPENFILENAMEA * file_details_a = &new_file_details_a.details;
int use_unicode = w32_unicode_filenames; int use_unicode = w32_unicode_filenames;
wchar_t *prompt_w; wchar_t *prompt_w;
char *prompt_a; char *prompt_a UNINIT;
int len; int len;
char fname_ret[MAX_UTF8_PATH]; char fname_ret[MAX_UTF8_PATH];
#endif /* NTGUI_UNICODE */ #endif /* NTGUI_UNICODE */
...@@ -8505,8 +8505,8 @@ w32_parse_and_hook_hot_key (Lisp_Object key, int hook) ...@@ -8505,8 +8505,8 @@ w32_parse_and_hook_hot_key (Lisp_Object key, int hook)
{ {
/* Copied from Fdefine_key and store_in_keymap. */ /* Copied from Fdefine_key and store_in_keymap. */
register Lisp_Object c; register Lisp_Object c;
int vk_code; int vk_code = 0;
int lisp_modifiers; int lisp_modifiers = 0;
int w32_modifiers; int w32_modifiers;
Lisp_Object res = Qnil; Lisp_Object res = Qnil;
char* vkname; char* vkname;
......
...@@ -436,7 +436,7 @@ w32font_text_extents (struct font *font, unsigned *code, ...@@ -436,7 +436,7 @@ w32font_text_extents (struct font *font, unsigned *code,
int i; int i;
HFONT old_font = NULL; HFONT old_font = NULL;
HDC dc = NULL; HDC dc = NULL;
struct frame * f; struct frame * f UNINIT;
int total_width = 0; int total_width = 0;
WORD *wcode; WORD *wcode;
SIZE size; SIZE size;
......
...@@ -267,7 +267,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p) ...@@ -267,7 +267,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
HMENU menubar_widget = f->output_data.w32->menubar_widget; HMENU menubar_widget = f->output_data.w32->menubar_widget;
Lisp_Object items; Lisp_Object items;
widget_value *wv, *first_wv, *prev_wv = 0; widget_value *wv, *first_wv, *prev_wv = 0;
int i, last_i; int i, last_i = 0;
int *submenu_start, *submenu_end; int *submenu_start, *submenu_end;
int *submenu_top_level_items, *submenu_n_panes; int *submenu_top_level_items, *submenu_n_panes;
......
...@@ -2454,7 +2454,7 @@ x_draw_glyph_string (struct glyph_string *s) ...@@ -2454,7 +2454,7 @@ x_draw_glyph_string (struct glyph_string *s)
thickness = font->underline_thickness; thickness = font->underline_thickness;
else else
thickness = 1; thickness = 1;
if (x_underline_at_descent_line) if (x_underline_at_descent_line || !font)
position = (s->height - thickness) - (s->ybase - s->y); position = (s->height - thickness) - (s->ybase - s->y);
else else
{ {
...@@ -2467,9 +2467,9 @@ x_draw_glyph_string (struct glyph_string *s) ...@@ -2467,9 +2467,9 @@ x_draw_glyph_string (struct glyph_string *s)
ROUND (x) = floor (x + 0.5) */ ROUND (x) = floor (x + 0.5) */
if (x_use_underline_position_properties if (x_use_underline_position_properties
&& font && font->underline_position >= 0) && font->underline_position >= 0)
position = font->underline_position; position = font->underline_position;
else if (font) else
position = (font->descent + 1) / 2; position = (font->descent + 1) / 2;
} }
position = max (position, underline_minimum_offset); position = max (position, underline_minimum_offset);
......
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