summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt6
-rw-r--r--GNUmakefile22
-rw-r--r--test/source/main.c (renamed from test/src/main.c)3
-rw-r--r--test/source/test/bool.i (renamed from test/src/test/bool.i)0
-rw-r--r--test/source/test/cmp.i (renamed from test/src/test/cmp.i)0
-rw-r--r--test/source/test/fndbyte.i (renamed from test/src/test/fndbyte.i)0
-rw-r--r--test/source/test/fndchr.i (renamed from test/src/test/fndchr.i)0
-rw-r--r--test/source/test/foreach.i (renamed from test/src/test/foreach.i)0
-rw-r--r--test/source/test/memcat.i (renamed from test/src/test/memcat.i)0
-rw-r--r--test/source/test/memcp.i (renamed from test/src/test/memcp.i)0
-rw-r--r--test/source/test/memeq.i (renamed from test/src/test/memeq.i)0
-rw-r--r--test/source/test/memfill.i (renamed from test/src/test/memfill.i)0
-rw-r--r--test/source/test/memgen.i (renamed from test/src/test/memgen.i)0
-rw-r--r--test/source/test/nullptr.i (renamed from test/src/test/nullptr.i)0
-rw-r--r--test/source/test/strcat.i (renamed from test/src/test/strcat.i)0
-rw-r--r--test/source/test/strcp.i (renamed from test/src/test/strcp.i)0
-rw-r--r--test/source/test/streq.i (renamed from test/src/test/streq.i)4
-rw-r--r--test/source/test/strfill.i (renamed from test/src/test/strfill.i)0
-rw-r--r--test/source/test/strlen.i (renamed from test/src/test/strlen.i)0
-rw-r--r--test/source/test/utf8dec.i (renamed from test/src/test/utf8dec.i)0
-rw-r--r--test/source/test/utf8enc.i (renamed from test/src/test/utf8enc.i)0
-rw-r--r--test/source/test/win1252dec.i (renamed from test/src/test/win1252dec.i)0
-rw-r--r--test/source/test/win1252enc.i (renamed from test/src/test/win1252enc.i)0
-rw-r--r--test/src/test/memcmp.i26
-rw-r--r--zap/GNUmakefile70
-rw-r--r--zap/include-private/zap/priv.h8
-rw-r--r--zap/include/zap/bs.h8
-rw-r--r--zap/include/zap/mem.h2
-rw-r--r--zap/source/amd64/mem/fndbyte.S (renamed from zap/src/mem/fndbyte.S)21
-rw-r--r--zap/source/amd64/mem/fndchr.S (renamed from zap/src/mem/fndchr.S)20
-rw-r--r--zap/source/amd64/mem/foreach.S (renamed from zap/src/mem/foreach.S)22
-rw-r--r--zap/source/amd64/mem/memcat.c (renamed from zap/src/mem/memcat.c)0
-rw-r--r--zap/source/amd64/mem/memcp.S (renamed from zap/src/mem/memcp.S)21
-rw-r--r--zap/source/amd64/mem/memeq.S (renamed from zap/src/mem/memeq.S)21
-rw-r--r--zap/source/amd64/mem/memfill.S (renamed from zap/src/mem/memfill.S)21
-rw-r--r--zap/source/amd64/mem/memgen.c (renamed from zap/src/mem/memgen.c)0
-rw-r--r--zap/source/amd64/mem/strcat.c (renamed from zap/src/mem/strcat.c)0
-rw-r--r--zap/source/amd64/mem/strcp.S (renamed from zap/src/mem/strcp.S)20
-rw-r--r--zap/source/amd64/mem/streq.S (renamed from zap/src/mem/streq.S)20
-rw-r--r--zap/source/amd64/mem/strfill.S (renamed from zap/src/mem/strfill.S)20
-rw-r--r--zap/source/amd64/mem/strlen.S (renamed from zap/src/mem/strlen.S)19
-rw-r--r--zap/source/amd64/mem/utf8dec.c (renamed from zap/src/mem/utf8dec.c)0
-rw-r--r--zap/source/amd64/mem/utf8declen.c (renamed from zap/src/mem/utf8declen.c)0
-rw-r--r--zap/source/amd64/mem/utf8enc.S (renamed from zap/src/mem/utf8enc.S)23
-rw-r--r--zap/source/amd64/mem/utf8enclen.S (renamed from zap/src/mem/utf8enclen.S)19
-rw-r--r--zap/source/amd64/mem/win1252dec.c (renamed from zap/src/mem/win1252dec.c)0
-rw-r--r--zap/source/amd64/mem/win1252enc.c (renamed from zap/src/mem/win1252enc.c)0
-rw-r--r--zap/src/mem/memcmp.c21
-rw-r--r--zap/src/mem/strcmp.c23
49 files changed, 90 insertions, 350 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 23bead7..8ae5831 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,9 @@
+# 11.0
+
+* Remove memcmp and strcmp;
+* Restructure sources;
+* Remove root makefile;
+
# 10.1
* Don't use susinfo;
diff --git a/GNUmakefile b/GNUmakefile
deleted file mode 100644
index 36105b5..0000000
--- a/GNUmakefile
+++ /dev/null
@@ -1,22 +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/.
-
-LIBZAP = zap/libzap.a
-
-.PHONY: clean install purge
-
-$(LIBZAP):
- $(MAKE) -Czap
-
-install: $(LIBZAP)
- mkdir -pm755 "$(HDRDIR)/zap"
- mkdir -pm755 "$(LIBDIR)"
- install -m644 "zap/include/zap/"*".h" "$(HDRDIR)/zap"
- install -m755 "$(LIBZAP)" "$(LIBDIR)"
-
-clean:
- $(MAKE) -Czap clean
-
-purge:
- $(MAKE) -Czap purge
diff --git a/test/src/main.c b/test/source/main.c
index 79bf0ce..38c9f68 100644
--- a/test/src/main.c
+++ b/test/source/main.c
@@ -23,7 +23,6 @@ typedef bool (* zaptest_testtyp)(void);
#include "test/fndchr.i"
#include "test/foreach.i"
#include "test/memcat.i"
-#include "test/memcmp.i"
#include "test/memcp.i"
#include "test/memeq.i"
#include "test/memfill.i"
@@ -46,7 +45,6 @@ static zaptest_testtyp zaptest_tests[] = {
zaptest_test_fndchr,
zaptest_test_foreach,
zaptest_test_memcat,
- zaptest_test_memcmp,
zaptest_test_memcp,
zaptest_test_memeq,
zaptest_test_memfill,
@@ -70,7 +68,6 @@ static char const * zaptest_testnms[] = {
"fndchr",
"foreach",
"memcat",
- "memcmp",
"memcp",
"memeq",
"memfill",
diff --git a/test/src/test/bool.i b/test/source/test/bool.i
index adacf85..adacf85 100644
--- a/test/src/test/bool.i
+++ b/test/source/test/bool.i
diff --git a/test/src/test/cmp.i b/test/source/test/cmp.i
index fbb7d5c..fbb7d5c 100644
--- a/test/src/test/cmp.i
+++ b/test/source/test/cmp.i
diff --git a/test/src/test/fndbyte.i b/test/source/test/fndbyte.i
index 56231ac..56231ac 100644
--- a/test/src/test/fndbyte.i
+++ b/test/source/test/fndbyte.i
diff --git a/test/src/test/fndchr.i b/test/source/test/fndchr.i
index 8fb670a..8fb670a 100644
--- a/test/src/test/fndchr.i
+++ b/test/source/test/fndchr.i
diff --git a/test/src/test/foreach.i b/test/source/test/foreach.i
index e7b933d..e7b933d 100644
--- a/test/src/test/foreach.i
+++ b/test/source/test/foreach.i
diff --git a/test/src/test/memcat.i b/test/source/test/memcat.i
index f16faef..f16faef 100644
--- a/test/src/test/memcat.i
+++ b/test/source/test/memcat.i
diff --git a/test/src/test/memcp.i b/test/source/test/memcp.i
index 4cfc17c..4cfc17c 100644
--- a/test/src/test/memcp.i
+++ b/test/source/test/memcp.i
diff --git a/test/src/test/memeq.i b/test/source/test/memeq.i
index d9de72f..d9de72f 100644
--- a/test/src/test/memeq.i
+++ b/test/source/test/memeq.i
diff --git a/test/src/test/memfill.i b/test/source/test/memfill.i
index 9cb4d6e..9cb4d6e 100644
--- a/test/src/test/memfill.i
+++ b/test/source/test/memfill.i
diff --git a/test/src/test/memgen.i b/test/source/test/memgen.i
index dcc7c69..dcc7c69 100644
--- a/test/src/test/memgen.i
+++ b/test/source/test/memgen.i
diff --git a/test/src/test/nullptr.i b/test/source/test/nullptr.i
index 00b49bd..00b49bd 100644
--- a/test/src/test/nullptr.i
+++ b/test/source/test/nullptr.i
diff --git a/test/src/test/strcat.i b/test/source/test/strcat.i
index e037b88..e037b88 100644
--- a/test/src/test/strcat.i
+++ b/test/source/test/strcat.i
diff --git a/test/src/test/strcp.i b/test/source/test/strcp.i
index cd878c9..cd878c9 100644
--- a/test/src/test/strcp.i
+++ b/test/source/test/strcp.i
diff --git a/test/src/test/streq.i b/test/source/test/streq.i
index f9f1d31..62ed186 100644
--- a/test/src/test/streq.i
+++ b/test/source/test/streq.i
@@ -4,14 +4,18 @@ static bool zaptest_test_streq(void) {
char const str0[] = "What's up, my guy?";
char const str1[] = "What's up, my guy?";
char const str2[] = "I don't know you!";
+ char const str3[] = "I don't know you! Or do I?";
zaptest_log(str0,char const *,"%s")
zaptest_log(str1,char const *,"%s")
zaptest_log(str2,char const *,"%s")
+ zaptest_log(str3,char const *,"%s")
zap_bool eq0 = zap_streq(str0,str1);
zap_bool eq1 = zap_streq(str0,str2);
zap_bool eq2 = zap_streq(str1,str2);
+ zap_bool eq3 = zap_streq(str2,str3);
zaptest_chk(eq0,zap_true, unsigned char,"%hhX");
zaptest_chk(eq1,zap_false,unsigned char,"%hhX");
zaptest_chk(eq2,zap_false,unsigned char,"%hhX");
+ zaptest_chk(eq3,zap_false,unsigned char,"%hhX");
return false;
}
diff --git a/test/src/test/strfill.i b/test/source/test/strfill.i
index 1e2764c..1e2764c 100644
--- a/test/src/test/strfill.i
+++ b/test/source/test/strfill.i
diff --git a/test/src/test/strlen.i b/test/source/test/strlen.i
index 93bec76..93bec76 100644
--- a/test/src/test/strlen.i
+++ b/test/source/test/strlen.i
diff --git a/test/src/test/utf8dec.i b/test/source/test/utf8dec.i
index fdea169..fdea169 100644
--- a/test/src/test/utf8dec.i
+++ b/test/source/test/utf8dec.i
diff --git a/test/src/test/utf8enc.i b/test/source/test/utf8enc.i
index 8bc7abb..8bc7abb 100644
--- a/test/src/test/utf8enc.i
+++ b/test/source/test/utf8enc.i
diff --git a/test/src/test/win1252dec.i b/test/source/test/win1252dec.i
index 23fbe2b..23fbe2b 100644
--- a/test/src/test/win1252dec.i
+++ b/test/source/test/win1252dec.i
diff --git a/test/src/test/win1252enc.i b/test/source/test/win1252enc.i
index 2bfa211..2bfa211 100644
--- a/test/src/test/win1252enc.i
+++ b/test/source/test/win1252enc.i
diff --git a/test/src/test/memcmp.i b/test/src/test/memcmp.i
deleted file mode 100644
index d54a062..0000000
--- a/test/src/test/memcmp.i
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdbool.h>
-
-static bool zaptest_test_memcmp(void) {
- unsigned char const arr0[] = {
- 0x7Fu,
- 0x3Fu,
- 0xFFu,
- };
- unsigned char const arr1[] = {
- 0x7Fu,
- 0x3Fu,
- 0x1Fu,
- };
- unsigned char const arr2[] = {
- 0x7Fu,
- 0x3Fu,
- 0xFFu,
- };
- zap_cmp cmp = zap_memcmp(arr0,sizeof (arr0),arr1);
- zaptest_chk(cmp,zap_gt,signed char,"%hhi")
- cmp = zap_memcmp(arr1,sizeof (arr1),arr0);
- zaptest_chk(cmp,zap_lt,signed char,"%hhi")
- cmp = zap_memcmp(arr0,sizeof (arr0),arr2);
- zaptest_chk(cmp,zap_eq,signed char,"%hhi")
- return false;
-}
diff --git a/zap/GNUmakefile b/zap/GNUmakefile
index 58a85ce..442cb32 100644
--- a/zap/GNUmakefile
+++ b/zap/GNUmakefile
@@ -2,6 +2,10 @@
# 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/.
+ifneq "$(arch)" "amd64"
+$(error invalid architecture)
+endif
+
# TOOLS
#CC = clang
@@ -9,49 +13,47 @@
# TOOL FLAGS
-ASFLAGS += \
+ASFLAGS := \
-g \
-march=native
-CFLAGS += \
+CFLAGS := \
-Ofast \
+ -Wall \
+ -Wextra \
+ -Wpedantic \
-fPIC \
-ffreestanding \
-g \
-march=native \
- -std=c90 \
- -Wall \
- -Wextra \
- -Wpedantic
+ -std=c90
-CPPFLAGS += \
+CPPFLAGS := \
-Iinclude \
- -Iinclude-private
+ -Iinclude-private \
# ARTEFACTS
-OBJS = \
- src/mem/fndbyte.o \
- src/mem/fndchr.o \
- src/mem/foreach.o \
- src/mem/memcat.o \
- src/mem/memcmp.o \
- src/mem/memcp.o \
- src/mem/memeq.o \
- src/mem/memfill.o \
- src/mem/memgen.o \
- src/mem/strcat.o \
- src/mem/strcmp.o \
- src/mem/streq.o \
- src/mem/strfill.o \
- src/mem/strcp.o \
- src/mem/strlen.o \
- src/mem/utf8dec.o \
- src/mem/utf8declen.o \
- src/mem/utf8enc.o \
- src/mem/utf8enclen.o \
- src/mem/win1252dec.o \
- src/mem/win1252enc.o
+OBJS = \
+ source/$(arch)/mem/fndbyte.o \
+ source/$(arch)/mem/fndchr.o \
+ source/$(arch)/mem/foreach.o \
+ source/$(arch)/mem/memcat.o \
+ source/$(arch)/mem/memcp.o \
+ source/$(arch)/mem/memeq.o \
+ source/$(arch)/mem/memfill.o \
+ source/$(arch)/mem/memgen.o \
+ source/$(arch)/mem/strcat.o \
+ source/$(arch)/mem/streq.o \
+ source/$(arch)/mem/strfill.o \
+ source/$(arch)/mem/strcp.o \
+ source/$(arch)/mem/strlen.o \
+ source/$(arch)/mem/utf8dec.o \
+ source/$(arch)/mem/utf8declen.o \
+ source/$(arch)/mem/utf8enc.o \
+ source/$(arch)/mem/utf8enclen.o \
+ source/$(arch)/mem/win1252dec.o \
+ source/$(arch)/mem/win1252enc.o
LIB = libzap.a
@@ -59,11 +61,17 @@ LIB = libzap.a
# TARGETS
-.PHONY: clean purge
+.PHONY: clean install purge
$(LIB): $(OBJS)
$(AR) r $@ $^
+install: $(LIB)
+ mkdir -pm755 "$(HDRDIR)/zap"
+ mkdir -pm755 "$(LIBDIR)"
+ install -m644 "zap/include/zap/"*".h" "$(HDRDIR)/zap"
+ install -m755 "$(LIB)" "$(LIBDIR)"
+
clean:
$(RM) $(OBJS)
diff --git a/zap/include-private/zap/priv.h b/zap/include-private/zap/priv.h
index c47d802..0aeafaa 100644
--- a/zap/include-private/zap/priv.h
+++ b/zap/include-private/zap/priv.h
@@ -7,14 +7,6 @@
#if !defined(zap_priv_hdr_priv)
#define zap_priv_hdr_priv
-#if !defined(__amd64__)
-#error zapq only supports AMD64!
-#endif
-
-#if !defined(__ASSEMBLER__)
#include <zap/bs.h>
-#include <sus/extra.h>
-#endif
-
#endif
diff --git a/zap/include/zap/bs.h b/zap/include/zap/bs.h
index c2a7053..4d8d004 100644
--- a/zap/include/zap/bs.h
+++ b/zap/include/zap/bs.h
@@ -26,15 +26,11 @@ typedef signed char zap_cmp;
#define zap_nopos (~((zap_sz)+0u))
-#if defined(__cplusplus)
-#define zap_nullptr ((unsigned long)0x0u)
-#else
-#define zap_nullptr ((void *)0x0u)
-#endif
+#define zap_nullptr ((zap_sz)0x0u)
typedef unsigned long zap_sz;
-#define zap_ver ((unsigned long)+0x10u)
+#define zap_ver ((unsigned long)+0x11u)
#if defined(__cplusplus)
}
diff --git a/zap/include/zap/mem.h b/zap/include/zap/mem.h
index 46ab872..f4877fa 100644
--- a/zap/include/zap/mem.h
+++ b/zap/include/zap/mem.h
@@ -17,13 +17,11 @@ __attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_fndbyte( void co
__attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_fndchr( char const * str, char chr);
__attribute__ ((hot)) void zap_foreach( void * ptr, zap_sz sz, zap_sz num, void (* fn)(void *));
__attribute__ ((hot,nothrow)) void zap_memcat( void const * lptr, zap_sz llen,void const * rptr, zap_sz rlen, void * buf);
-__attribute__ ((hot,nothrow,warn_unused_result)) zap_cmp zap_memcmp( void const * lstr, zap_sz num, void const * rstr);
__attribute__ ((hot,nothrow)) void zap_memcp( void const * in, zap_sz num, void * out);
__attribute__ ((hot,nothrow,warn_unused_result)) zap_bool zap_memeq( void const * lptr, zap_sz num, void const * rptr);
__attribute__ ((hot,nothrow)) void zap_memfill( void * ptr, zap_sz num, unsigned char val);
__attribute__ ((hot)) void zap_memgen( void * ptr, zap_sz sz, zap_sz num, void (* fn)(zap_sz,void *));
__attribute__ ((hot,nothrow)) void zap_strcat( char const * lstr, char const * rstr,char * buf);
-__attribute__ ((hot,nothrow,warn_unused_result)) zap_cmp zap_strcmp( char const * lstr, char const * rstr);
__attribute__ ((hot,nothrow)) zap_sz zap_strcp( char const * in, char * out);
__attribute__ ((hot,nothrow,warn_unused_result)) zap_bool zap_streq( char const * lstr, char const * rstr);
__attribute__ ((hot,nothrow)) zap_sz zap_strfill( char * lstr, char chr);
diff --git a/zap/src/mem/fndbyte.S b/zap/source/amd64/mem/fndbyte.S
index 4413b42..9298b73 100644
--- a/zap/src/mem/fndbyte.S
+++ b/zap/source/amd64/mem/fndbyte.S
@@ -1,23 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_fndbyte
zap_fndbyte:
-
- /*
- void const * ptr
- zap_sz num
- unsigned char byte
- */
-
-#if defined(__amd64__)
-
# rax: Address of the current element.
# rdi: Address of the first element.
# rsi: Address of the element after the last element.
@@ -55,5 +42,3 @@ zap_fndbyte:
movq $0xFFFFFFFFFFFFFFFF,%rax
ret
-
-#endif
diff --git a/zap/src/mem/fndchr.S b/zap/source/amd64/mem/fndchr.S
index 2982e7e..1078a10 100644
--- a/zap/src/mem/fndchr.S
+++ b/zap/source/amd64/mem/fndchr.S
@@ -1,22 +1,10 @@
-/*
- Copyright 2022 Gabriel Jensen.
- This Source Code Form is subject to the terms of the Mozilla Pudhic 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>
+# 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/.
.globl zap_fndchr
zap_fndchr:
-
- /*
- char const * str
- char chr
- */
-
-#if defined(__amd64__)
-
# rdi: Address of the first character.
# rsi: Character to be found.
# rax: Address of the current character.
@@ -53,5 +41,3 @@ zap_fndchr:
movq $0xFFFFFFFFFFFFFFFF,%rax
ret
-
-#endif
diff --git a/zap/src/mem/foreach.S b/zap/source/amd64/mem/foreach.S
index fe96538..f19bcfa 100644
--- a/zap/src/mem/foreach.S
+++ b/zap/source/amd64/mem/foreach.S
@@ -1,24 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_foreach
zap_foreach:
-
- /*
- void * ptr
- zap_sz sz
- zap_sz num
- void (* fn)(void *)
- */
-
-#if defined(__amd64__)
-
# rbx: Address of the current element.
# r12: Address of the element after the last input element.
# r13: Size of each input element.
@@ -67,5 +53,3 @@ zap_foreach:
popq %rbx
ret
-
-#endif
diff --git a/zap/src/mem/memcat.c b/zap/source/amd64/mem/memcat.c
index f3e9a9b..f3e9a9b 100644
--- a/zap/src/mem/memcat.c
+++ b/zap/source/amd64/mem/memcat.c
diff --git a/zap/src/mem/memcp.S b/zap/source/amd64/mem/memcp.S
index ead0718..5691446 100644
--- a/zap/src/mem/memcp.S
+++ b/zap/source/amd64/mem/memcp.S
@@ -1,22 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_memcp
zap_memcp:
-
- /*
- void const * in
- zap_sz num
- void * out
- */
-#if defined(__amd64__)
-
# rdi: Address of the current input element.
# rsi: Number of remaining elements.
# rdx: Address of the current output element.
@@ -103,5 +91,4 @@ zap_memcp:
.done:
ret
-
-#endif
+ \ No newline at end of file
diff --git a/zap/src/mem/memeq.S b/zap/source/amd64/mem/memeq.S
index cf554c2..ba43dfc 100644
--- a/zap/src/mem/memeq.S
+++ b/zap/source/amd64/mem/memeq.S
@@ -1,23 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_memeq
zap_memeq:
-
- /*
- void const * lptr
- zap_sz num
- void const * rptr
- */
-
-#if defined(__amd64__)
-
/* rdi: Left pointer. */
/* rsi: Number of remaining elements. */
/* rdx: Right pointer. */
@@ -78,5 +65,3 @@ zap_memeq:
.neq:
movb $0x0,%al
ret
-
-#endif
diff --git a/zap/src/mem/memfill.S b/zap/source/amd64/mem/memfill.S
index 63a1aad..e563b55 100644
--- a/zap/src/mem/memfill.S
+++ b/zap/source/amd64/mem/memfill.S
@@ -1,23 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_memfill
zap_memfill:
-
- /*
- void const * ptr
- zap_sz num
- unsigned char val
- */
-
-#if defined(__amd64__)
-
# rdi: Address of the current element.
# rsi: Address of the element after the last element.
# rdx: Byte value.
@@ -41,5 +28,3 @@ zap_memfill:
# Finish:
.done:
ret
-
-#endif
diff --git a/zap/src/mem/memgen.c b/zap/source/amd64/mem/memgen.c
index a39e326..a39e326 100644
--- a/zap/src/mem/memgen.c
+++ b/zap/source/amd64/mem/memgen.c
diff --git a/zap/src/mem/strcat.c b/zap/source/amd64/mem/strcat.c
index f7f66c8..f7f66c8 100644
--- a/zap/src/mem/strcat.c
+++ b/zap/source/amd64/mem/strcat.c
diff --git a/zap/src/mem/strcp.S b/zap/source/amd64/mem/strcp.S
index 04c3198..eb5c276 100644
--- a/zap/src/mem/strcp.S
+++ b/zap/source/amd64/mem/strcp.S
@@ -1,22 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_strcp
zap_strcp:
-
- /*
- char const * in
- char const * out
- */
-
-#if defined(__amd64__)
-
# rax: Address of the current input character.
# rdi: Address of the first input character.
# rsi: Address of the current output character.
@@ -49,5 +37,3 @@ zap_strcp:
decq %rax # We do not count the null-terminator in the string length.
ret
-
-#endif
diff --git a/zap/src/mem/streq.S b/zap/source/amd64/mem/streq.S
index d331e93..4270e7d 100644
--- a/zap/src/mem/streq.S
+++ b/zap/source/amd64/mem/streq.S
@@ -1,22 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_streq
zap_streq:
-
- /*
- char const * lstr
- char const * rstr
- */
-
-#if defined(__amd64__)
-
# rdi: Address of the current left character.
# rsi: Address of the current right character.
# rax: Current left character.
@@ -53,5 +41,3 @@ zap_streq:
movb $0x0,%al
ret
-
-#endif
diff --git a/zap/src/mem/strfill.S b/zap/source/amd64/mem/strfill.S
index 277865e..590b99f 100644
--- a/zap/src/mem/strfill.S
+++ b/zap/source/amd64/mem/strfill.S
@@ -1,22 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_strfill
zap_strfill:
-
- /*
- char * str
- char chr
- */
-
-#if defined(__amd64__)
-
# rdi: Address of the first character of the string.
# rsi: Fill character.
# rax: Address of the current character.
@@ -44,5 +32,3 @@ zap_strfill:
subq %rdi,%rax
ret
-
-#endif
diff --git a/zap/src/mem/strlen.S b/zap/source/amd64/mem/strlen.S
index 4cb435f..bd83008 100644
--- a/zap/src/mem/strlen.S
+++ b/zap/source/amd64/mem/strlen.S
@@ -1,21 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_strlen
zap_strlen:
-
- /*
- char const * str
- */
-
-#if defined(__amd64__)
-
# rax: Address of the current character.
# rdx: Current character.
@@ -42,5 +31,3 @@ zap_strlen:
subq %rdi,%rax
ret
-
-#endif
diff --git a/zap/src/mem/utf8dec.c b/zap/source/amd64/mem/utf8dec.c
index 62f3f61..62f3f61 100644
--- a/zap/src/mem/utf8dec.c
+++ b/zap/source/amd64/mem/utf8dec.c
diff --git a/zap/src/mem/utf8declen.c b/zap/source/amd64/mem/utf8declen.c
index 85062b9..85062b9 100644
--- a/zap/src/mem/utf8declen.c
+++ b/zap/source/amd64/mem/utf8declen.c
diff --git a/zap/src/mem/utf8enc.S b/zap/source/amd64/mem/utf8enc.S
index 24e09d8..357bdaa 100644
--- a/zap/src/mem/utf8enc.S
+++ b/zap/source/amd64/mem/utf8enc.S
@@ -1,22 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_utf8enc
zap_utf8enc:
-
- /*
- zap_chr20 const * in
- zap_chr8 * out
- */
-
-#if defined(__amd64__)
-
# rdi: Current input codepoint.
# rsi: Current output octet.
# rax: Current codepoint.
@@ -101,7 +89,7 @@ zap_utf8enc:
jmp .cnt
- # Four octets:/
+ # Four octets:
.oct4:
# Octet #0:
@@ -148,5 +136,4 @@ zap_utf8enc:
.done:
ret
-
-#endif
+ \ No newline at end of file
diff --git a/zap/src/mem/utf8enclen.S b/zap/source/amd64/mem/utf8enclen.S
index 1c80e6a..2e3b09f 100644
--- a/zap/src/mem/utf8enclen.S
+++ b/zap/source/amd64/mem/utf8enclen.S
@@ -1,21 +1,10 @@
-/*
- 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>
+# 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/.
.globl zap_utf8enclen
zap_utf8enclen:
-
- /*
- zap_chr20 const * utf20
- */
-
-#if defined(__amd64__)
-
# rdi: Address of the current character.
# rax: Length of the string.
# rsi: Current character.
@@ -76,5 +65,3 @@ zap_utf8enclen:
.done:
ret
-
-#endif
diff --git a/zap/src/mem/win1252dec.c b/zap/source/amd64/mem/win1252dec.c
index 2a5e897..2a5e897 100644
--- a/zap/src/mem/win1252dec.c
+++ b/zap/source/amd64/mem/win1252dec.c
diff --git a/zap/src/mem/win1252enc.c b/zap/source/amd64/mem/win1252enc.c
index cd313cd..cd313cd 100644
--- a/zap/src/mem/win1252enc.c
+++ b/zap/source/amd64/mem/win1252enc.c
diff --git a/zap/src/mem/memcmp.c b/zap/src/mem/memcmp.c
deleted file mode 100644
index 13fa269..0000000
--- a/zap/src/mem/memcmp.c
+++ /dev/null
@@ -1,21 +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>
-
-zap_cmp zap_memcmp(void const * const _lstr,zap_sz const _num,void const * const _rstr) {
- unsigned char const * lpos = _lstr;
- unsigned char const * rpos = _rstr;
- unsigned char const * const afterlbuf = lpos + _num;
- for (;lpos != afterlbuf;++lpos,++rpos) {
- unsigned char const lbyte = *lpos;
- unsigned char const rbyte = *rpos;
- if (lbyte != rbyte) {return lbyte < rbyte ? zap_lt : zap_gt;}
- }
- return zap_eq;
-}
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();
-}