Commit 9c88f339 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

w32: Fix some warnings reported by -Wall -Wextra.

* lib-src/ntlib.c: Include <ctype.h>.

* nt/cmdproxy.c: Include <ctype.h>.
  (make_absolute): Remove unused variable `i'.

* src/w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
  (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
  (Fx_close_connection): Remove unused variable `i'.

* src/w32font.c (w32font_draw): Return number of glyphs.
  (w32font_open_internal): Remove unused variable `i'.
  (w32font_driver): Add missing initializer.

* src/w32menu.c (utf8to16): Remove unused variable `utf16'.
  (fill_in_menu): Remove unused variable `items_added'.

* src/w32term.c (last_mouse_press_frame): Remove static global variable.
  (w32_clip_to_row): Remove unused variable `f'.
  (x_delete_terminal): Remove unused variable `i'.

* src/w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
  (NOTHING): Remove unused static global variable.
  (uniscribe_check_otf): Remove unused variable `table'.
  (uniscribe_font_driver): Add missing initializers.
parent def71b5e
2011-03-23 Juanma Barranquero <lekktu@gmail.com>
* ntlib.c: Include <ctype.h>.
2011-03-23 Glenn Morris <rgm@gnu.org> 2011-03-23 Glenn Morris <rgm@gnu.org>
* Makefile.in ($(DESTDIR)${archlibdir}): * Makefile.in ($(DESTDIR)${archlibdir}):
......
...@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ...@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include <ctype.h>
#include "ntlib.h" #include "ntlib.h"
......
2011-03-23 Juanma Barranquero <lekktu@gmail.com>
* cmdproxy.c: Include <ctype.h>.
(make_absolute): Remove unused variable `i'.
2011-02-27 Eli Zaretskii <eliz@gnu.org> 2011-02-27 Eli Zaretskii <eliz@gnu.org>
* inc/unistd.h (readlink, symlink): Declare prototypes. * inc/unistd.h (readlink, symlink): Declare prototypes.
......
...@@ -33,6 +33,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -33,6 +33,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <malloc.h> /* alloca */ #include <malloc.h> /* alloca */
#include <stdlib.h> /* getenv */ #include <stdlib.h> /* getenv */
#include <string.h> /* strlen */ #include <string.h> /* strlen */
#include <ctype.h> /* isspace, isalpha */
/* We don't want to include stdio.h because we are already duplicating /* We don't want to include stdio.h because we are already duplicating
lots of it here */ lots of it here */
...@@ -251,7 +252,6 @@ make_absolute (const char *prog) ...@@ -251,7 +252,6 @@ make_absolute (const char *prog)
char curdir[MAX_PATH]; char curdir[MAX_PATH];
char *p, *path; char *p, *path;
const char *fname; const char *fname;
int i;
/* At least partial absolute path specified; search there. */ /* At least partial absolute path specified; search there. */
if ((isalpha (prog[0]) && prog[1] == ':') || if ((isalpha (prog[0]) && prog[1] == ':') ||
......
2011-03-23 Juanma Barranquero <lekktu@gmail.com>
* w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
(w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
(Fx_close_connection): Remove unused variable `i'.
* w32font.c (w32font_draw): Return number of glyphs.
(w32font_open_internal): Remove unused variable `i'.
(w32font_driver): Add missing initializer.
* w32menu.c (utf8to16): Remove unused variable `utf16'.
(fill_in_menu): Remove unused variable `items_added'.
* w32term.c (last_mouse_press_frame): Remove static global variable.
(w32_clip_to_row): Remove unused variable `f'.
(x_delete_terminal): Remove unused variable `i'.
* w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
(NOTHING): Remove unused static global variable.
(uniscribe_check_otf): Remove unused variable `table'.
(uniscribe_font_driver): Add missing initializers.
2011-03-23 Julien Danjou <julien@danjou.info> 2011-03-23 Julien Danjou <julien@danjou.info>
   
* term.c (Fsuspend_tty, Fresume_tty): * term.c (Fsuspend_tty, Fresume_tty):
...@@ -1527,7 +1527,6 @@ void ...@@ -1527,7 +1527,6 @@ void
x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{ {
int nlines; int nlines;
int olines = FRAME_MENU_BAR_LINES (f);
/* Right now, menu bars don't work properly in minibuf-only frames; /* Right now, menu bars don't work properly in minibuf-only frames;
most of the commands try to apply themselves to the minibuffer most of the commands try to apply themselves to the minibuffer
...@@ -2951,7 +2950,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -2951,7 +2950,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
HIMC context = get_ime_context_fn (hwnd); HIMC context = get_ime_context_fn (hwnd);
wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam); wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
/* Get buffer size. */ /* Get buffer size. */
size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0); size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0);
buffer = alloca (size); buffer = alloca (size);
size = get_composition_string_fn (context, GCS_RESULTSTR, size = get_composition_string_fn (context, GCS_RESULTSTR,
buffer, size); buffer, size);
...@@ -4820,7 +4819,6 @@ If DISPLAY is nil, that stands for the selected frame's display. */) ...@@ -4820,7 +4819,6 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
(Lisp_Object display) (Lisp_Object display)
{ {
struct w32_display_info *dpyinfo = check_x_display_info (display); struct w32_display_info *dpyinfo = check_x_display_info (display);
int i;
if (dpyinfo->reference_count > 0) if (dpyinfo->reference_count > 0)
error ("Display still has frames on it"); error ("Display still has frames on it");
......
...@@ -533,6 +533,7 @@ w32font_draw (struct glyph_string *s, int from, int to, ...@@ -533,6 +533,7 @@ w32font_draw (struct glyph_string *s, int from, int to,
{ {
UINT options; UINT options;
HRGN orig_clip = NULL; HRGN orig_clip = NULL;
int len = to - from;
struct w32font_info *w32font = (struct w32font_info *) s->font; struct w32font_info *w32font = (struct w32font_info *) s->font;
options = w32font->glyph_idx; options = w32font->glyph_idx;
...@@ -581,14 +582,14 @@ w32font_draw (struct glyph_string *s, int from, int to, ...@@ -581,14 +582,14 @@ w32font_draw (struct glyph_string *s, int from, int to,
if (s->padding_p) if (s->padding_p)
{ {
int len = to - from, i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
ExtTextOutW (s->hdc, x + i, y, options, NULL, ExtTextOutW (s->hdc, x + i, y, options, NULL,
s->char2b + from + i, 1, NULL); s->char2b + from + i, 1, NULL);
} }
else else
ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL); ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, len, NULL);
/* Restore clip region. */ /* Restore clip region. */
if (s->num_clips > 0) if (s->num_clips > 0)
...@@ -596,6 +597,8 @@ w32font_draw (struct glyph_string *s, int from, int to, ...@@ -596,6 +597,8 @@ w32font_draw (struct glyph_string *s, int from, int to,
if (orig_clip) if (orig_clip)
DeleteObject (orig_clip); DeleteObject (orig_clip);
return len;
} }
/* w32 implementation of free_entity for font backend. /* w32 implementation of free_entity for font backend.
...@@ -774,7 +777,7 @@ int ...@@ -774,7 +777,7 @@ int
w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
int pixel_size, Lisp_Object font_object) int pixel_size, Lisp_Object font_object)
{ {
int len, size, i; int len, size;
LOGFONT logfont; LOGFONT logfont;
HDC dc; HDC dc;
HFONT hfont, old_font; HFONT hfont, old_font;
...@@ -2418,6 +2421,7 @@ struct font_driver w32font_driver = ...@@ -2418,6 +2421,7 @@ struct font_driver w32font_driver =
NULL, /* check */ NULL, /* check */
NULL, /* get_variation_glyphs */ NULL, /* get_variation_glyphs */
w32font_filter_properties, w32font_filter_properties,
NULL, /* cached_font_ok */
}; };
......
...@@ -1320,7 +1320,6 @@ utf8to16 (unsigned char * src, int len, WCHAR * dest) ...@@ -1320,7 +1320,6 @@ utf8to16 (unsigned char * src, int len, WCHAR * dest)
{ {
while (len > 0) while (len > 0)
{ {
int utf16;
if (*src < 0x80) if (*src < 0x80)
{ {
*dest = (WCHAR) *src; *dest = (WCHAR) *src;
...@@ -1546,8 +1545,6 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) ...@@ -1546,8 +1545,6 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
static int static int
fill_in_menu (HMENU menu, widget_value *wv) fill_in_menu (HMENU menu, widget_value *wv)
{ {
int items_added = 0;
for ( ; wv != NULL; wv = wv->next) for ( ; wv != NULL; wv = wv->next)
{ {
if (wv->contents) if (wv->contents)
......
...@@ -160,7 +160,6 @@ int last_scroll_bar_drag_pos; ...@@ -160,7 +160,6 @@ int last_scroll_bar_drag_pos;
/* Where the mouse was last time we reported a mouse event. */ /* Where the mouse was last time we reported a mouse event. */
static RECT last_mouse_glyph; static RECT last_mouse_glyph;
static FRAME_PTR last_mouse_glyph_frame; static FRAME_PTR last_mouse_glyph_frame;
static Lisp_Object last_mouse_press_frame;
/* The scroll bar in which the last motion event occurred. /* The scroll bar in which the last motion event occurred.
...@@ -4842,7 +4841,6 @@ w32_read_socket (struct terminal *terminal, int expected, ...@@ -4842,7 +4841,6 @@ w32_read_socket (struct terminal *terminal, int expected,
static void static void
w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc) w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc)
{ {
struct frame *f = XFRAME (WINDOW_FRAME (w));
RECT clip_rect; RECT clip_rect;
int window_x, window_y, window_width; int window_x, window_y, window_width;
...@@ -6089,7 +6087,6 @@ static void ...@@ -6089,7 +6087,6 @@ static void
x_delete_terminal (struct terminal *terminal) x_delete_terminal (struct terminal *terminal)
{ {
struct w32_display_info *dpyinfo = terminal->display_info.w32; struct w32_display_info *dpyinfo = terminal->display_info.w32;
int i;
/* Protect against recursive calls. delete_frame in /* Protect against recursive calls. delete_frame in
delete_terminal calls us back when it deletes our last frame. */ delete_terminal calls us back when it deletes our last frame. */
......
...@@ -320,7 +320,7 @@ uniscribe_shape (Lisp_Object lgstring) ...@@ -320,7 +320,7 @@ uniscribe_shape (Lisp_Object lgstring)
} }
if (SUCCEEDED (result)) if (SUCCEEDED (result))
{ {
int j, nclusters, from, to; int j, from, to;
from = 0; from = 0;
to = from; to = from;
...@@ -629,8 +629,6 @@ add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font, ...@@ -629,8 +629,6 @@ add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
STR[4] = '\0'; \ STR[4] = '\0'; \
} while (0) } while (0)
static char* NOTHING = " ";
#define SNAME(VAL) SDATA (SYMBOL_NAME (VAL)) #define SNAME(VAL) SDATA (SYMBOL_NAME (VAL))
/* Check if font supports the otf script/language/features specified. /* Check if font supports the otf script/language/features specified.
...@@ -646,7 +644,6 @@ uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec) ...@@ -646,7 +644,6 @@ uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec)
struct frame * f; struct frame * f;
HDC context; HDC context;
HFONT check_font, old_font; HFONT check_font, old_font;
DWORD table;
int i, retval = 0; int i, retval = 0;
struct gcpro gcpro1; struct gcpro gcpro1;
...@@ -936,7 +933,11 @@ struct font_driver uniscribe_font_driver = ...@@ -936,7 +933,11 @@ struct font_driver uniscribe_font_driver =
NULL, /* otf_drive - use shape instead. */ NULL, /* otf_drive - use shape instead. */
NULL, /* start_for_frame */ NULL, /* start_for_frame */
NULL, /* end_for_frame */ NULL, /* end_for_frame */
uniscribe_shape uniscribe_shape,
NULL, /* check */
NULL, /* get_variation_glyphs */
NULL, /* filter_properties */
NULL, /* cached_font_ok */
}; };
/* Note that this should be called at every startup, not just when dumping, /* Note that this should be called at every startup, not just when dumping,
......
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