Code tidying.

This commit is contained in:
Nicholas Marriott 2007-11-26 22:22:18 +00:00
parent c5b1fa9411
commit 97eca99d0b

View File

@ -1,4 +1,4 @@
/* $Id: screen-display.c,v 1.8 2007-11-26 22:18:57 nicm Exp $ */ /* $Id: screen-display.c,v 1.9 2007-11-26 22:22:18 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -174,28 +174,25 @@ screen_display_scroll_region_up(struct screen *s)
* XXX should this be done somewhere else? * XXX should this be done somewhere else?
*/ */
if (s->rupper == 0 && s->rlower == screen_last_y(s)) { if (s->rupper == 0 && s->rlower == screen_last_y(s)) {
sy = screen_size_y(s) + s->hsize;
if (s->hsize == s->hlimit) { if (s->hsize == s->hlimit) {
/* If the limit is hit, free 10% and shift up. */ /* If the limit is hit, free 10% and shift up. */
ny = s->hlimit / 10; ny = s->hlimit / 10;
if (ny < 1) if (ny < 1)
ny = 1; ny = 1;
sy = screen_size_y(s) + s->hsize;
screen_free_lines(s, 0, ny); screen_free_lines(s, 0, ny);
screen_move_lines(s, 0, ny, sy - ny); screen_move_lines(s, 0, ny, sy - ny);
s->hsize -= ny; s->hsize -= ny;
sy -= ny;
} }
s->hsize++; s->hsize++;
s->grid_data = xrealloc( sy = screen_size_y(s) + s->hsize;
s->grid_data, sy + 1, sizeof *s->grid_data); s->grid_data = xrealloc(s->grid_data, sy, sizeof *s->grid_data);
s->grid_attr = xrealloc( s->grid_attr = xrealloc(s->grid_attr, sy, sizeof *s->grid_attr);
s->grid_attr, sy + 1, sizeof *s->grid_attr); s->grid_colr = xrealloc(s->grid_colr, sy, sizeof *s->grid_colr);
s->grid_colr = xrealloc( s->grid_size = xrealloc(s->grid_size, sy, sizeof *s->grid_size);
s->grid_colr, sy + 1, sizeof *s->grid_colr);
s->grid_size = xrealloc(
s->grid_size, sy + 1, sizeof *s->grid_size);
screen_display_make_lines(s, screen_last_y(s), 1); screen_display_make_lines(s, screen_last_y(s), 1);
return; return;
} }