[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem report #56
From: |
Dan Nicolaescu |
Subject: |
Problem report #56 |
Date: |
Mon, 10 Apr 2006 12:02:29 -0700 |
CID: 56
Checker: UNINIT (help)
File: emacs/src/window.c
Function: size_window
Description: Using uninitialized value "extra"
Event var_decl: Declared variable "extra" without initializer
Also see events: [uninit_use]
2906 int fixed_size, each, extra, n;
2907 int resize_fixed_p, nfixed;
2908 int last_pos, first_pos, nchildren, total;
2909 int *new_sizes = NULL;
2910
2911 /* Determine the fixed-size portion of the this window, and the
2912 number of child windows. */
2913 fixed_size = nchildren = nfixed = total = 0;
At conditional (1): "child != Qnil" taking true path
At conditional (4): "child != Qnil" taking true path
At conditional (7): "child != Qnil" taking true path
At conditional (10): "child != Qnil" taking false path
2914 for (child = *forward; !NILP (child); child = c->next,
++nchildren)
2915 {
2916 int child_size;
2917
2918 c = XWINDOW (child);
At conditional (2): "width_p != 0" taking true path
At conditional (5): "width_p != 0" taking true path
At conditional (8): "width_p != 0" taking true path
2919 child_size = width_p ? XINT (c->total_cols) : XINT
(c->total_lines);
2920 total += child_size;
2921
At conditional (3): "window_fixed_size_p != 0" taking false path
At conditional (6): "window_fixed_size_p != 0" taking false path
At conditional (9): "window_fixed_size_p != 0" taking false path
2922 if (window_fixed_size_p (c, width_p, 0))
2923 {
2924 fixed_size += child_size;
2925 ++nfixed;
2926 }
2927 }
2928
2929 /* If the new size is smaller than fixed_size, or if there
2930 aren't any resizable windows, allow resizing fixed-size
2931 windows. */
At conditional (11): "nfixed == nchildren" taking true path
2932 resize_fixed_p = nfixed == nchildren || size < fixed_size;
2933
2934 /* Compute how many lines/columns to add/remove to each child.
The
2935 value of extra takes care of rounding errors. */
At conditional (12): "resize_fixed_p != 0" taking true path
2936 n = resize_fixed_p ? nchildren : nchildren - nfixed;
At conditional (13): "size < total" taking true path
At conditional (14): "n > 1" taking true path
2937 if (size < total && n > 1)
2938 new_sizes = shrink_windows (total, size, nchildren, n, min_size,
2939 resize_fixed_p, *forward, width_p);
2940 else
2941 {
2942 each = (size - total) / n;
2943 extra = (size - total) - n * each;
2944 }
2945
2946 /* Compute new children heights and edge positions. */
At conditional (15): "width_p != 0" taking true path
2947 first_pos = width_p ? XINT (w->left_col) : XINT (w->top_line);
2948 last_pos = first_pos;
At conditional (16): "child != Qnil" taking true path
2949 for (n = 0, child = *forward; !NILP (child); child = c->next, ++n)
2950 {
2951 int new_size, old_size;
2952
2953 c = XWINDOW (child);
At conditional (17): "width_p != 0" taking true path
2954 old_size = width_p ? XFASTINT (c->total_cols) : XFASTINT
(c->total_lines);
2955 new_size = old_size;
2956
2957 /* The top or left edge position of this child equals the
2958 bottom or right edge of its predecessor. */
At conditional (18): "width_p != 0" taking true path
2959 if (width_p)
2960 c->left_col = make_number (last_pos);
2961 else
2962 c->top_line = make_number (last_pos);
2963
2964 /* If this child can be resized, do it. */
At conditional (19): "resize_fixed_p != 0" taking true path
2965 if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0))
2966 {
Event uninit_use: Using uninitialized value "extra"
Also see events: [var_decl]
At conditional (20): "new_sizes != 0" taking false path
2967 new_size = new_sizes ? new_sizes[n] : old_size + each +
extra;
2968 extra = 0;
2969 }
- Problem report #56,
Dan Nicolaescu <=