diff options
Diffstat (limited to 'zap/src/mem/strcmp.c')
-rw-r--r-- | zap/src/mem/strcmp.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/zap/src/mem/strcmp.c b/zap/src/mem/strcmp.c deleted file mode 100644 index d620560..0000000 --- a/zap/src/mem/strcmp.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright 2022 Gabriel Jensen. - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -*/ - -#include <zap/priv.h> - -#include <zap/mem.h> - -#include <stdint.h> - -zap_cmp zap_strcmp(char const * const _lstr,char const * const _rstr) { - unsigned char const * lpos = (unsigned char const *)_lstr; - unsigned char const * rpos = (unsigned char const *)_rstr; - for (;;++lpos,++rpos) { - unsigned char const lchr = *lpos; - unsigned char const rchr = *rpos; - sus_likely (lchr != rchr) {return lchr < rchr ? zap_lt : zap_gt;} - if (lchr == (unsigned char)0x0) {return zap_eq;} - } - sus_unreach(); -} |