Use memset instead of bzero.
authorKeisuke Nishida <kxn30@po.cwru.edu>
Thu, 12 Apr 2001 01:40:21 +0000 (01:40 +0000)
committerKeisuke Nishida <kxn30@po.cwru.edu>
Thu, 12 Apr 2001 01:40:21 +0000 (01:40 +0000)
ChangeLog
configure.in
libguile/ChangeLog
libguile/debug-malloc.c
libguile/iselect.c

index 6703eb8..30e0ad9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-11  Keisuke Nishida  <kxn30@po.cwru.edu>
+
+       * configure.in (AC_CHECK_FUNCS): Don't check bzero.
+       (GUILE_FUNC_DECLARED): Removed checking of bzero.
+       Thanks to NIIBE Yutaka.
+
 2001-04-10  Mikael Djurfeldt  <mdj@linnaeus.mit.edu>
 
        * Undeprecated scm_init_oop_goopscore_module.
index 7dcd920..0b72428 100644 (file)
@@ -195,7 +195,7 @@ AC_SUBST(INCLTDL)
 AC_SUBST(LIBLTDL)
 AC_SUBST(DLPREOPEN)
 
-AC_CHECK_FUNCS(ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid bzero strdup system usleep atexit on_exit)
+AC_CHECK_FUNCS(ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit)
 
 AC_CHECK_HEADERS(crypt.h sys/resource.h sys/file.h)
 AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
@@ -219,7 +219,6 @@ AC_DEFUN(GUILE_FUNC_DECLARED, [
 ])
 
 GUILE_FUNC_DECLARED(strptime, time.h)
-GUILE_FUNC_DECLARED(bzero, string.h)
 GUILE_FUNC_DECLARED(sleep, unistd.h)
 GUILE_FUNC_DECLARED(usleep, unistd.h)
 
index 757697e..0b0d3cf 100644 (file)
@@ -1,3 +1,13 @@
+2001-04-11  Keisuke Nishida  <kxn30@po.cwru.edu>
+
+       * debug-malloc.c (grow, scm_debug_malloc_prehistory): Use memset
+       instead of bzero.
+       
+       * coop.c, iselect.c (FD_ZERO_N): Unconditionally use memset.
+       (MISSING_BZERO_DECL): Remove the declaration. 
+
+       Thanks to NIIBE Yutaka.
+
 2001-04-10  Mikael Djurfeldt  <mdj@linnaeus.mit.edu>
 
        * init.c, goops.c, goops.h: Reverted change of 2001-03-29.  (The
index 8b2a08c..b3c5133 100644 (file)
@@ -116,10 +116,6 @@ static hash_entry_t *malloc_object = 0;
     }                                                          \
   while (0)
 
-#ifdef MISSING_BZERO_DECL
-extern void bzero (void *, size_t);
-#endif
-
 static void
 grow (hash_entry_t **table, int *size)
 {
@@ -132,7 +128,7 @@ grow (hash_entry_t **table, int *size)
  again:
   TABLE (new) = realloc (TABLE (new),
                         sizeof (hash_entry_t) * (SIZE (new) + N_SEEK));
-  bzero (TABLE (new), sizeof (hash_entry_t) * (SIZE (new) + N_SEEK));
+  memset (TABLE (new), 0, sizeof (hash_entry_t) * (SIZE (new) + N_SEEK));
   for (i = 0; i < oldsize; ++i)
     if (oldtable[i].key)
       {
@@ -249,10 +245,10 @@ scm_debug_malloc_prehistory ()
 {
   malloc_type = malloc (sizeof (hash_entry_t)
                        * (malloc_type_size + N_SEEK));
-  bzero (malloc_type, sizeof (hash_entry_t) * (malloc_type_size + N_SEEK));
+  memset (malloc_type, 0, sizeof (hash_entry_t) * (malloc_type_size + N_SEEK));
   malloc_object = malloc (sizeof (hash_entry_t)
                          * (malloc_object_size + N_SEEK));
-  bzero (malloc_object, sizeof (hash_entry_t) * (malloc_object_size + N_SEEK));
+  memset (malloc_object, 0, sizeof (hash_entry_t) * (malloc_object_size + N_SEEK));
 }
 
 void
index 8678635..2024f15 100644 (file)
 
 #include "libguile/coop-threads.h"
 
-#ifdef MISSING_BZERO_DECL
-extern void bzero (void *, size_t);
-#endif
-
 \f
 
 /* COOP queue macros */
@@ -92,11 +88,7 @@ extern void bzero (void *, size_t);
 #error Could not determine suitable definition for SCM_NLONGBITS
 #endif
 
-#ifdef HAVE_BZERO
-#define FD_ZERO_N(pos, n) bzero ((pos), (n))
-#else
 #define FD_ZERO_N(pos, n) memset ((void *) (pos), 0, (n))
-#endif
 
 typedef unsigned long *ulongptr;