aboutsummaryrefslogtreecommitdiffstats
path: root/src/scroll.c
diff options
context:
space:
mode:
authorJoakim Verona2012-07-27 02:22:03 +0200
committerJoakim Verona2012-07-27 02:22:03 +0200
commit5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (patch)
tree5c55f1096a656a9759f0b53a0b5d1a2289bd366f /src/scroll.c
parent0c5c85cf2b350c965bb1ffa5b2d77c2adebc406b (diff)
parent562157c814037dcba58a20cd6908a95992c22283 (diff)
downloademacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.tar.gz
emacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.zip
upstream
Diffstat (limited to 'src/scroll.c')
-rw-r--r--src/scroll.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/scroll.c b/src/scroll.c
index abc5c17400a..78ebe65bdcc 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -253,24 +253,24 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
253 /* A queue for line insertions to be done. */ 253 /* A queue for line insertions to be done. */
254 struct queue { int count, pos; }; 254 struct queue { int count, pos; };
255 struct queue *queue_start 255 struct queue *queue_start
256 = (struct queue *) alloca (current_matrix->nrows * sizeof (struct queue)); 256 = alloca (current_matrix->nrows * sizeof *queue_start);
257 struct queue *queue = queue_start; 257 struct queue *queue = queue_start;
258 258
259 char *retained_p = (char *) alloca (window_size * sizeof (char)); 259 char *retained_p = alloca (window_size * sizeof *retained_p);
260 int *copy_from = (int *) alloca (window_size * sizeof (int)); 260 int *copy_from = alloca (window_size * sizeof *copy_from);
261 261
262 /* Zero means line is empty. */ 262 /* Zero means line is empty. */
263 memset (retained_p, 0, window_size * sizeof (char)); 263 memset (retained_p, 0, window_size * sizeof (char));
264 for (k = 0; k < window_size; ++k) 264 for (k = 0; k < window_size; ++k)
265 copy_from[k] = -1; 265 copy_from[k] = -1;
266 266
267#if GLYPH_DEBUG 267#ifdef GLYPH_DEBUG
268# define CHECK_BOUNDS \ 268# define CHECK_BOUNDS \
269 do \ 269 do \
270 { \ 270 { \
271 int ck; \ 271 int ck; \
272 for (ck = 0; ck < window_size; ++ck) \ 272 for (ck = 0; ck < window_size; ++ck) \
273 xassert (copy_from[ck] == -1 \ 273 eassert (copy_from[ck] == -1 \
274 || (copy_from[ck] >= 0 && copy_from[ck] < window_size)); \ 274 || (copy_from[ck] >= 0 && copy_from[ck] < window_size)); \
275 } \ 275 } \
276 while (0); 276 while (0);
@@ -317,12 +317,12 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
317 { 317 {
318 /* Best thing done here is no insert or delete, i.e. a write. */ 318 /* Best thing done here is no insert or delete, i.e. a write. */
319 --i, --j; 319 --i, --j;
320 xassert (i >= 0 && i < window_size); 320 eassert (i >= 0 && i < window_size);
321 xassert (j >= 0 && j < window_size); 321 eassert (j >= 0 && j < window_size);
322 copy_from[i] = j; 322 copy_from[i] = j;
323 retained_p[j] = 1; 323 retained_p[j] = 1;
324 324
325#if GLYPH_DEBUG 325#ifdef GLYPH_DEBUG
326 CHECK_BOUNDS; 326 CHECK_BOUNDS;
327#endif 327#endif
328 } 328 }
@@ -368,13 +368,13 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
368 } 368 }
369 369
370 for (k = 0; k < window_size; ++k) 370 for (k = 0; k < window_size; ++k)
371 xassert (copy_from[k] >= 0 && copy_from[k] < window_size); 371 eassert (copy_from[k] >= 0 && copy_from[k] < window_size);
372 372
373 /* Perform the row swizzling. */ 373 /* Perform the row swizzling. */
374 mirrored_line_dance (current_matrix, unchanged_at_top, window_size, 374 mirrored_line_dance (current_matrix, unchanged_at_top, window_size,
375 copy_from, retained_p); 375 copy_from, retained_p);
376 376
377 /* Some sanity checks if GLYPH_DEBUG != 0. */ 377 /* Some sanity checks if GLYPH_DEBUG is defined. */
378 CHECK_MATRIX (current_matrix); 378 CHECK_MATRIX (current_matrix);
379 379
380 if (terminal_window_p) 380 if (terminal_window_p)
@@ -671,11 +671,11 @@ do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
671 int write_follows_p = 1; 671 int write_follows_p = 1;
672 672
673 /* For each row in the new matrix what row of the old matrix it is. */ 673 /* For each row in the new matrix what row of the old matrix it is. */
674 int *copy_from = (int *) alloca (window_size * sizeof (int)); 674 int *copy_from = alloca (window_size * sizeof *copy_from);
675 675
676 /* Non-zero for each row in the new matrix that is retained from the 676 /* Non-zero for each row in the new matrix that is retained from the
677 old matrix. Lines not retained are empty. */ 677 old matrix. Lines not retained are empty. */
678 char *retained_p = (char *) alloca (window_size * sizeof (char)); 678 char *retained_p = alloca (window_size * sizeof *retained_p);
679 679
680 memset (retained_p, 0, window_size * sizeof (char)); 680 memset (retained_p, 0, window_size * sizeof (char));
681 681
@@ -728,7 +728,7 @@ do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
728 place they belong. */ 728 place they belong. */
729 int n_to_write = p->writecount; 729 int n_to_write = p->writecount;
730 write_follows_p = 1; 730 write_follows_p = 1;
731 xassert (n_to_write > 0); 731 eassert (n_to_write > 0);
732 732
733 if (i > j) 733 if (i > j)
734 { 734 {