diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2015-03-17 03:08:13 +0000 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2015-03-17 03:08:13 +0000 |
commit | 97c386159c44a851d323f36ef6078c5a8f0d4c13 (patch) | |
tree | 15875c49d385bffd006f5aa049afc8c3f37e7b43 | |
parent | 82d29e4a85507816e28199b108209a643a8b6a93 (diff) | |
download | libc-bench-RLCR-15.12.tar.gz |
Fix error when compiling with clangRLCR-16.11RLCR-16.01RLCR-15.12
Change-Id: I3ac9567713ad8120c89b497bd8fb021e936a5ca8
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | string.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -4,13 +4,13 @@ #define BUFLEN 500000 -size_t b_string_strstr(void *dummy) +long b_string_strstr(void *dummy) { const char *needle = dummy; size_t l = strlen(needle); size_t i; size_t cnt = 10000; - size_t cs = 0; + long cs = 0; char *haystack = malloc(l * cnt + 1); for (i=0; i<cnt-1; i++) { memcpy(haystack + l*i, needle, l); @@ -19,7 +19,7 @@ size_t b_string_strstr(void *dummy) memcpy(haystack + l*i, needle, l+1); for (i=0; i<50; i++) { haystack[0]^=1; - cs += (char *)strstr(haystack, needle); + cs += (long)strstr(haystack, needle); } free(haystack); return cs; @@ -35,17 +35,17 @@ size_t b_string_memset(void *dummy) return 0; } -size_t b_string_strchr(void *dummy) +long b_string_strchr(void *dummy) { char *buf = malloc(BUFLEN); size_t i; - size_t cs; + long cs; memset(buf, 'a', BUFLEN); buf[BUFLEN-1] = 0; buf[BUFLEN-2] = 'b'; for (i=0; i<100; i++) { buf[i] = '0'+i%8; - cs += (char *)strchr(buf, 'b'); + cs += (long)strchr(buf, 'b'); } free(buf); return cs; |