mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 04:30:19 +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:
parent
74a28fa178
commit
aa97ff6036
3 changed files with 0 additions and 26 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue