Gitweb links:
...log
http://git.netsurf-browser.org/libwapcaplet.git/shortlog/57a0bd85416ede86191dd2aed1b18e3899eb7323
...commit
http://git.netsurf-browser.org/libwapcaplet.git/commit/57a0bd85416ede86191dd2aed1b18e3899eb7323
...tree
http://git.netsurf-browser.org/libwapcaplet.git/tree/57a0bd85416ede86191dd2aed1b18e3899eb7323
The branch, master has been updated
via 57a0bd85416ede86191dd2aed1b18e3899eb7323 (commit)
from 5c5da29f919f3356fa71a4c375f4b162fe9e89c0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libwapcaplet.git/commit/?id=57a0bd85416ede86191dd2aed1b18e3899eb7323
commit 57a0bd85416ede86191dd2aed1b18e3899eb7323
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Correct memcpy typedef
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 <[email protected]>
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
-----------------------------------------------------------------------
Summary of changes:
src/libwapcaplet.c | 11 ++++++++---
1 file 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
--
String internment library
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org