aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn2000-04-01 12:39:03 +0000
committerKen Raeburn2000-04-01 12:39:03 +0000
commit3578db3c162c8a5b948ca7936bdaf596a83e49a4 (patch)
tree07dfa24452a6d80295d9465b3e71a448274ac26e /src
parent610d841ea4d397f151a86d4bfc1e0a8b9b1a646b (diff)
downloademacs-3578db3c162c8a5b948ca7936bdaf596a83e49a4.tar.gz
emacs-3578db3c162c8a5b948ca7936bdaf596a83e49a4.zip
* window.c (CURBEG, CURSIZE): Don't overload lisp object lvalues
with int lvalues via casts; instead, just yield lisp object lvalues. (enlarge_window): Variable sizep now points to Lisp_Object. Use proper accessor macros. (shrink_window_lowest_first): w->top is Lisp_Object; use XINT. (grow_mini_window): Fix typo getting int value of root->height.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/window.c27
2 files changed, 24 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d199fb6321e..4d493cc7ae1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12000-04-01 Ken Raeburn <raeburn@gnu.org>
2
3 * window.c (CURBEG, CURSIZE): Don't overload lisp object lvalues
4 with int lvalues via casts; instead, just yield lisp object
5 lvalues.
6 (enlarge_window): Variable sizep now points to Lisp_Object. Use
7 proper accessor macros.
8 (shrink_window_lowest_first): w->top is Lisp_Object; use XINT.
9 (grow_mini_window): Fix typo getting int value of root->height.
10
12000-04-01 Gerd Moellmann <gerd@gnu.org> 112000-04-01 Gerd Moellmann <gerd@gnu.org>
2 12
3 * xfaces.c (realize_basic_faces): Block input while realizing 13 * xfaces.c (realize_basic_faces): Block input while realizing
diff --git a/src/window.c b/src/window.c
index 72547cad4b1..8e643ee5c76 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3106,10 +3106,10 @@ window_width (window)
3106 3106
3107 3107
3108#define CURBEG(w) \ 3108#define CURBEG(w) \
3109 *(widthflag ? (int *) &(XWINDOW (w)->left) : (int *) &(XWINDOW (w)->top)) 3109 *(widthflag ? &(XWINDOW (w)->left) : &(XWINDOW (w)->top))
3110 3110
3111#define CURSIZE(w) \ 3111#define CURSIZE(w) \
3112 *(widthflag ? (int *) &(XWINDOW (w)->width) : (int *) &(XWINDOW (w)->height)) 3112 *(widthflag ? &(XWINDOW (w)->width) : &(XWINDOW (w)->height))
3113 3113
3114 3114
3115/* Enlarge selected_window by DELTA. WIDTHFLAG non-zero means 3115/* Enlarge selected_window by DELTA. WIDTHFLAG non-zero means
@@ -3124,7 +3124,8 @@ enlarge_window (window, delta, widthflag)
3124{ 3124{
3125 Lisp_Object parent, next, prev; 3125 Lisp_Object parent, next, prev;
3126 struct window *p; 3126 struct window *p;
3127 int *sizep, maximum; 3127 Lisp_Object *sizep;
3128 int maximum;
3128 int (*sizefun) P_ ((Lisp_Object)) 3129 int (*sizefun) P_ ((Lisp_Object))
3129 = widthflag ? window_width : window_height; 3130 = widthflag ? window_width : window_height;
3130 void (*setsizefun) P_ ((Lisp_Object, int, int)) 3131 void (*setsizefun) P_ ((Lisp_Object, int, int))
@@ -3164,7 +3165,7 @@ enlarge_window (window, delta, widthflag)
3164 { 3165 {
3165 register int maxdelta; 3166 register int maxdelta;
3166 3167
3167 maxdelta = (!NILP (parent) ? (*sizefun) (parent) - *sizep 3168 maxdelta = (!NILP (parent) ? (*sizefun) (parent) - XINT (*sizep)
3168 : !NILP (p->next) ? ((*sizefun) (p->next) 3169 : !NILP (p->next) ? ((*sizefun) (p->next)
3169 - window_min_size (XWINDOW (p->next), 3170 - window_min_size (XWINDOW (p->next),
3170 widthflag, 0, 0)) 3171 widthflag, 0, 0))
@@ -3182,7 +3183,7 @@ enlarge_window (window, delta, widthflag)
3182 delta = maxdelta; 3183 delta = maxdelta;
3183 } 3184 }
3184 3185
3185 if (*sizep + delta < window_min_size (XWINDOW (window), widthflag, 0, 0)) 3186 if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), widthflag, 0, 0))
3186 { 3187 {
3187 delete_window (window); 3188 delete_window (window);
3188 return; 3189 return;
@@ -3226,7 +3227,7 @@ enlarge_window (window, delta, widthflag)
3226 this_one = delta; 3227 this_one = delta;
3227 3228
3228 (*setsizefun) (next, (*sizefun) (next) - this_one, 0); 3229 (*setsizefun) (next, (*sizefun) (next) - this_one, 0);
3229 (*setsizefun) (window, *sizep + this_one, 0); 3230 (*setsizefun) (window, XINT (*sizep) + this_one, 0);
3230 3231
3231 delta -= this_one; 3232 delta -= this_one;
3232 } 3233 }
@@ -3250,7 +3251,7 @@ enlarge_window (window, delta, widthflag)
3250 first_affected = prev; 3251 first_affected = prev;
3251 3252
3252 (*setsizefun) (prev, (*sizefun) (prev) - this_one, 0); 3253 (*setsizefun) (prev, (*sizefun) (prev) - this_one, 0);
3253 (*setsizefun) (window, *sizep + this_one, 0); 3254 (*setsizefun) (window, XINT (*sizep) + this_one, 0);
3254 3255
3255 delta -= this_one; 3256 delta -= this_one;
3256 } 3257 }
@@ -3268,7 +3269,7 @@ enlarge_window (window, delta, widthflag)
3268 for (next = XWINDOW (prev)->next; ! EQ (next, first_unaffected); 3269 for (next = XWINDOW (prev)->next; ! EQ (next, first_unaffected);
3269 prev = next, next = XWINDOW (next)->next) 3270 prev = next, next = XWINDOW (next)->next)
3270 { 3271 {
3271 CURBEG (next) = CURBEG (prev) + (*sizefun) (prev); 3272 XSETINT (CURBEG (next), XINT (CURBEG (prev)) + (*sizefun) (prev));
3272 /* This does not change size of NEXT, 3273 /* This does not change size of NEXT,
3273 but it propagates the new top edge to its children */ 3274 but it propagates the new top edge to its children */
3274 (*setsizefun) (next, (*sizefun) (next), 0); 3275 (*setsizefun) (next, (*sizefun) (next), 0);
@@ -3282,7 +3283,7 @@ enlarge_window (window, delta, widthflag)
3282 /* If trying to grow this window to or beyond size of the parent, 3283 /* If trying to grow this window to or beyond size of the parent,
3283 make delta1 so big that, on shrinking back down, 3284 make delta1 so big that, on shrinking back down,
3284 all the siblings end up with less than one line and are deleted. */ 3285 all the siblings end up with less than one line and are deleted. */
3285 if (opht <= *sizep + delta) 3286 if (opht <= XINT (*sizep) + delta)
3286 delta1 = opht * opht * 2; 3287 delta1 = opht * opht * 2;
3287 else 3288 else
3288 { 3289 {
@@ -3330,8 +3331,8 @@ enlarge_window (window, delta, widthflag)
3330 3331
3331 /* Add delta1 lines or columns to this window, and to the parent, 3332 /* Add delta1 lines or columns to this window, and to the parent,
3332 keeping things consistent while not affecting siblings. */ 3333 keeping things consistent while not affecting siblings. */
3333 CURSIZE (parent) = opht + delta1; 3334 XSETINT (CURSIZE (parent), opht + delta1);
3334 (*setsizefun) (window, *sizep + delta1, 0); 3335 (*setsizefun) (window, XINT (*sizep) + delta1, 0);
3335 3336
3336 /* Squeeze out delta1 lines or columns from our parent, 3337 /* Squeeze out delta1 lines or columns from our parent,
3337 shriking this window and siblings proportionately. 3338 shriking this window and siblings proportionately.
@@ -3429,7 +3430,7 @@ shrink_window_lowest_first (w, height)
3429 } 3430 }
3430 3431
3431 /* Compute new positions. */ 3432 /* Compute new positions. */
3432 last_top = w->top; 3433 last_top = XINT (w->top);
3433 for (child = w->vchild; !NILP (child); child = c->next) 3434 for (child = w->vchild; !NILP (child); child = c->next)
3434 { 3435 {
3435 c = XWINDOW (child); 3436 c = XWINDOW (child);
@@ -3546,7 +3547,7 @@ grow_mini_window (w, delta)
3546 shrink_window_lowest_first (root, XFASTINT (root->height) - delta); 3547 shrink_window_lowest_first (root, XFASTINT (root->height) - delta);
3547 3548
3548 /* Grow the mini-window. */ 3549 /* Grow the mini-window. */
3549 w->top = make_number (XFASTINT (root->top) + XFASTINT (root)->height); 3550 w->top = make_number (XFASTINT (root->top) + XFASTINT (root->height));
3550 w->height = make_number (XFASTINT (w->height) + delta); 3551 w->height = make_number (XFASTINT (w->height) + delta);
3551 XSETFASTINT (w->last_modified, 0); 3552 XSETFASTINT (w->last_modified, 0);
3552 XSETFASTINT (w->last_overlay_modified, 0); 3553 XSETFASTINT (w->last_overlay_modified, 0);