diff options
| author | Jim Blandy | 1992-11-16 00:42:24 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-11-16 00:42:24 +0000 |
| commit | b5c685f40245145a53adb441026f20c18ca2e289 (patch) | |
| tree | 33834f76f1d43a4808f3923fcf47456f11eef879 /src | |
| parent | ef733244bb1759a48c7fa130ff9847bc72b1a550 (diff) | |
| download | emacs-b5c685f40245145a53adb441026f20c18ca2e289.tar.gz emacs-b5c685f40245145a53adb441026f20c18ca2e289.zip | |
* dispnew.c [not MULTI_FRAME] (Fredraw_display): Pass the correct
number of arguments to mark_window_display_accurate.
* dispnew.c (safe_bcopy): Use the right terminating condition in
the loop which uses multiple bcopy calls to transfer a block to an
overlapping higher block.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 3aec0bd61d2..f26d12b53b2 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -202,7 +202,7 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, 0, | |||
| 202 | windows_or_buffers_changed++; | 202 | windows_or_buffers_changed++; |
| 203 | /* Mark all windows as INaccurate, | 203 | /* Mark all windows as INaccurate, |
| 204 | so that every window will have its redisplay done. */ | 204 | so that every window will have its redisplay done. */ |
| 205 | mark_window_display_accurate (FRAME_ROOT_WINDOW (0)); | 205 | mark_window_display_accurate (FRAME_ROOT_WINDOW (0), 0); |
| 206 | return Qnil; | 206 | return Qnil; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| @@ -469,25 +469,27 @@ safe_bcopy (from, to, size) | |||
| 469 | char *from, *to; | 469 | char *from, *to; |
| 470 | int size; | 470 | int size; |
| 471 | { | 471 | { |
| 472 | register char *endf; | 472 | if (size <= 0 || from == to) |
| 473 | register char *endt; | ||
| 474 | |||
| 475 | if (size == 0) | ||
| 476 | return; | 473 | return; |
| 477 | 474 | ||
| 478 | /* If destination is higher in memory, and overlaps source zone, | 475 | /* If the source and destination don't overlap, then bcopy can |
| 479 | copy from the end. */ | 476 | handle it. If they do overlap, but the destination is lower in |
| 480 | if (from < to && from + size > to) | 477 | memory than the source, we'll assume bcopy can handle that. */ |
| 478 | if (to < from || from + size <= to) | ||
| 479 | bcopy (from, to, size); | ||
| 480 | |||
| 481 | /* Otherwise, we'll copy from the end. */ | ||
| 482 | else | ||
| 481 | { | 483 | { |
| 482 | endf = from + size; | 484 | register char *endf = from + size; |
| 483 | endt = to + size; | 485 | register char *endt = to + size; |
| 484 | 486 | ||
| 485 | /* If TO - FROM is large, then we should break the copy into | 487 | /* If TO - FROM is large, then we should break the copy into |
| 486 | nonoverlapping chunks of TO - FROM bytes each. However, if | 488 | nonoverlapping chunks of TO - FROM bytes each. However, if |
| 487 | TO - FROM is small, then the bcopy function call overhead | 489 | TO - FROM is small, then the bcopy function call overhead |
| 488 | makes this not worth it. The crossover point could be about | 490 | makes this not worth it. The crossover point could be about |
| 489 | anywhere. Since I don't think the obvious copy loop is ever | 491 | anywhere. Since I don't think the obvious copy loop is too |
| 490 | too bad, I'm trying to err in its favor. */ | 492 | bad, I'm trying to err in its favor. */ |
| 491 | if (to - from < 64) | 493 | if (to - from < 64) |
| 492 | { | 494 | { |
| 493 | do | 495 | do |
| @@ -496,24 +498,23 @@ safe_bcopy (from, to, size) | |||
| 496 | } | 498 | } |
| 497 | else | 499 | else |
| 498 | { | 500 | { |
| 499 | /* Since TO - FROM >= 64, the overlap is less than SIZE, | 501 | for (;;) |
| 500 | so we can always safely do this loop once. */ | ||
| 501 | while (endt > to) | ||
| 502 | { | 502 | { |
| 503 | endt -= (to - from); | 503 | endt -= (to - from); |
| 504 | endf -= (to - from); | 504 | endf -= (to - from); |
| 505 | 505 | ||
| 506 | if (endt < to) | ||
| 507 | break; | ||
| 508 | |||
| 506 | bcopy (endf, endt, to - from); | 509 | bcopy (endf, endt, to - from); |
| 507 | } | 510 | } |
| 508 | 511 | ||
| 509 | /* If TO - FROM wasn't a multiple of SIZE, there will be a | 512 | /* If SIZE wasn't a multiple of TO - FROM, there will be a |
| 510 | little left over. The amount left over is | 513 | little left over. The amount left over is |
| 511 | (endt + (to - from)) - to, which is endt - from. */ | 514 | (endt + (to - from)) - to, which is endt - from. */ |
| 512 | bcopy (from, to, endt - from); | 515 | bcopy (from, to, endt - from); |
| 513 | } | 516 | } |
| 514 | } | 517 | } |
| 515 | else | ||
| 516 | bcopy (from, to, size); | ||
| 517 | } | 518 | } |
| 518 | 519 | ||
| 519 | #if 0 | 520 | #if 0 |