From aa97ff6036bc63266f5bee24a41204d81fac525b Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 30 Aug 1999 07:02:25 +0000 Subject: [PATCH] * gh_data.c (gh_set_substr): Revert change of 1999-08-29; bcopy is not a correct substitute for memmove, because it doesn't handle overlapping source and destination areas on many platforms. Overlaps are the primary reason to use memmove in the first place. * ports.c (scm_ungetc): Same. * strop.c (scm_substring_move_x): Same. --- libguile/gh_data.c | 8 -------- libguile/ports.c | 8 -------- libguile/strop.c | 10 ---------- 3 files changed, 26 deletions(-) diff --git a/libguile/gh_data.c b/libguile/gh_data.c index e58a0a4dc..8a100ecda 100644 --- a/libguile/gh_data.c +++ b/libguile/gh_data.c @@ -115,15 +115,7 @@ gh_set_substr (char *src, SCM dst, int start, int len) scm_protect_object (dst); effective_length = ((unsigned) len < dst_len) ? len : dst_len; -#ifdef HAVE_MEMMOVE memmove (dst_ptr + start, src, effective_length); -#else -#ifdef HAVE_BCOPY - bcopy (src, dst_ptr + start, effective_length); -#else -#error Need memmove. Please send a bug report to bug-guile@gnu.org. -#endif -#endif scm_unprotect_object (dst); } diff --git a/libguile/ports.c b/libguile/ports.c index 343bee702..d53b0c43d 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -825,15 +825,7 @@ scm_ungetc (int c, SCM port) { int count = pt->read_end - pt->read_pos; -#ifdef HAVE_MEMMOVE memmove (pt->read_buf + 1, pt->read_pos, count); -#else -#ifdef HAVE_BCOPY - bcopy (pt->read_pos, pt->read_buf + 1, count); -#else -#error Need memmove. Please send a bug report to bug-guile@gnu.org. -#endif -#endif pt->read_end = pt->read_buf + 1 + count; } diff --git a/libguile/strop.c b/libguile/strop.c index 769207ad5..7a2f344e6 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -147,19 +147,9 @@ scm_substring_move_x (SCM str1, SCM start1, SCM end1, SCM_ASSERT (len+s2 <= SCM_LENGTH (str2), start2, SCM_OUTOFRANGE, s_substring_move_x); -#ifdef HAVE_MEMMOVE SCM_SYSCALL(memmove((void *)(&(SCM_CHARS(str2)[s2])), (void *)(&(SCM_CHARS(str1)[s1])), len)); -#else -#ifdef HAVE_BCOPY - SCM_SYSCALL(bcopy((void *)(&(SCM_CHARS(str1)[s1])), - (void *)(&(SCM_CHARS(str2)[s2])), - len)); -#else -#error Need memmove. Please send a bug report to bug-guile@gnu.org. -#endif -#endif return scm_return_first(SCM_UNSPECIFIED, str1, str2); } -- 2.20.1