Merge pull request #1485 from Adrian-Diaz/memcpy2memmove

replace some calls to `memcpy()` with calls to `memmove()`
This commit is contained in:
Axel Kohlmeyer 2019-06-11 14:07:46 -04:00 committed by GitHub
commit 1dc8bb163d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ int mldivide3(const double m[3][3], const double *v, double *ans)
if (fabs(aug[j][i]) > fabs(aug[i][i])) {
double tempv[4];
memcpy(tempv,aug[i],4*sizeof(double));
memcpy(aug[i],aug[j],4*sizeof(double));
memmove(aug[i],aug[j],4*sizeof(double));
memcpy(aug[j],tempv,4*sizeof(double));
}
}
@ -68,7 +68,7 @@ int mldivide3(const double m[3][3], const double *v, double *ans)
if (p != i) {
double tempv[4];
memcpy(tempv,aug[i],4*sizeof(double));
memcpy(aug[i],aug[p],4*sizeof(double));
memmove(aug[i],aug[p],4*sizeof(double));
memcpy(aug[p],tempv,4*sizeof(double));
}

View File

@ -537,7 +537,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
if (dotmark[i] == markactive)
memcpy(&buf[outgoing++],&dots[i],sizeof(Dot));
else
memcpy(&dots[keep++],&dots[i],sizeof(Dot));
memmove(&dots[keep++],&dots[i],sizeof(Dot));
}
// post receives for dots
@ -1029,7 +1029,7 @@ void RCB::compute_old(int dimension, int n, double **x, double *wt,
if (dotmark[i] == markactive)
memcpy(&buf[outgoing++],&dots[i],sizeof(Dot));
else
memcpy(&dots[keep++],&dots[i],sizeof(Dot));
memmove(&dots[keep++],&dots[i],sizeof(Dot));
}
// post receives for dots