aboutsummaryrefslogtreecommitdiffstats
path: root/rawmemelemcpy.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-25 14:17:49 +0100
committerMattias Andrée <maandree@kth.se>2018-11-25 14:17:49 +0100
commite2dc7cf9c966d4c94b7556c1c2ada8d170715654 (patch)
tree78733ab53fb0e1d185773d23f0f5ccd373be2bc1 /rawmemelemcpy.c
parentAdd man pages (diff)
downloadlibsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.gz
libsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.bz2
libsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.xz
Fix consistence in memelem functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--rawmemelemcpy.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/rawmemelemcpy.c b/rawmemelemcpy.c
index 2f0f9f0..ef6b21c 100644
--- a/rawmemelemcpy.c
+++ b/rawmemelemcpy.c
@@ -36,27 +36,27 @@ rawmemelemcpy64(uint64_t *restrict d, const uint64_t *restrict s, uint64_t elem)
static inline char *
-rawmemelemcpyx(char *restrict d, const char *restrict s, const char *restrict elem, size_t size)
+rawmemelemcpyx(char *restrict d, const char *restrict s, const char *restrict elem, size_t width)
{
size_t i;
- for (;; s += size) {
- for (i = 0; i < size; i++)
+ for (;; s += width) {
+ for (i = 0; i < width; i++)
d[i] = s[i];
- for (i = 0; i < size; i++)
+ for (i = 0; i < width; i++)
if (d[i] != elem[i])
goto next;
- d += size;
+ d += width;
return d;
next:
- d += size;
+ d += width;
}
}
void *
-libsimple_rawmemelemcpy(void *restrict d, const void *restrict s, const void *restrict elem, size_t size) /* TODO man */
+libsimple_rawmemelemcpy(void *restrict d, const void *restrict s, const void *restrict elem, size_t width) /* TODO man */
{
- switch (size) {
+ switch (width) {
case 0:
return d;
case 1:
@@ -68,7 +68,7 @@ libsimple_rawmemelemcpy(void *restrict d, const void *restrict s, const void *re
case 8:
return rawmemelemcpy64(d, s, *(const uint64_t *)elem);
default:
- return rawmemelemcpyx(d, s, elem, size);
+ return rawmemelemcpyx(d, s, elem, width);
}
}