Skip to content
Snippets Groups Projects
Commit 17f90d1c authored by cshapiro's avatar cshapiro
Browse files

Replace all uses of the old b{copy,zero} byte string functions with

the equivalent standard C mem{cpy,move,set} functions.
parent 824dfde0
No related branches found
No related tags found
No related merge requests found
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/alpha-arch.c,v 1.6 2000/10/24 13:32:30 dtc Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/alpha-arch.c,v 1.7 2005/09/05 06:09:12 cshapiro Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -33,7 +33,7 @@ char *arch_init(void)
OS_VM_PROT_ALL,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0)
== (os_vm_address_t) -1)
perror("mmap");
bcopy(call_into_lisp_LRA,call_into_lisp_LRA_page,OS_VM_DEFAULT_PAGESIZE);
memcpy(call_into_lisp_LRA_page,call_into_lisp_LRA,OS_VM_DEFAULT_PAGESIZE);
os_flush_icache((os_vm_address_t)call_into_lisp_LRA_page,
OS_VM_DEFAULT_PAGESIZE);
return NULL;
......
/* cgc.c -*- Mode: C; comment-column: 40; -*-
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/cgc.c,v 1.11 2004/07/12 23:44:07 pmai Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/cgc.c,v 1.12 2005/09/05 06:09:12 cshapiro Exp $
*
* Conservative Garbage Collector for CMUCL x86.
*
......@@ -16,6 +16,7 @@
#include <stdio.h>
#include <assert.h>
#include <signal.h>
#include <string.h>
#include "os.h" /* for SetSymbolValue */
#include "globals.h" /* For dynamic_space_size */
#include "x86-validate.h" /* for memory layout */
......@@ -264,7 +265,7 @@ os_vm_size_t length;
if(block_start > addr)
bzero((char *)addr, MIN(block_start - addr, length));
memset((char *)addr, 0, MIN(block_start - addr, length))
if(block_start < end)
{
......@@ -273,7 +274,7 @@ os_vm_size_t length;
block_size =os_trunc_size_to_page(length);
if(block_size < length)
bzero((char *)block_start + block_size,length - block_size);
memset((char *)block_start + block_size,0,length - block_size);
if (block_size != 0)
{
......
......@@ -50,7 +50,7 @@ int main(int argc, char** argv)
dprintf("Reading remainder of Segment command (%d bytes)", sizeof(thesegment)-sizeof(struct load_command));
read(fd,&thesegment.segname,sizeof(thesegment)-sizeof(struct load_command));
bzero(segname,17);
memset(segname,0,17);
memcpy(segname,thesegment.segname,16);
dprintf("Segname: %s\n",segname);
if (0==strncmp(thesegment.segname,"CMUCLRO",7)) {
......
/*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/hpux-os.c,v 1.5 2003/07/19 14:10:16 emarsden Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/hpux-os.c,v 1.6 2005/09/05 06:09:13 cshapiro Exp $
*
* OS-dependent routines. This file (along with os.h) exports an
* OS-independent interface to the operating system VM facilities.
......@@ -255,7 +255,7 @@ os_zero(os_vm_address_t addr,os_vm_size_t length)
block_size=os_trunc_size_to_page(length);
if(block_start>addr)
bzero((char *)addr,block_start-addr);
memset((char *)addr,0,block_start-addr);
if(block_size<length)
assert(FALSE);
......@@ -314,7 +314,7 @@ int getrusage(int who,struct rusage *rusage)
struct tms buf;
clock_t uticks, sticks;
bzero(rusage,sizeof(struct rusage));
memset(rusage,0,sizeof(struct rusage));
if (ticks_per_sec == 0) {
ticks_per_sec = sysconf(_SC_CLK_TCK);
usec_per_tick = 1000000 / ticks_per_sec;
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/monitor.c,v 1.18 2004/07/08 18:21:29 rtoy Exp $ */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/monitor.c,v 1.19 2005/09/05 06:09:13 cshapiro Exp $ */
#include <stdio.h>
#include <sys/types.h>
......@@ -486,7 +486,7 @@ void ldb_monitor()
{
jmp_buf oldbuf;
bcopy(curbuf, oldbuf, sizeof(oldbuf));
memcpy(oldbuf, curbuf, sizeof(jmp_buf));
printf("LDB monitor\n");
......@@ -496,7 +496,7 @@ void ldb_monitor()
done = FALSE;
bcopy(oldbuf, curbuf, sizeof(curbuf));
memcpy(curbuf, oldbuf, sizeof(jmp_buf));
}
void throw_to_monitor()
......
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os-common.c,v 1.18 2005/02/07 00:49:02 rtoy Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os-common.c,v 1.19 2005/09/05 06:09:13 cshapiro Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -41,9 +41,9 @@ os_vm_size_t length;
block_size=os_trunc_size_to_page(length);
if(block_start>addr)
bzero((char *)addr,block_start-addr);
memset((char *)addr,0,block_start-addr);
if(block_size<length)
bzero((char *)block_start+block_size,length-block_size);
memset((char *)block_start+block_size,0,length-block_size);
if (block_size != 0) {
/* Now deallocate and allocate the block so that it */
......@@ -98,7 +98,7 @@ os_vm_address_t os_reallocate(os_vm_address_t addr, os_vm_size_t old_len,
os_vm_address_t new=os_allocate(len);
if(new!=NULL){
bcopy((char*)addr, (char*)new,old_len);
memcpy((char*)new, (char*)addr, old_len);
os_invalidate(addr,old_len);
}
......
......@@ -10,13 +10,13 @@
and x86/GENCGC stack scavenging, by Douglas Crosher, 1996, 1997,
1998.
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/purify.c,v 1.32 2005/05/03 14:57:24 rtoy Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/purify.c,v 1.33 2005/09/05 06:09:13 cshapiro Exp $
*/
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include "lisp.h"
#include "arch.h"
......@@ -547,7 +547,7 @@ static lispobj ptrans_boxed(lispobj thing, lispobj header, boolean constant)
}
/* Copy it. */
bcopy(old, new, nwords * sizeof(lispobj));
memmove(new, old, nwords * sizeof(lispobj));
/* Deposit forwarding pointer. */
result = (lispobj)new | LowtagOf(thing);
......@@ -590,7 +590,7 @@ static lispobj ptrans_instance(lispobj thing, lispobj header, boolean constant)
assert_static_space_bounds (static_free);
/* Copy it. */
bcopy(old, new, nwords * sizeof(lispobj));
memmove(new, old, nwords * sizeof(lispobj));
/* Deposit forwarding pointer. */
result = (lispobj)new | LowtagOf(thing);
......@@ -622,7 +622,7 @@ static lispobj ptrans_fdefn(lispobj thing, lispobj header)
assert_static_space_bounds (static_free);
/* Copy it. */
bcopy(old, new, nwords * sizeof(lispobj));
memmove(new, old, nwords * sizeof(lispobj));
/* Deposit forwarding pointer. */
result = (lispobj)new | LowtagOf(thing);
......@@ -652,7 +652,7 @@ static lispobj ptrans_unboxed(lispobj thing, lispobj header)
assert_readonly_space_bounds (read_only_free);
/* Copy it. */
bcopy(old, new, nwords * sizeof(lispobj));
memmove(new, old, nwords * sizeof(lispobj));
/* Deposit forwarding pointer. */
result = (lispobj)new | LowtagOf(thing);
......@@ -686,7 +686,7 @@ static lispobj ptrans_vector(lispobj thing, int bits, int extra,
assert_readonly_space_bounds (read_only_free);
}
bcopy(vector, new, nwords * sizeof(lispobj));
memmove(new, vector, nwords * sizeof(lispobj));
result = (lispobj)new | LowtagOf(thing);
vector->header = result;
......@@ -794,7 +794,7 @@ static lispobj ptrans_code(lispobj thing)
read_only_free += CEILING(nwords, 2);
assert_readonly_space_bounds (read_only_free);
bcopy(code, new, nwords * sizeof(lispobj));
memmove(new, code, nwords * sizeof(lispobj));
#if (defined(i386) || defined(__x86_64))
apply_code_fixups_during_purify(code,new);
......@@ -902,7 +902,7 @@ static lispobj ptrans_func(lispobj thing, lispobj header)
assert_readonly_space_bounds (read_only_free);
}
/* Copy it. */
bcopy(old, new, nwords * sizeof(lispobj));
memmove(new, old, nwords * sizeof(lispobj));
/* Deposit forwarding pointer. */
result = (lispobj)new | LowtagOf(thing);
......
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Attic/socket.c,v 1.4 2000/10/26 19:50:19 dtc Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Attic/socket.c,v 1.5 2005/09/05 06:09:13 cshapiro Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -104,9 +104,9 @@ int connect_to_server (char *host, int display)
}
/* Set up the socket data. */
inaddr.sin_family = host_ptr->h_addrtype;
bcopy((char *)host_ptr->h_addr,
(char *)&inaddr.sin_addr,
sizeof(inaddr.sin_addr));
memcpy((char *)&inaddr.sin_addr,
(char *)host_ptr->h_addr,
sizeof(inaddr.sin_addr));
}
else
{
......
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sunos-os.h,v 1.6 2005/01/13 19:55:01 fgilham Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sunos-os.h,v 1.7 2005/09/05 06:09:13 cshapiro Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -56,9 +56,6 @@ typedef int os_vm_prot_t;
#define NULL 0
#endif
#define bcopy(a,b,n) memmove(b,a,n)
#define bzero(a,n) memset(a,0,n)
extern void flush_icache(unsigned int*, unsigned int);
extern void save_context(void);
......
/*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.c,v 1.21 2004/07/08 18:21:29 rtoy Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.c,v 1.22 2005/09/05 06:09:13 cshapiro Exp $
*
* Memory Validation
*/
......@@ -81,9 +81,9 @@ validate(void)
dynamic space segment in the executable), then copy the data
back into it. This is necessary to make the data in the
dynamic space segment available to the new lisp process. */
bcopy(dynamic_0_space, dynamic_space_data, (int)&image_dynamic_space_size);
memcpy(dynamic_space_data, dynamic_0_space, (int)&image_dynamic_space_size);
ensure_space(dynamic_0_space, dynamic_space_size);
bcopy(dynamic_space_data, dynamic_0_space, (int)&image_dynamic_space_size);
memcpy(dynamic_0_space, dynamic_space_data, (int)&image_dynamic_space_size);
} else
ensure_space(dynamic_0_space, dynamic_space_size);
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/vars.c,v 1.4 2005/08/01 21:53:00 rtoy Exp $ */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/vars.c,v 1.5 2005/09/05 06:09:13 cshapiro Exp $ */
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
......@@ -62,8 +62,8 @@ void flush_vars()
free(var);
}
}
bzero(NameHash, sizeof(NameHash));
bzero(ObjHash, sizeof(ObjHash));
memset(NameHash, 0, sizeof(NameHash));
memset(ObjHash, 0, sizeof(ObjHash));
tempcntr = 1;
for (var = perm; var != NULL; var = next) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment