summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-02-16 10:02:38 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-02-16 10:02:38 +0000
commit57a0bd85416ede86191dd2aed1b18e3899eb7323 (patch)
tree06063daef38a60f2072ca85bb6ca115d7d2dc4a7
parent5c5da29f919f3356fa71a4c375f4b162fe9e89c0 (diff)
downloadlibwapcaplet-57a0bd85416ede86191dd2aed1b18e3899eb7323.tar.gz
libwapcaplet-57a0bd85416ede86191dd2aed1b18e3899eb7323.tar.bz2
Correct memcpy typedefHEADmaster
This should silence some warnings about lwc__lcase_memcpy not having the same signature as the libc memcpy. Interestingly I learned that memcpy returns a value. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--src/libwapcaplet.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libwapcaplet.c b/src/libwapcaplet.c
index 3ef0003..9bc1fc9 100644
--- a/src/libwapcaplet.c
+++ b/src/libwapcaplet.c
@@ -47,7 +47,7 @@ static lwc_context *ctx = NULL;
typedef lwc_hash (*lwc_hasher)(const char *, size_t);
typedef int (*lwc_strncmp)(const char *, const char *, size_t);
-typedef void (*lwc_memcpy)(char * restrict, const char * restrict, size_t);
+typedef void * (*lwc_memcpy)(void * restrict, const void * restrict, size_t);
static lwc_error
lwc__initialise(void)
@@ -238,12 +238,17 @@ lwc__lcase_strncmp(const char *s1, const char *s2, size_t n)
return 0;
}
-static void
-lwc__lcase_memcpy(char *restrict target, const char *restrict source, size_t n)
+static void *
+lwc__lcase_memcpy(void *restrict _target, const void *restrict _source, size_t n)
{
+ char *restrict target = _target;
+ const char *restrict source = _source;
+
while (n--) {
*target++ = lwc__dolower(*source++);
}
+
+ return _target;
}
lwc_error