1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-22 20:40:29 +02:00

* 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.
This commit is contained in:
Jim Blandy 1999-08-30 07:02:25 +00:00
parent 74a28fa178
commit aa97ff6036
3 changed files with 0 additions and 26 deletions

View file

@ -115,15 +115,7 @@ gh_set_substr (char *src, SCM dst, int start, int len)
scm_protect_object (dst); scm_protect_object (dst);
effective_length = ((unsigned) len < dst_len) ? len : dst_len; effective_length = ((unsigned) len < dst_len) ? len : dst_len;
#ifdef HAVE_MEMMOVE
memmove (dst_ptr + start, src, effective_length); 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); scm_unprotect_object (dst);
} }

View file

@ -825,15 +825,7 @@ scm_ungetc (int c, SCM port)
{ {
int count = pt->read_end - pt->read_pos; int count = pt->read_end - pt->read_pos;
#ifdef HAVE_MEMMOVE
memmove (pt->read_buf + 1, pt->read_pos, count); 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; pt->read_end = pt->read_buf + 1 + count;
} }

View file

@ -147,19 +147,9 @@ scm_substring_move_x (SCM str1, SCM start1, SCM end1,
SCM_ASSERT (len+s2 <= SCM_LENGTH (str2), start2, SCM_ASSERT (len+s2 <= SCM_LENGTH (str2), start2,
SCM_OUTOFRANGE, s_substring_move_x); SCM_OUTOFRANGE, s_substring_move_x);
#ifdef HAVE_MEMMOVE
SCM_SYSCALL(memmove((void *)(&(SCM_CHARS(str2)[s2])), SCM_SYSCALL(memmove((void *)(&(SCM_CHARS(str2)[s2])),
(void *)(&(SCM_CHARS(str1)[s1])), (void *)(&(SCM_CHARS(str1)[s1])),
len)); 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); return scm_return_first(SCM_UNSPECIFIED, str1, str2);
} }