diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 17:28:24 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-09 17:28:24 +0000 |
commit | 37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0 (patch) | |
tree | 7422f55fe913126e060f60cf8c8d892236bc3dd6 /screen.c | |
parent | 5b56ea181649793918779dd2684c671072ce4bc9 (diff) | |
download | rtmux-37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0.tar.gz rtmux-37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0.tar.bz2 rtmux-37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0.zip |
Sync OpenBSD patchset 226:
Change the way the grid is stored, previously it was:
- a two-dimensional array of cells;
- a two-dimensional array of utf8 data;
- an array of line lengths.
Now it is a single array of a new struct grid_line each of which represents a
line and contains the length and an array of cells and an array of utf8 data.
This will make it easier to add additional per-line members, such as flags.
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.95 2009-07-30 21:14:04 tcunha Exp $ */ +/* $Id: screen.c,v 1.96 2009-08-09 17:28:23 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -193,10 +193,8 @@ screen_resize_y(struct screen *s, u_int sy) } /* Resize line arrays. */ - gd->size = xrealloc(gd->size, gd->hsize + sy, sizeof *gd->size); - gd->data = xrealloc(gd->data, gd->hsize + sy, sizeof *gd->data); - gd->usize = xrealloc(gd->usize, gd->hsize + sy, sizeof *gd->usize); - gd->udata = xrealloc(gd->udata, gd->hsize + sy, sizeof *gd->udata); + gd->linedata = xrealloc( + gd->linedata, gd->hsize + sy, sizeof *gd->linedata); /* Size increasing. */ if (sy > oldy) { @@ -217,12 +215,8 @@ screen_resize_y(struct screen *s, u_int sy) needed -= available; /* Then fill the rest in with blanks. */ - for (i = gd->hsize + sy - needed; i < gd->hsize + sy; i++) { - gd->size[i] = 0; - gd->data[i] = NULL; - gd->usize[i] = 0; - gd->udata[i] = NULL; - } + for (i = gd->hsize + sy - needed; i < gd->hsize + sy; i++) + memset(&gd->linedata[i], 0, sizeof gd->linedata[i]); } /* Set the new size, and reset the scroll region. */ |