summaryrefslogtreecommitdiff
path: root/zap
diff options
context:
space:
mode:
Diffstat (limited to 'zap')
-rw-r--r--zap/GNUmakefile2
-rw-r--r--zap/include/zap/bs.h2
-rw-r--r--zap/include/zap/mem.h6
-rw-r--r--zap/source/amd64/mem/memcat.c14
-rw-r--r--zap/source/amd64/mem/memfnd.S2
-rw-r--r--zap/source/amd64/mem/strcat.c19
-rw-r--r--zap/source/amd64/mem/strfnd.S2
7 files changed, 5 insertions, 42 deletions
diff --git a/zap/GNUmakefile b/zap/GNUmakefile
index 18f94eb..46ced95 100644
--- a/zap/GNUmakefile
+++ b/zap/GNUmakefile
@@ -35,7 +35,6 @@ CPPFLAGS := \
# ARTEFACTS
OBJS = \
- source/$(arch)/mem/memcat.o \
source/$(arch)/mem/memcnt.o \
source/$(arch)/mem/memcp.o \
source/$(arch)/mem/memeq.o \
@@ -43,7 +42,6 @@ OBJS = \
source/$(arch)/mem/memfnd.o \
source/$(arch)/mem/memfor.o \
source/$(arch)/mem/memgen.o \
- source/$(arch)/mem/strcat.o \
source/$(arch)/mem/streq.o \
source/$(arch)/mem/strfill.o \
source/$(arch)/mem/strfnd.o \
diff --git a/zap/include/zap/bs.h b/zap/include/zap/bs.h
index 7e14502..6c2815d 100644
--- a/zap/include/zap/bs.h
+++ b/zap/include/zap/bs.h
@@ -24,7 +24,7 @@ typedef signed char zap_cmp;
#define zap_gt ((zap_cmp)+0x7F)
#define zap_lt ((zap_cmp)-0x80)
-#define zap_nopos (~((zap_sz)+0u))
+#define zap_nopos ((zap_sz)+0xFFFFFFFFFFFFFFFFu)
#define zap_nullptr (0x0u)
diff --git a/zap/include/zap/mem.h b/zap/include/zap/mem.h
index 8bcaa0b..d32a910 100644
--- a/zap/include/zap/mem.h
+++ b/zap/include/zap/mem.h
@@ -13,15 +13,13 @@
extern "C" {
#endif
-__attribute__ ((hot,nothrow)) void zap_memcat( void const * lptr, zap_sz llen,void const * rptr, zap_sz rlen, void * buf);
__attribute__ ((hot,warn_unused_result)) zap_sz zap_memcnt( void const * ptr, zap_sz sz, zap_sz num, zap_bool (* fn)(void const *));
-__attribute__ ((hot,nothrow)) void zap_memcp( void const * in, zap_sz num, void * out);
+__attribute__ ((hot,nothrow)) zap_sz 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,nothrow)) zap_sz zap_memfill( void * ptr, zap_sz num, unsigned char val);
__attribute__ ((hot,nothrow,warn_unused_result)) zap_sz zap_memfnd( void const * ptr, zap_sz num, unsigned char byte);
__attribute__ ((hot)) void zap_memfor( void * ptr, zap_sz sz, zap_sz num, void (* fn)(void *));
__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)) 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/source/amd64/mem/memcat.c b/zap/source/amd64/mem/memcat.c
deleted file mode 100644
index 2b50ba7..0000000
--- a/zap/source/amd64/mem/memcat.c
+++ /dev/null
@@ -1,14 +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>
-
-void zap_memcat(void const * const _lptr,zap_sz const _llen,void const * const _rptr,zap_sz const _rlen,void * const _buf) {
- zap_memcp(_lptr,_llen,_buf);
- zap_memcp(_rptr,_rlen,(unsigned char *)_buf + _llen);
-}
diff --git a/zap/source/amd64/mem/memfnd.S b/zap/source/amd64/mem/memfnd.S
index 0b5a47e..e1f8c30 100644
--- a/zap/source/amd64/mem/memfnd.S
+++ b/zap/source/amd64/mem/memfnd.S
@@ -46,5 +46,5 @@ zap_memfnd:
# Not found:
.nfnd:
- movq $0xFFFFFFFFFFFFFFFF,addr # addr = FFFFFFFFFFFFFFFF
+ movq $0xFFFFFFFFFFFFFFFF,addr # addr = 0xFFFFFFFFFFFFFFFF
ret # return addr
diff --git a/zap/source/amd64/mem/strcat.c b/zap/source/amd64/mem/strcat.c
deleted file mode 100644
index f7f66c8..0000000
--- a/zap/source/amd64/mem/strcat.c
+++ /dev/null
@@ -1,19 +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 <stddef.h>
-
-void zap_strcat(char const * const _lstr,char const * const _rstr,char * const _buf) {
- zap_sz const llen = zap_strlen (_lstr);
- zap_sz const rlen = zap_strlen (_rstr);
- zap_memcp(_lstr,llen,_buf);
- zap_memcp(_rstr,rlen,_buf + llen);
- _buf[llen + rlen] = '\x0';
-}
diff --git a/zap/source/amd64/mem/strfnd.S b/zap/source/amd64/mem/strfnd.S
index d9c99f3..f2f94fa 100644
--- a/zap/source/amd64/mem/strfnd.S
+++ b/zap/source/amd64/mem/strfnd.S
@@ -44,5 +44,5 @@ zap_strfnd:
# Not found:
.nfnd:
- movq $0xFFFFFFFFFFFFFFFF,addr # addr = FFFFFFFFFFFFFFFF
+ movq $0xFFFFFFFFFFFFFFFF,addr # addr = 0xFFFFFFFFFFFFFFFF
ret # return addr