aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorPaul Eggert2011-06-10 13:38:18 -0700
committerPaul Eggert2011-06-10 13:38:18 -0700
commit109e28d0b3eaeaa92ef2030e2ef3b18462702e58 (patch)
tree053e1c745c02f4ad659484ab80e0480f75465d35 /src/window.c
parent529a133c390049085db38e7c8f745d650a2626ee (diff)
parent60737f02aa2e76f7d1183158fa8d0a7d4aa89f64 (diff)
downloademacs-109e28d0b3eaeaa92ef2030e2ef3b18462702e58.tar.gz
emacs-109e28d0b3eaeaa92ef2030e2ef3b18462702e58.zip
Merge: Fix minor problems found by static checking.
* image.c (PixelGetMagickColor): Declare if ImageMagick headers don't. Make identifiers static if they are not used in other modules. * data.c (Qcompiled_function, Qframe, Qvector): * image.c (QimageMagick, Qsvg): * minibuf.c (Qmetadata): * window.c (resize_window_check, resize_root_window): Now static. * window.h (resize_window_check, resize_root_window): Remove decls. * window.c (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 (gif_load, svg_load_image): Rename locals to avoid shadowing. (imagemagick_load_image): Fix pointer signedness problem by changing last arg from unsigned char * to char *. All uses changed. Also, fix a local for similar reasons. Remove unused locals. Remove locals to avoid shadowing. (fn_rsvg_handle_free): Remove; unused. (svg_load, svg_load_image): Fix pointer signedness problem. (imagemagick_load_image): Don't use garbage pointer image_wand. * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/window.c b/src/window.c
index 265dafa6b80..7a026b3a1c7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -82,6 +82,7 @@ static int foreach_window_1 (struct window *,
82 int (* fn) (struct window *, void *), 82 int (* fn) (struct window *, void *),
83 void *); 83 void *);
84static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); 84static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
85static int resize_window_check (struct window *, int);
85static void resize_window_apply (struct window *, int); 86static void resize_window_apply (struct window *, int);
86static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); 87static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
87 88
@@ -121,9 +122,6 @@ static int window_initialized;
121/* Hook to run when window config changes. */ 122/* Hook to run when window config changes. */
122static Lisp_Object Qwindow_configuration_change_hook; 123static Lisp_Object Qwindow_configuration_change_hook;
123 124
124/* Incremented by 1 whenever a window is deleted. */
125static int window_deletion_count;
126
127/* Used by the function window_scroll_pixel_based */ 125/* Used by the function window_scroll_pixel_based */
128static int window_scroll_pixel_based_preserve_x; 126static int window_scroll_pixel_based_preserve_x;
129static int window_scroll_pixel_based_preserve_y; 127static int window_scroll_pixel_based_preserve_y;
@@ -614,7 +612,7 @@ WINDOW can be any window and defaults to the selected one. */)
614/* Return the number of lines of W's body. Don't count any mode or 612/* Return the number of lines of W's body. Don't count any mode or
615 header line of W. */ 613 header line of W. */
616 614
617int 615static int
618window_body_lines (struct window *w) 616window_body_lines (struct window *w)
619{ 617{
620 int height = XFASTINT (w->total_lines); 618 int height = XFASTINT (w->total_lines);
@@ -1974,14 +1972,6 @@ recombine_windows (Lisp_Object window)
1974 } 1972 }
1975 } 1973 }
1976} 1974}
1977
1978/* If WINDOW can be deleted, delete it. */
1979Lisp_Object
1980delete_deletable_window (Lisp_Object window)
1981{
1982 if (!NILP (call1 (Qwindow_deletable_p, window)))
1983 call1 (Qdelete_window, window);
1984}
1985 1975
1986/*********************************************************************** 1976/***********************************************************************
1987 Window List 1977 Window List
@@ -2643,7 +2633,7 @@ selected frame and no others. */)
2643 return Qnil; 2633 return Qnil;
2644} 2634}
2645 2635
2646Lisp_Object 2636static Lisp_Object
2647resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore) 2637resize_root_window (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal, Lisp_Object ignore)
2648{ 2638{
2649 return call4 (Qresize_root_window, window, delta, horizontal, ignore); 2639 return call4 (Qresize_root_window, window, delta, horizontal, ignore);
@@ -2669,9 +2659,9 @@ window-start value is reasonable when this function is called. */)
2669{ 2659{
2670 struct window *w, *r, *s; 2660 struct window *w, *r, *s;
2671 struct frame *f; 2661 struct frame *f;
2672 Lisp_Object sibling, pwindow, swindow, delta; 2662 Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta;
2673 EMACS_INT startpos; 2663 EMACS_INT startpos IF_LINT (= 0);
2674 int top, new_top, resize_failed; 2664 int top IF_LINT (= 0), new_top, resize_failed;
2675 2665
2676 w = decode_any_window (window); 2666 w = decode_any_window (window);
2677 XSETWINDOW (window, w); 2667 XSETWINDOW (window, w);
@@ -2757,10 +2747,10 @@ window-start value is reasonable when this function is called. */)
2757 windows_or_buffers_changed++; 2747 windows_or_buffers_changed++;
2758 Vwindow_list = Qnil; 2748 Vwindow_list = Qnil;
2759 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 2749 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
2750 resize_failed = 0;
2760 2751
2761 if (NILP (w->buffer)) 2752 if (NILP (w->buffer))
2762 { 2753 {
2763 resize_failed = 0;
2764 /* Resize subwindows vertically. */ 2754 /* Resize subwindows vertically. */
2765 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); 2755 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines));
2766 w->top_line = r->top_line; 2756 w->top_line = r->top_line;
@@ -3078,12 +3068,12 @@ run_window_configuration_change_hook (struct frame *f)
3078 if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook, 3068 if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook,
3079 buffer))) 3069 buffer)))
3080 { 3070 {
3081 int count = SPECPDL_INDEX (); 3071 int inner_count = SPECPDL_INDEX ();
3082 record_unwind_protect (select_window_norecord, Fselected_window ()); 3072 record_unwind_protect (select_window_norecord, Fselected_window ());
3083 select_window_norecord (window); 3073 select_window_norecord (window);
3084 run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook, 3074 run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook,
3085 buffer)); 3075 buffer));
3086 unbind_to (count, Qnil); 3076 unbind_to (inner_count, Qnil);
3087 } 3077 }
3088 } 3078 }
3089 } 3079 }
@@ -3533,7 +3523,7 @@ Note: This function does not operate on any subwindows of WINDOW. */)
3533 Note: This function does not check any of `window-fixed-size-p', 3523 Note: This function does not check any of `window-fixed-size-p',
3534 `window-min-height' or `window-min-width'. It does check that window 3524 `window-min-height' or `window-min-width'. It does check that window
3535 sizes do not drop below one line (two columns). */ 3525 sizes do not drop below one line (two columns). */
3536int 3526static int
3537resize_window_check (struct window *w, int horflag) 3527resize_window_check (struct window *w, int horflag)
3538{ 3528{
3539 struct window *c; 3529 struct window *c;
@@ -3617,7 +3607,7 @@ resize_window_check (struct window *w, int horflag)
3617static void 3607static void
3618resize_window_apply (struct window *w, int horflag) 3608resize_window_apply (struct window *w, int horflag)
3619{ 3609{
3620 struct window *c, *p; 3610 struct window *c;
3621 int pos; 3611 int pos;
3622 3612
3623 /* Note: Assigning new_normal requires that the new total size of the 3613 /* Note: Assigning new_normal requires that the new total size of the
@@ -3809,7 +3799,7 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3809DEFUN ("split-window-internal", Fsplit_window_internal, Ssplit_window_internal, 4, 4, 0, 3799DEFUN ("split-window-internal", Fsplit_window_internal, Ssplit_window_internal, 4, 4, 0,
3810 doc: /* Split window OLD. 3800 doc: /* Split window OLD.
3811Second argument TOTAL-SIZE specifies the number of lines or columns of the 3801Second argument TOTAL-SIZE specifies the number of lines or columns of the
3812new window. In any case TOTAL-SIZE must be a positive integer 3802new window. In any case TOTAL-SIZE must be a positive integer
3813 3803
3814Third argument SIDE nil (or `below') specifies that the new window shall 3804Third argument SIDE nil (or `below') specifies that the new window shall
3815be located below WINDOW. SIDE `above' means the new window shall be 3805be located below WINDOW. SIDE `above' means the new window shall be