summaryrefslogtreecommitdiff
path: root/src/SetValues.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-11 18:41:14 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-11 18:51:26 -0700
commit3c54e99864eb6dba0d0cde7fe0a23ed7c1f5875f (patch)
treec00b9f2dc00e8b391052d4a8726d356b0d772e8a /src/SetValues.c
parentbbe78f905da6e36ebe1fe520903c760107b92b78 (diff)
downloadxorg-lib-libXt-3c54e99864eb6dba0d0cde7fe0a23ed7c1f5875f.tar.gz
Use memcpy() instead of memmove() when buffers are known not to overlap
Most of these came from a mass bcopy() -> memmove() substitution in 1993 with a commit comment of "ANSIfication". Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/SetValues.c')
-rw-r--r--src/SetValues.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/SetValues.c b/src/SetValues.c
index d05fcc5..d24ca03 100644
--- a/src/SetValues.c
+++ b/src/SetValues.c
@@ -224,7 +224,7 @@ XtSetValues(register Widget w, ArgList args, Cardinal num_args)
UNLOCK_PROCESS;
oldw = (Widget) XtStackAlloc(widgetSize, oldwCache);
reqw = (Widget) XtStackAlloc(widgetSize, reqwCache);
- (void) memmove((char *) oldw, (char *) w, (size_t) widgetSize);
+ (void) memcpy(oldw, w, (size_t) widgetSize);
/* Set resource values */
@@ -233,7 +233,7 @@ XtSetValues(register Widget w, ArgList args, Cardinal num_args)
wc->core_class.num_resources, args, num_args);
UNLOCK_PROCESS;
- (void) memmove((char *) reqw, (char *) w, (size_t) widgetSize);
+ (void) memcpy(reqw, w, (size_t) widgetSize);
hasConstraints = (XtParent(w) != NULL && !XtIsShell(w) &&
XtIsConstraint(XtParent(w)));
@@ -257,8 +257,8 @@ XtSetValues(register Widget w, ArgList args, Cardinal num_args)
/* Allocate and copy current constraints into oldw */
oldw->core.constraints = XtStackAlloc(constraintSize, oldcCache);
reqw->core.constraints = XtStackAlloc(constraintSize, reqcCache);
- (void) memmove((char *) oldw->core.constraints,
- (char *) w->core.constraints, (size_t) constraintSize);
+ (void) memcpy(oldw->core.constraints,
+ w->core.constraints, (size_t) constraintSize);
/* Set constraint values */
LOCK_PROCESS;
@@ -266,8 +266,8 @@ XtSetValues(register Widget w, ArgList args, Cardinal num_args)
(XrmResourceList *) (cwc->constraint_class.resources),
cwc->constraint_class.num_resources, args, num_args);
UNLOCK_PROCESS;
- (void) memmove((char *) reqw->core.constraints,
- (char *) w->core.constraints, (size_t) constraintSize);
+ (void) memcpy(reqw->core.constraints,
+ w->core.constraints, (size_t) constraintSize);
}
/* Inform widget of changes, then inform parent of changes */