about summary refs log tree commit diff
path: root/benchtests/bench-strncpy.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2018-12-21 18:52:40 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2018-12-21 18:52:40 +0000
commit90d3320d7f57fae3d2f89d907e8307b6a76d133d (patch)
treef9089d25d13b05f53aa2e579c34be4e13f44e857 /benchtests/bench-strncpy.c
parent5d025ea61762c5995abb2273780f4cf28f17cedf (diff)
downloadglibc-90d3320d7f57fae3d2f89d907e8307b6a76d133d.tar.gz
glibc-90d3320d7f57fae3d2f89d907e8307b6a76d133d.tar.xz
glibc-90d3320d7f57fae3d2f89d907e8307b6a76d133d.zip
Refactor string benchtests
Refactor string benchtests by moving duplicated defines into
bench-string.h.

	* benchtests/bench-memchr.c: Cleanup defines.
	* benchtests/bench-memcmp.c: Likewise.
	* benchtests/bench-memset.c: Likewise.
	* benchtests/bench-memset-large.c: Likewise.
	* benchtests/bench-memset-walk.c: Likewise.
	* benchtests/bench-stpcpy.c: Likewise.
	* benchtests/bench-stpncpy.c: Likewise.
	* benchtests/bench-strcat.c: Likewise.
	* benchtests/bench-strchr.c: Likewise.
	* benchtests/bench-strcmp.c: Likewise.
	* benchtests/bench-strcpy.c: Likewise.
	* benchtests/bench-strcspn.c: Likewise.
	* benchtests/bench-string.h: Likewise.
	* benchtests/bench-strlen.c: Likewise.
	* benchtests/bench-strncat.c: Likewise.
	* benchtests/bench-strncmp.c: Likewise.
	* benchtests/bench-strncpy.c: Likewise.
	* benchtests/bench-strnlen.c: Likewise.
	* benchtests/bench-strpbrk.c: Likewise.
	* benchtests/bench-strrchr.c: Likewise.
	* benchtests/bench-strspn.c: Likewise.
Diffstat (limited to 'benchtests/bench-strncpy.c')
-rw-r--r--benchtests/bench-strncpy.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/benchtests/bench-strncpy.c b/benchtests/bench-strncpy.c
index 62daef6b84..79953759bf 100644
--- a/benchtests/bench-strncpy.c
+++ b/benchtests/bench-strncpy.c
@@ -16,26 +16,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#define BIG_CHAR MAX_CHAR
+
 #ifdef WIDE
-# include <wchar.h>
-# define CHAR wchar_t
-# define UCHAR wchar_t
-# define BIG_CHAR WCHAR_MAX
 # define SMALL_CHAR 1273
-# define MEMCMP wmemcmp
-# define MEMSET wmemset
-# define STRNLEN wcsnlen
 #else
-# define CHAR char
-# define UCHAR unsigned char
-# define BIG_CHAR CHAR_MAX
 # define SMALL_CHAR 127
-# define MEMCMP memcmp
-# define MEMSET memset
-# define STRNLEN strnlen
 #endif /* !WIDE */
 
-
 #ifndef STRNCPY_RESULT
 # define STRNCPY_RESULT(dst, len, n) dst
 # define TEST_MAIN
@@ -48,11 +36,9 @@
 # ifndef WIDE
 #  define SIMPLE_STRNCPY simple_strncpy
 #  define STUPID_STRNCPY stupid_strncpy
-#  define STRNCPY strncpy
 # else
 #  define SIMPLE_STRNCPY simple_wcsncpy
 #  define STUPID_STRNCPY stupid_wcsncpy
-#  define STRNCPY wcsncpy
 # endif /* WIDE */
 
 CHAR *SIMPLE_STRNCPY (CHAR *, const CHAR *, size_t);