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.
This commit is contained in:
Eli Zaretskii 2017-05-02 11:04:33 +03:00
parent 9c2b03fe3f
commit 5f75304f61
5 changed files with 10 additions and 10 deletions

View file

@ -2630,7 +2630,7 @@ since only regular expressions have distinguished subexpressions. */)
const unsigned char *add_stuff = NULL;
ptrdiff_t add_len = 0;
ptrdiff_t idx = -1;
ptrdiff_t begbyte;
ptrdiff_t begbyte UNINIT;
if (str_multibyte)
{

View file

@ -7159,7 +7159,7 @@ compute_tip_xy (struct frame *f,
int width, int height, int *root_x, int *root_y)
{
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? */
left = Fcdr (Fassq (Qleft, parms));
@ -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;
int use_unicode = w32_unicode_filenames;
wchar_t *prompt_w;
char *prompt_a;
char *prompt_a UNINIT;
int len;
char fname_ret[MAX_UTF8_PATH];
#endif /* NTGUI_UNICODE */
@ -8505,8 +8505,8 @@ w32_parse_and_hook_hot_key (Lisp_Object key, int hook)
{
/* Copied from Fdefine_key and store_in_keymap. */
register Lisp_Object c;
int vk_code;
int lisp_modifiers;
int vk_code = 0;
int lisp_modifiers = 0;
int w32_modifiers;
Lisp_Object res = Qnil;
char* vkname;

View file

@ -436,7 +436,7 @@ w32font_text_extents (struct font *font, unsigned *code,
int i;
HFONT old_font = NULL;
HDC dc = NULL;
struct frame * f;
struct frame * f UNINIT;
int total_width = 0;
WORD *wcode;
SIZE size;

View file

@ -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;
Lisp_Object items;
widget_value *wv, *first_wv, *prev_wv = 0;
int i, last_i;
int i, last_i = 0;
int *submenu_start, *submenu_end;
int *submenu_top_level_items, *submenu_n_panes;

View file

@ -2454,7 +2454,7 @@ x_draw_glyph_string (struct glyph_string *s)
thickness = font->underline_thickness;
else
thickness = 1;
if (x_underline_at_descent_line)
if (x_underline_at_descent_line || !font)
position = (s->height - thickness) - (s->ybase - s->y);
else
{
@ -2467,9 +2467,9 @@ x_draw_glyph_string (struct glyph_string *s)
ROUND (x) = floor (x + 0.5) */
if (x_use_underline_position_properties
&& font && font->underline_position >= 0)
&& font->underline_position >= 0)
position = font->underline_position;
else if (font)
else
position = (font->descent + 1) / 2;
}
position = max (position, underline_minimum_offset);