aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-strcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/bench-strcpy.c')
-rw-r--r--benchtests/bench-strcpy.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/benchtests/bench-strcpy.c b/benchtests/bench-strcpy.c
index 9fe999e5f4..7a7cf4abb2 100644
--- a/benchtests/bench-strcpy.c
+++ b/benchtests/bench-strcpy.c
@@ -33,26 +33,19 @@
# define TEST_NAME "strcpy"
# else
# define TEST_NAME "wcscpy"
+# define generic_strcpy generic_wcscpy
# endif
-# include "bench-string.h"
-# ifndef WIDE
-# define SIMPLE_STRCPY simple_strcpy
-# else
-# define SIMPLE_STRCPY simple_wcscpy
-# endif
-
-CHAR *SIMPLE_STRCPY (CHAR *, const CHAR *);
-
-IMPL (SIMPLE_STRCPY, 0)
-IMPL (STRCPY, 1)
+#include "bench-string.h"
CHAR *
-SIMPLE_STRCPY (CHAR *dst, const CHAR *src)
+generic_strcpy (CHAR *dst, const CHAR *src)
{
- CHAR *ret = dst;
- while ((*dst++ = *src++) != '\0');
- return ret;
+ return MEMCPY (dst, src, STRLEN (src) + 1);
}
+
+IMPL (STRCPY, 1)
+IMPL (generic_strcpy, 0)
+
#endif
typedef CHAR *(*proto_t) (CHAR *, const CHAR *);