From 335719f3a1a55f8a40f94f47df7f647d453e9d8e Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 9 Sep 2003 23:13:50 +0000 Subject: [PATCH] * Replaced bcopy/bzero/bcmp with memcpu/memeset/memcmp. git-svn-id: svn://svn.zoy.org/elk/trunk@137 55e467fa-43c5-0310-a8a2-de718669efc6 --- lib/misc/bitstring.c | 4 ++-- lib/xlib/property.c | 2 +- lib/xwidgets/context.c | 2 +- lib/xwidgets/function.c | 4 ++-- lib/xwidgets/resource.c | 8 ++++---- src/bool.c | 2 +- src/symbol.c | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/misc/bitstring.c b/lib/misc/bitstring.c index 7982369..5fa5120 100644 --- a/lib/misc/bitstring.c +++ b/lib/misc/bitstring.c @@ -63,7 +63,7 @@ static int Bitstring_Equal(Object b1, Object b2) { if (a->len != b->len) return 0; - return !bcmp(a->data, b->data, bits_to_bytes(a->len)); + return !memcmp(a->data, b->data, bits_to_bytes(a->len)); } static Object P_Bitstring_Equalp(Object a, Object b) { @@ -105,7 +105,7 @@ static Object Make_Bitstring(unsigned int len) { int nbytes = bits_to_bytes(len); b = Alloc_Object(sizeof(struct S_Bitstring) + nbytes-1, T_Bitstring, 0); - bzero((char *)BITSTRING(b)->data, nbytes); + memset((char *)BITSTRING(b)->data, 0, nbytes); BITSTRING(b)->tag = Null; BITSTRING(b)->len = len; return b; diff --git a/lib/xlib/property.c b/lib/xlib/property.c index 7e14569..fe9b06f 100644 --- a/lib/xlib/property.c +++ b/lib/xlib/property.c @@ -140,7 +140,7 @@ static Object P_Get_Property (Object w, Object prop, Object type, Object start, Object s; x = Make_String ((char *)0, (int)nitems); s = Car (t) = x; - bcopy ((char *)data, STRING(s)->data, (int)nitems); + memcpy (STRING(s)->data, (char *)data, (int)nitems); } else { Object v; GC_Node; diff --git a/lib/xwidgets/context.c b/lib/xwidgets/context.c index a709712..e519bf1 100644 --- a/lib/xwidgets/context.c +++ b/lib/xwidgets/context.c @@ -157,7 +157,7 @@ static Object P_Set_Context_Fallback_Resources (int argc, Object *argv) { Check_Type (argv[i], T_String); sp = STRING(argv[i]); p[i] = XtMalloc (sp->size + 1); - bcopy (sp->data, p[i], sp->size); + memcpy (p[i], sp->data, sp->size); p[i][sp->size] = 0; } p[i] = 0; diff --git a/lib/xwidgets/function.c b/lib/xwidgets/function.c index 904a042..55d160a 100644 --- a/lib/xwidgets/function.c +++ b/lib/xwidgets/function.c @@ -45,8 +45,8 @@ int Register_Function (Object x) { GC_Link (x); v = Make_Vector (max_functions, Null); GC_Unlink; - bcopy ((char *)VECTOR(Functions)->data, (char *)VECTOR(v)->data, - i * sizeof (Object)); + memcpy ((char *)VECTOR(v)->data, (char *)VECTOR(Functions)->data, + i * sizeof (Object)); Functions = v; } VECTOR(Functions)->data[i] = x; diff --git a/lib/xwidgets/resource.c b/lib/xwidgets/resource.c index bcb1dcf..dee7987 100644 --- a/lib/xwidgets/resource.c +++ b/lib/xwidgets/resource.c @@ -116,12 +116,12 @@ void Get_All_Resources (int sub, Widget w, WidgetClass c, XtResource **rp, *np = nr + snr + cnr; *cp = cnr; *rp = (XtResource *)XtMalloc (*np * sizeof (XtResource)); - bcopy ((char *)r, (char *)*rp, nr * sizeof (XtResource)); + memcpy ((char *)*rp, (char *)r, nr * sizeof (XtResource)); XtFree ((char *)r); if (snr) - bcopy ((char *)sr, (char *)(*rp + nr), snr * sizeof (XtResource)); + memcpy ((char *)(*rp + nr), (char *)sr, snr * sizeof (XtResource)); if (cnr) { - bcopy ((char *)cr, (char *)(*rp + nr+snr), cnr * sizeof (XtResource)); + memcpy ((char *)(*rp + nr+snr), (char *)cr, cnr * sizeof (XtResource)); XtFree ((char *)cr); } } @@ -192,7 +192,7 @@ void Convert_Args (int ac, Object *av, ArgList to, Widget widget, } else if (dt == T_Float) { float f = (float)Get_Double (val); to[i].name = res; - bcopy ((char *)&f, (char *)&to[i].value, sizeof f); + memcpy ((char *)&to[i].value, (char *)&f, sizeof f); } else if (dt == T_Dimension || dt == T_Position || dt == T_Cardinal || dt == T_Fixnum) { XtSetArg (to[i], res, Get_Integer (val)); diff --git a/src/bool.c b/src/bool.c index 916dc2e..7f9dcec 100644 --- a/src/bool.c +++ b/src/bool.c @@ -119,7 +119,7 @@ again: case T_String: { struct S_String *p1 = STRING(x1), *p2 = STRING(x2); return p1->size == p2->size && - bcmp (p1->data, p2->data, p1->size) == 0; + memcmp (p1->data, p2->data, p1->size) == 0; } case T_Vector: { struct S_Vector *p1 = VECTOR(x1), *p2 = VECTOR(x2); diff --git a/src/symbol.c b/src/symbol.c index 9a7cec1..3b18f29 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -101,7 +101,7 @@ Object Obarray_Lookup (register char const *str, register int len) { for (p = VECTOR(Obarray)->data[h]; !Nullp (p); p = sym->next) { sym = SYMBOL(p); s = STRING(sym->name); - if (s->size == len && bcmp (s->data, str, len) == 0) + if (s->size == len && memcmp (s->data, str, len) == 0) return p; } return Make_Integer (h);