From 39a81e5ac632d3356ebd4c0b40fb24aa3228833d Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Fri, 15 Mar 2013 11:47:11 +0100 Subject: [PATCH] The optimised aligned version was broken and not used. As pointed out by Hamish the alignment used && in second case instead of &, which meant it was never used. Another error when a32 was 0xFF000000 and b32 was 0xFF00FFFF would return a non zero value. A simple fix for the issues with going over to the byte by byte comparison failed, so rather than leave broken code I remove this for the time being. Not the best code I've written obviously. --- src/system/libroot/posix/string/strcmp.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/system/libroot/posix/string/strcmp.c b/src/system/libroot/posix/string/strcmp.c index cdba1d4f01..56e058e2cb 100644 --- a/src/system/libroot/posix/string/strcmp.c +++ b/src/system/libroot/posix/string/strcmp.c @@ -15,19 +15,6 @@ int strcmp(char const *a, char const *b) { - /* Make sure we don't pass page boundries on a or b when doing four byte - comparisons */ - if ((((addr_t)a) & 3) == 0 && (((addr_t)b) && 3) == 0) { - uint32* a32 = (uint32*)a; - uint32* b32 = (uint32*)b; - - while (LACKS_ZERO_BYTE(*a32)) { - int32 cmp = *a32++ - *b32++; - if (cmp != 0) - return cmp; - } - return *a32 - *b32; - } while (true) { int cmp = (unsigned char)*a - (unsigned char)*b++; if (cmp != 0 || *a++ == '\0')