From 46a4ce9efbb12a47ca2cb756b271de06180923cd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 10 Jun 2011 12:52:05 -0700 Subject: [PATCH] * window.c: Fix minor problems reported by GCC 4.6.0. (window_deletion_count, delete_deletable_window): Remove; unused. (window_body_lines): Now static. (Fdelete_other_windows_internal): Mark vars as initialized. Make sure 'resize_failed' is initialized. (run_window_configuration_change_hook): Rename local to avoid shadowing. (resize_window_apply): Remove unused local. * window.h (delete_deletable_window): Remove decl. --- src/ChangeLog | 9 +++++++++ src/window.c | 29 +++++++++-------------------- src/window.h | 1 - 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 18f06347c43..60669c3719c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,14 @@ 2011-06-10 Paul Eggert + * window.c: Fix minor problems reported by GCC 4.6.0. + (window_deletion_count, delete_deletable_window): Remove; unused. + (window_body_lines): Now static. + (Fdelete_other_windows_internal): Mark vars as initialized. + Make sure 'resize_failed' is initialized. + (run_window_configuration_change_hook): Rename local to avoid shadowing. + (resize_window_apply): Remove unused local. + * window.h (delete_deletable_window): Remove decl. + * image.c: Fix minor problems reported by GCC 4.6.0. (gif_load, svg_load_image): Rename locals to avoid shadowing. (imagemagick_load_image): Fix pointer signedness problem by changing diff --git a/src/window.c b/src/window.c index 265dafa6b80..3e43d8386b6 100644 --- a/src/window.c +++ b/src/window.c @@ -121,9 +121,6 @@ static int window_initialized; /* Hook to run when window config changes. */ static Lisp_Object Qwindow_configuration_change_hook; -/* Incremented by 1 whenever a window is deleted. */ -static int window_deletion_count; - /* Used by the function window_scroll_pixel_based */ static int window_scroll_pixel_based_preserve_x; static int window_scroll_pixel_based_preserve_y; @@ -614,7 +611,7 @@ WINDOW can be any window and defaults to the selected one. */) /* Return the number of lines of W's body. Don't count any mode or header line of W. */ -int +static int window_body_lines (struct window *w) { int height = XFASTINT (w->total_lines); @@ -1974,14 +1971,6 @@ recombine_windows (Lisp_Object window) } } } - -/* If WINDOW can be deleted, delete it. */ -Lisp_Object -delete_deletable_window (Lisp_Object window) -{ - if (!NILP (call1 (Qwindow_deletable_p, window))) - call1 (Qdelete_window, window); -} /*********************************************************************** Window List @@ -2669,9 +2658,9 @@ window-start value is reasonable when this function is called. */) { struct window *w, *r, *s; struct frame *f; - Lisp_Object sibling, pwindow, swindow, delta; - EMACS_INT startpos; - int top, new_top, resize_failed; + Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; + EMACS_INT startpos IF_LINT (= 0); + int top IF_LINT (= 0), new_top, resize_failed; w = decode_any_window (window); XSETWINDOW (window, w); @@ -2757,10 +2746,10 @@ window-start value is reasonable when this function is called. */) windows_or_buffers_changed++; Vwindow_list = Qnil; FRAME_WINDOW_SIZES_CHANGED (f) = 1; + resize_failed = 0; if (NILP (w->buffer)) { - resize_failed = 0; /* Resize subwindows vertically. */ XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); w->top_line = r->top_line; @@ -3078,12 +3067,12 @@ run_window_configuration_change_hook (struct frame *f) if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook, buffer))) { - int count = SPECPDL_INDEX (); + int inner_count = SPECPDL_INDEX (); record_unwind_protect (select_window_norecord, Fselected_window ()); select_window_norecord (window); run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook, buffer)); - unbind_to (count, Qnil); + unbind_to (inner_count, Qnil); } } } @@ -3617,7 +3606,7 @@ resize_window_check (struct window *w, int horflag) static void resize_window_apply (struct window *w, int horflag) { - struct window *c, *p; + struct window *c; int pos; /* Note: Assigning new_normal requires that the new total size of the @@ -3809,7 +3798,7 @@ resize_frame_windows (struct frame *f, int size, int horflag) DEFUN ("split-window-internal", Fsplit_window_internal, Ssplit_window_internal, 4, 4, 0, doc: /* Split window OLD. Second argument TOTAL-SIZE specifies the number of lines or columns of the -new window. In any case TOTAL-SIZE must be a positive integer +new window. In any case TOTAL-SIZE must be a positive integer Third argument SIDE nil (or `below') specifies that the new window shall be located below WINDOW. SIDE `above' means the new window shall be diff --git a/src/window.h b/src/window.h index 236464775d3..87d0dc8fb23 100644 --- a/src/window.h +++ b/src/window.h @@ -925,7 +925,6 @@ extern void syms_of_window (void); extern void keys_of_window (void); extern void resize_frame_windows (struct frame *, int, int); extern int resize_window_check (struct window *, int); -extern Lisp_Object delete_deletable_window (Lisp_Object); extern Lisp_Object resize_root_window (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -- 2.39.2