aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2011-03-23 17:25:38 +0100
committerJuanma Barranquero2011-03-23 17:25:38 +0100
commit9c88f339493465e8e200b21885f2ac886b299169 (patch)
tree2efb1ad55d59be8f165c5bda002d8303014c489f /src
parentdef71b5e5b9f78a112e52201881aea631b7ebcde (diff)
downloademacs-9c88f339493465e8e200b21885f2ac886b299169.tar.gz
emacs-9c88f339493465e8e200b21885f2ac886b299169.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog22
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32font.c10
-rw-r--r--src/w32menu.c3
-rw-r--r--src/w32term.c3
-rw-r--r--src/w32uniscribe.c11
6 files changed, 36 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f9766115042..b306ff78ff9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12011-03-23 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
4 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
5 (Fx_close_connection): Remove unused variable `i'.
6
7 * w32font.c (w32font_draw): Return number of glyphs.
8 (w32font_open_internal): Remove unused variable `i'.
9 (w32font_driver): Add missing initializer.
10
11 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12 (fill_in_menu): Remove unused variable `items_added'.
13
14 * w32term.c (last_mouse_press_frame): Remove static global variable.
15 (w32_clip_to_row): Remove unused variable `f'.
16 (x_delete_terminal): Remove unused variable `i'.
17
18 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19 (NOTHING): Remove unused static global variable.
20 (uniscribe_check_otf): Remove unused variable `table'.
21 (uniscribe_font_driver): Add missing initializers.
22
12011-03-23 Julien Danjou <julien@danjou.info> 232011-03-23 Julien Danjou <julien@danjou.info>
2 24
3 * term.c (Fsuspend_tty, Fresume_tty): 25 * term.c (Fsuspend_tty, Fresume_tty):
diff --git a/src/w32fns.c b/src/w32fns.c
index 0c899cdceff..d833f9d550f 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1527,7 +1527,6 @@ void
1527x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) 1527x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1528{ 1528{
1529 int nlines; 1529 int nlines;
1530 int olines = FRAME_MENU_BAR_LINES (f);
1531 1530
1532 /* Right now, menu bars don't work properly in minibuf-only frames; 1531 /* Right now, menu bars don't work properly in minibuf-only frames;
1533 most of the commands try to apply themselves to the minibuffer 1532 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 HIMC context = get_ime_context_fn (hwnd); 2950 HIMC context = get_ime_context_fn (hwnd);
2952 wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam); 2951 wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
2953 /* Get buffer size. */ 2952 /* Get buffer size. */
2954 size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0); 2953 size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0);
2955 buffer = alloca (size); 2954 buffer = alloca (size);
2956 size = get_composition_string_fn (context, GCS_RESULTSTR, 2955 size = get_composition_string_fn (context, GCS_RESULTSTR,
2957 buffer, size); 2956 buffer, size);
@@ -4820,7 +4819,6 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
4820 (Lisp_Object display) 4819 (Lisp_Object display)
4821{ 4820{
4822 struct w32_display_info *dpyinfo = check_x_display_info (display); 4821 struct w32_display_info *dpyinfo = check_x_display_info (display);
4823 int i;
4824 4822
4825 if (dpyinfo->reference_count > 0) 4823 if (dpyinfo->reference_count > 0)
4826 error ("Display still has frames on it"); 4824 error ("Display still has frames on it");
diff --git a/src/w32font.c b/src/w32font.c
index 40ff0782b88..d86107bc6d5 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -533,6 +533,7 @@ w32font_draw (struct glyph_string *s, int from, int to,
533{ 533{
534 UINT options; 534 UINT options;
535 HRGN orig_clip = NULL; 535 HRGN orig_clip = NULL;
536 int len = to - from;
536 struct w32font_info *w32font = (struct w32font_info *) s->font; 537 struct w32font_info *w32font = (struct w32font_info *) s->font;
537 538
538 options = w32font->glyph_idx; 539 options = w32font->glyph_idx;
@@ -581,14 +582,14 @@ w32font_draw (struct glyph_string *s, int from, int to,
581 582
582 if (s->padding_p) 583 if (s->padding_p)
583 { 584 {
584 int len = to - from, i; 585 int i;
585 586
586 for (i = 0; i < len; i++) 587 for (i = 0; i < len; i++)
587 ExtTextOutW (s->hdc, x + i, y, options, NULL, 588 ExtTextOutW (s->hdc, x + i, y, options, NULL,
588 s->char2b + from + i, 1, NULL); 589 s->char2b + from + i, 1, NULL);
589 } 590 }
590 else 591 else
591 ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL); 592 ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, len, NULL);
592 593
593 /* Restore clip region. */ 594 /* Restore clip region. */
594 if (s->num_clips > 0) 595 if (s->num_clips > 0)
@@ -596,6 +597,8 @@ w32font_draw (struct glyph_string *s, int from, int to,
596 597
597 if (orig_clip) 598 if (orig_clip)
598 DeleteObject (orig_clip); 599 DeleteObject (orig_clip);
600
601 return len;
599} 602}
600 603
601/* w32 implementation of free_entity for font backend. 604/* w32 implementation of free_entity for font backend.
@@ -774,7 +777,7 @@ int
774w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, 777w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
775 int pixel_size, Lisp_Object font_object) 778 int pixel_size, Lisp_Object font_object)
776{ 779{
777 int len, size, i; 780 int len, size;
778 LOGFONT logfont; 781 LOGFONT logfont;
779 HDC dc; 782 HDC dc;
780 HFONT hfont, old_font; 783 HFONT hfont, old_font;
@@ -2418,6 +2421,7 @@ struct font_driver w32font_driver =
2418 NULL, /* check */ 2421 NULL, /* check */
2419 NULL, /* get_variation_glyphs */ 2422 NULL, /* get_variation_glyphs */
2420 w32font_filter_properties, 2423 w32font_filter_properties,
2424 NULL, /* cached_font_ok */
2421 }; 2425 };
2422 2426
2423 2427
diff --git a/src/w32menu.c b/src/w32menu.c
index a2e62f24f6a..c363fdd72cb 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1320,7 +1320,6 @@ utf8to16 (unsigned char * src, int len, WCHAR * dest)
1320{ 1320{
1321 while (len > 0) 1321 while (len > 0)
1322 { 1322 {
1323 int utf16;
1324 if (*src < 0x80) 1323 if (*src < 0x80)
1325 { 1324 {
1326 *dest = (WCHAR) *src; 1325 *dest = (WCHAR) *src;
@@ -1546,8 +1545,6 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
1546static int 1545static int
1547fill_in_menu (HMENU menu, widget_value *wv) 1546fill_in_menu (HMENU menu, widget_value *wv)
1548{ 1547{
1549 int items_added = 0;
1550
1551 for ( ; wv != NULL; wv = wv->next) 1548 for ( ; wv != NULL; wv = wv->next)
1552 { 1549 {
1553 if (wv->contents) 1550 if (wv->contents)
diff --git a/src/w32term.c b/src/w32term.c
index f31c4e90e77..56454faddb9 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -160,7 +160,6 @@ int last_scroll_bar_drag_pos;
160/* Where the mouse was last time we reported a mouse event. */ 160/* Where the mouse was last time we reported a mouse event. */
161static RECT last_mouse_glyph; 161static RECT last_mouse_glyph;
162static FRAME_PTR last_mouse_glyph_frame; 162static FRAME_PTR last_mouse_glyph_frame;
163static Lisp_Object last_mouse_press_frame;
164 163
165/* The scroll bar in which the last motion event occurred. 164/* The scroll bar in which the last motion event occurred.
166 165
@@ -4842,7 +4841,6 @@ w32_read_socket (struct terminal *terminal, int expected,
4842static void 4841static void
4843w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc) 4842w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc)
4844{ 4843{
4845 struct frame *f = XFRAME (WINDOW_FRAME (w));
4846 RECT clip_rect; 4844 RECT clip_rect;
4847 int window_x, window_y, window_width; 4845 int window_x, window_y, window_width;
4848 4846
@@ -6089,7 +6087,6 @@ static void
6089x_delete_terminal (struct terminal *terminal) 6087x_delete_terminal (struct terminal *terminal)
6090{ 6088{
6091 struct w32_display_info *dpyinfo = terminal->display_info.w32; 6089 struct w32_display_info *dpyinfo = terminal->display_info.w32;
6092 int i;
6093 6090
6094 /* Protect against recursive calls. delete_frame in 6091 /* Protect against recursive calls. delete_frame in
6095 delete_terminal calls us back when it deletes our last frame. */ 6092 delete_terminal calls us back when it deletes our last frame. */
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 39d1ee5c851..f6347bb88f7 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -320,7 +320,7 @@ uniscribe_shape (Lisp_Object lgstring)
320 } 320 }
321 if (SUCCEEDED (result)) 321 if (SUCCEEDED (result))
322 { 322 {
323 int j, nclusters, from, to; 323 int j, from, to;
324 324
325 from = 0; 325 from = 0;
326 to = from; 326 to = from;
@@ -629,8 +629,6 @@ add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
629 STR[4] = '\0'; \ 629 STR[4] = '\0'; \
630 } while (0) 630 } while (0)
631 631
632static char* NOTHING = " ";
633
634#define SNAME(VAL) SDATA (SYMBOL_NAME (VAL)) 632#define SNAME(VAL) SDATA (SYMBOL_NAME (VAL))
635 633
636/* Check if font supports the otf script/language/features specified. 634/* Check if font supports the otf script/language/features specified.
@@ -646,7 +644,6 @@ uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec)
646 struct frame * f; 644 struct frame * f;
647 HDC context; 645 HDC context;
648 HFONT check_font, old_font; 646 HFONT check_font, old_font;
649 DWORD table;
650 int i, retval = 0; 647 int i, retval = 0;
651 struct gcpro gcpro1; 648 struct gcpro gcpro1;
652 649
@@ -936,7 +933,11 @@ struct font_driver uniscribe_font_driver =
936 NULL, /* otf_drive - use shape instead. */ 933 NULL, /* otf_drive - use shape instead. */
937 NULL, /* start_for_frame */ 934 NULL, /* start_for_frame */
938 NULL, /* end_for_frame */ 935 NULL, /* end_for_frame */
939 uniscribe_shape 936 uniscribe_shape,
937 NULL, /* check */
938 NULL, /* get_variation_glyphs */
939 NULL, /* filter_properties */
940 NULL, /* cached_font_ok */
940 }; 941 };
941 942
942/* Note that this should be called at every startup, not just when dumping, 943/* Note that this should be called at every startup, not just when dumping,