|
|
Message-ID: <20250330121748.699050-1-cgoettsche@seltendoof.de>
Date: Sun, 30 Mar 2025 14:17:35 +0200
From: Christian Göttsche <cgoettsche@...tendoof.de>
To: musl@...ts.openwall.com
Cc: Christian Göttsche <cgzones@...glemail.com>
Subject: [PATCH 1/4] wmemmove: implement via memmove()
From: Christian Göttsche <cgzones@...glemail.com>
Implement via memmove() to inherit its optimizations.
---
src/string/wmemmove.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/string/wmemmove.c b/src/string/wmemmove.c
index 964c9032..380d11f0 100644
--- a/src/string/wmemmove.c
+++ b/src/string/wmemmove.c
@@ -1,13 +1,8 @@
#include <wchar.h>
#include <stdint.h>
+#include <string.h>
wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n)
{
- wchar_t *d0 = d;
- if (d == s) return d;
- if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d)
- while (n--) d[n] = s[n];
- else
- while (n--) *d++ = *s++;
- return d0;
+ return memmove(d, s, n * sizeof(wchar_t));
}
--
2.49.0
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.