* gh_data.c (gh_set_substr): Revert change of 1999-08-29; bcopy is
authorJim Blandy <jimb@red-bean.com>
Mon, 30 Aug 1999 07:02:25 +0000 (07:02 +0000)
committerJim Blandy <jimb@red-bean.com>
Mon, 30 Aug 1999 07:02:25 +0000 (07:02 +0000)
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
libguile/ports.c
libguile/strop.c

index e58a0a4..8a100ec 100644 (file)
@@ -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);
 }
 
index 343bee7..d53b0c4 100644 (file)
@@ -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;
        }
 
index 769207a..7a2f344 100644 (file)
@@ -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);
 }