diff options
51 files changed, 670 insertions, 664 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 60e5b81..f8e501d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -139,6 +139,14 @@ * Update and fix standard-detection macros; * Update target detection in makefile; +* Update readme; +* Add isnan to C++; +* Rename nthrw to nthw; +* Add constant-evaluated mathematical functions; +* Rename dist to dst; +* Implement cpy, equ, fil, and srh in C++11; +* Use shared implementation files; + # 0.0.2 * Migrate to CMake; @@ -16,6 +16,12 @@ algorithms may still not be the most efficient. Read: "CHANGELOG.txt" +The changelog lists the contributors' changes +to the library in the different versions. Each +version is initiated by the version number +followed by the list of changes. Each commit +has its own changes seperated with a blank line. + # COMPILATION Provided are CMake lists files, which diff --git a/zp/GNUmakefile b/zp/GNUmakefile index b3ec799..25ed550 100644 --- a/zp/GNUmakefile +++ b/zp/GNUmakefile @@ -143,35 +143,26 @@ LIB := libzp.a endif HDRS := \ - include/zp/bas \ - include/zp/bas.h \ - include/zp/mem \ - include/zp/mem.h \ - include/zp/mth \ - include/zp/mth.h \ - include/zp/str \ - include/zp/str.h \ - include/zp/bas.d/iscstevl.ii \ - include/zp/mem.d/cpy.ii \ - include/zp/mem.d/equ.ii \ - include/zp/mem.d/fil.ii \ - include/zp/mem.d/memcpy.ii \ - include/zp/mem.d/srh.ii \ - include/zp/prv/arc.h \ - include/zp/prv/chr.h \ - include/zp/prv/flt.h \ - include/zp/prv/imp.h \ - include/zp/prv/int.h \ - include/zp/prv/std.h \ - include/zp/prv/sys.h \ - include/zp/str.d/fmt.ii \ - include/zp/str.d/fmtlen.ii \ - include/zp/str.d/numdig.ii \ - include-private/zp/prv.d/strcpy.ii \ - include-private/zp/prv.d/strequ.ii \ - include-private/zp/prv.d/strfil.ii \ - include-private/zp/prv.d/strlen.ii \ - include-private/zp/prv.d/strsrh.ii + include/zp/bas \ + include/zp/bas.h \ + include/zp/mem \ + include/zp/mem.h \ + include/zp/mth \ + include/zp/mth.h \ + include/zp/str \ + include/zp/str.h \ + include/zp/imp/bas.ii \ + include/zp/imp/mem.ii \ + include/zp/imp/mth.ii \ + include/zp/imp/str.ii \ + include/zp/prv/arc.h \ + include/zp/prv/chr.h \ + include/zp/prv/flt.h \ + include/zp/prv/imp.h \ + include/zp/prv/int.h \ + include/zp/prv/std.h \ + include/zp/prv/sys.h \ + include-private/zp/imp/prv.ii CFLAGS := \ -Iinclude \ @@ -237,14 +228,11 @@ endif $(OBJS): $(HDRS) install: $(LIB) + mkdir -pvm755 "$(HDRDIR)/zp/imp" mkdir -pvm755 "$(HDRDIR)/zp/prv" - mkdir -pvm755 "$(HDRDIR)/zp/"{"bas","mem","str"}".d" mkdir -pvm755 "$(LIBDIR)" install -vm644 "include/zp/"{"bas","mem","mth","str"}{"",".h"} "$(HDRDIR)/zp" - install -vm644 "include/zp/prv/"{"arc","chr","flt","imp","int","std","sys"}".h" "$(HDRDIR)/zp/prv" - install -vm644 "include/zp/bas.d/"iscstevl".ii" "$(HDRDIR)/zp/bas.d" - install -vm644 "include/zp/mem.d/"{"cpy","equ","fil","memcpy","srh"}".ii" "$(HDRDIR)/zp/mem.d" - install -vm644 "include/zp/str.d/numdig.ii" "$(HDRDIR)/zp/str.d" + install -vm644 "include/zp/"{"bas","mem","mth","str"}".ii" "$(HDRDIR)/zp/imp" install -vm755 "$(LIB)" "$(LIBDIR)" clean: diff --git a/zp/include-private/zp/imp/prv.ii b/zp/include-private/zp/imp/prv.ii new file mode 100644 index 0000000..e340c70 --- /dev/null +++ b/zp/include-private/zp/imp/prv.ii @@ -0,0 +1,59 @@ +/* + Copyright 2022-2023 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>. +*/ + +template<typename typ> zp_nthw ::zp::siz zp::det::strcpy(typ * dst,typ const * src) { + //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); + + typ * const dstsrt = dst; + + while (*src != typ (0x0)) {*dst++ = *src++;} + + return static_cast< ::zp::siz>(dst-dstsrt); /* Number of values copied. */ +} + +template<typename typ> zp_nthw bool zp::det::strequ(typ const * lstr,typ const * rstr) { + //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); + + for (;;++lstr,++rstr) { + zp_lik (*lstr != *rstr) {return false;} + zp_ulik (*lstr == typ (0x0)) {break;} + } + + return true; +} + +template<typename typ> zp_nthw ::zp::siz zp::det::strfil(typ * str,typ const chr) { + //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); /* If the string format uses multiple values per character, the number of these values is returned (use utfXdeclen if the number of characters is needed). */ + + typ * const srt = str; + + while (*str != typ (0x0)) {*str++ = chr;} + + return static_cast< ::zp::siz>(str-srt)-0x1u; +} + +template<typename typ> zp_nthw ::zp::siz zp::det::strlen(typ const * str) { + //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); /* If the string format uses multiple values per character, the number of these values is returned (use utfXdeclen if the number of characters is needed). */ + + typ const * const srt = str; + + while (*str++ != typ (0x0)) {} + + return static_cast< ::zp::siz>(str-srt)-0x1u; +} + +template<typename typ> zp_nthw typ * zp::det::strsrh(typ const * str,typ const chr) { + //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); + + for (;;++str) { + typ const curchr = *str; + + zp_ulik (curchr == chr) {return const_cast<typ *>(str);} + zp_ulik (curchr == typ (0x0)) {break;} + } + + return zp_nulptr; +} diff --git a/zp/include-private/zp/prv b/zp/include-private/zp/prv index 76c58ab..7317edc 100644 --- a/zp/include-private/zp/prv +++ b/zp/include-private/zp/prv @@ -12,18 +12,14 @@ namespace zp { namespace det { - template<typename typ> zp_nthrw ::zp::siz strcpy(typ * dst, typ const * src); - template<typename typ> zp_nthrw bool strequ(typ const * lstr,typ const * rsrc); - template<typename typ> zp_nthrw ::zp::siz strfil(typ * dst, typ chr); - template<typename typ> zp_nthrw ::zp::siz strlen(typ const * str); - template<typename typ> zp_nthrw typ * strsrh(typ const * str, typ chr); + template<typename typ> zp_nthw ::zp::siz strcpy(typ * dst, typ const * src); + template<typename typ> zp_nthw bool strequ(typ const * lstr,typ const * rsrc); + template<typename typ> zp_nthw ::zp::siz strfil(typ * dst, typ chr); + template<typename typ> zp_nthw ::zp::siz strlen(typ const * str); + template<typename typ> zp_nthw typ * strsrh(typ const * str, typ chr); } } -#include <zp/prv.d/strcpy.ii> -#include <zp/prv.d/strequ.ii> -#include <zp/prv.d/strfil.ii> -#include <zp/prv.d/strlen.ii> -#include <zp/prv.d/strsrh.ii> +#include <zp/imp/prv.ii> #endif diff --git a/zp/include-private/zp/prv.d/strcpy.ii b/zp/include-private/zp/prv.d/strcpy.ii deleted file mode 100644 index 1f5cf11..0000000 --- a/zp/include-private/zp/prv.d/strcpy.ii +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> zp_nthrw ::zp::siz zp::det::strcpy(typ * dst,typ const * src) { - //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); - - typ * const dstsrt = dst; - - while (*src != typ (0x0)) {*dst++ = *src++;} - - return static_cast< ::zp::siz>(dst-dstsrt); /* Number of values copied. */ -} diff --git a/zp/include-private/zp/prv.d/strequ.ii b/zp/include-private/zp/prv.d/strequ.ii deleted file mode 100644 index cad90a6..0000000 --- a/zp/include-private/zp/prv.d/strequ.ii +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> zp_nthrw bool zp::det::strequ(typ const * lstr,typ const * rstr) { - //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); - - for (;;++lstr,++rstr) { - zp_lik (*lstr != *rstr) {return false;} - zp_ulik (*lstr == typ (0x0)) {break;} - } - - return true; -} diff --git a/zp/include-private/zp/prv.d/strfil.ii b/zp/include-private/zp/prv.d/strfil.ii deleted file mode 100644 index 8211035..0000000 --- a/zp/include-private/zp/prv.d/strfil.ii +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> zp_nthrw ::zp::siz zp::det::strfil(typ * str,typ const chr) { - //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); /* If the string format uses multiple values per character, the number of these values is returned (use utfXdeclen if the number of characters is needed). */ - - typ * const srt = str; - - while (*str != typ (0x0)) {*str++ = chr;} - - return static_cast< ::zp::siz>(str-srt)-0x1u; -} diff --git a/zp/include-private/zp/prv.d/strlen.ii b/zp/include-private/zp/prv.d/strlen.ii deleted file mode 100644 index 2c32ef2..0000000 --- a/zp/include-private/zp/prv.d/strlen.ii +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> zp_nthrw ::zp::siz zp::det::strlen(typ const * str) { - //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); /* If the string format uses multiple values per character, the number of these values is returned (use utfXdeclen if the number of characters is needed). */ - - typ const * const srt = str; - - while (*str++ != typ (0x0)) {} - - return static_cast< ::zp::siz>(str-srt)-0x1u; -} diff --git a/zp/include-private/zp/prv.d/strsrh.ii b/zp/include-private/zp/prv.d/strsrh.ii deleted file mode 100644 index 7a66e8e..0000000 --- a/zp/include-private/zp/prv.d/strsrh.ii +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> zp_nthrw typ * zp::det::strsrh(typ const * str,typ const chr) { - //static_assert(::zp::ischrtyp<typ>::val,"type must be a character type"); - - for (;;++str) { - typ const curchr = *str; - - zp_ulik (curchr == chr) {return const_cast<typ *>(str);} - zp_ulik (curchr == typ (0x0)) {break;} - } - - return zp_nulptr; -} diff --git a/zp/include/zp/bas b/zp/include/zp/bas index bf0ca33..33c9716 100644 --- a/zp/include/zp/bas +++ b/zp/include/zp/bas @@ -202,7 +202,7 @@ namespace zp { template<typename typ> struct isptr<typ * volatile> {constexpr static bool val = true;}; template<typename typ> struct isptr<typ * const volatile> {constexpr static bool val = true;}; - template<typename typ> struct issgn {constexpr static bool val = false;}; + template<typename typ> struct issgn {constexpr static bool val = false;}; template<> struct issgn<char signed> {constexpr static bool val = true;}; template<> struct issgn<double> {constexpr static bool val = true;}; @@ -328,16 +328,6 @@ namespace zp { template<typename typ> concept chrtyp = ::zp::ischrtyp<typ>::val; template<typename typ> concept flttyp = ::zp::isflttyp<typ>::val; template<typename typ> concept inttyp = ::zp::isinttyp<typ>::val; - -#define zp_prv_arityp ::zp::arityp -#define zp_prv_chrtyp ::zp::chrtyp -#define zp_prv_flttyp ::zp::flttyp -#define zp_prv_inttyp ::zp::inttyp -#else -#define zp_prv_arityp typename -#define zp_prv_chrtyp typename -#define zp_prv_flttyp typename -#define zp_prv_inttyp typename #endif zp_prv_ttval(::zp::i04m) ver = zp_ver; @@ -353,16 +343,14 @@ namespace zp { zp_iln constexpr auto iscstevl() noexcept -> bool; // is constant-evaluated #endif - zp_iln zp_nret zp_nthrw inline void trp() {::zp_trp();} - zp_iln zp_nret zp_nthrw inline void urch() {zp_urch();} + zp_iln zp_nret zp_nthw inline void trp() {::zp_trp();} + zp_iln zp_nret zp_nthw inline void urch() {zp_urch();} #if zp_std_cxx11 // We cannot use template parameter packs before C++11, so this function becomes quite non-trivial to implement. template<typename... typs> zp_iln inline auto syscal(::zp::syscalidt idt,typs const &... args) -> ::zp::syscalres {return ::zp_syscal(idt,args...);} #endif } -#if zp_std_cxx11 -#include <zp/bas.d/iscstevl.ii> -#endif +#include <zp/imp/bas.ii> #endif diff --git a/zp/include/zp/bas.h b/zp/include/zp/bas.h index 7c852bf..890c527 100644 --- a/zp/include/zp/bas.h +++ b/zp/include/zp/bas.h @@ -193,11 +193,11 @@ typedef char unsigned zp_prv_bool; #endif #if zp_prv_hasatr(__nothrow__) -#define zp_nthrw __attribute__ ((__nothrow__)) +#define zp_nthw __attribute__ ((__nothrow__)) #elif zp_imp_msvc -#define zp_nthrw __declspec (nothrow) +#define zp_nthw __declspec (nothrow) #else -#define zp_nthrw +#define zp_nthw #endif #if zp_prv_hasatr(__const__) diff --git a/zp/include/zp/bas.d/iscstevl.ii b/zp/include/zp/imp/bas.ii index 333a9a7..ad7c1b6 100644 --- a/zp/include/zp/bas.d/iscstevl.ii +++ b/zp/include/zp/imp/bas.ii @@ -4,6 +4,7 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ +#if zp_std_cxx11 constexpr auto zp::iscstevl() noexcept -> bool { #if zp_prv_hasbltin(__builtin_is_constant_evaluated) return __builtin_is_constant_evaluated(); @@ -14,3 +15,4 @@ constexpr auto zp::iscstevl() noexcept -> bool { return true; // ¯\_(ツ)_/¯ #endif } +#endif diff --git a/zp/include/zp/imp/mem.ii b/zp/include/zp/imp/mem.ii new file mode 100644 index 0000000..2d5c329 --- /dev/null +++ b/zp/include/zp/imp/mem.ii @@ -0,0 +1,59 @@ +/* + Copyright 2022-2023 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>. +*/ + +#if zp_std_cxx11 +template<typename ltyp,typename rtyp> constexpr auto zp::cpy(ltyp * dst,rtyp * src,::zp::siz const num) noexcept -> ::zp::cpyres<ltyp,rtyp> { + ltyp * const stp = dst+num; + while (dst != stp) {*dst++ = *src++;} + + return ::zp::cpyres<ltyp,rtyp> {dst,src,}; +} +#endif + +#if zp_std_cxx11 +template<typename ltyp,typename rtyp> constexpr auto zp::equ(ltyp * lbuf,rtyp * rbuf,::zp::siz const num) noexcept -> bool { + ltyp const * const stp = lbuf+num; + + while (lbuf != stp) { + zp_lik (*lbuf++ != *rbuf++) {return false;} + } + + return true; +} +#endif + +#if zp_std_cxx11 +template<typename buftyp,typename valtyp> constexpr auto zp::fil(buftyp * buf,valtyp & val,::zp::siz const num) noexcept -> buftyp * { + buftyp * const stp = buf+num; + while (buf != stp) {*buf++ = val;} + + return stp; +} +#endif + +template<typename dsttyp,typename srctyp> zp_nthw inline ::zp::cpyres<dsttyp,srctyp> zp::memcpy(dsttyp * dst,srctyp const * src,::zp::siz const num) { + ::zp_cpyres const cpyres = ::zp_memcpy(dst,src,num); + + ::zp::cpyres<dsttyp,srctyp> res = { + static_cast<dsttyp *>(cpyres.dst), + static_cast<srctyp *>(cpyres.src), + }; + + return res; +} + +#if zp_std_cxx11 +template<typename buftyp,typename valtyp> constexpr auto zp::srh(buftyp * buf,valtyp & val,::zp::siz const num) noexcept -> buftyp * { + buftyp * const stp = buf+num; + + while (buf != stp) { + buftyp * const addr = buf++; + zp_ulik (*addr == val) {return addr;} + } + + return nullptr; +} +#endif diff --git a/zp/include/zp/mem.d/fil.ii b/zp/include/zp/imp/mth.ii index 36ae1a0..255c285 100644 --- a/zp/include/zp/mem.d/fil.ii +++ b/zp/include/zp/imp/mth.ii @@ -3,10 +3,3 @@ 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>. */ - -template<typename buftyp,typename valtyp> constexpr auto zp::fil(buftyp * buf,valtyp & val,::zp::siz const num) noexcept -> buftyp * { - buftyp * const stp = buf+num; - while (buf != stp) {*buf++ = val;} - - return stp; -} diff --git a/zp/include/zp/str.d/fmt.ii b/zp/include/zp/imp/str.ii index 59d6191..3822c7d 100644 --- a/zp/include/zp/str.d/fmt.ii +++ b/zp/include/zp/imp/str.ii @@ -4,6 +4,7 @@ If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>. */ +#if false template<typename sgntyp> constexpr auto zp::fmt(::zp::c02 * buf,sgntyp sgnval,::zp::i8m const bs,bool const rtl) noexcept -> void { using typ = typename ::zp::usgn<sgntyp>::typ; @@ -27,3 +28,33 @@ template<typename sgntyp> constexpr auto zp::fmt(::zp::c02 * buf,sgntyp sgnval,: for (;val > 0x0u;val /= bs) *buf++ = digs[static_cast< ::zp::siz>(val % static_cast<typ>(bs))]; } +#endif + +#if false +template<typename typ> constexpr auto zp::fmtlen(typ val,::zp::i8m const bs) noexcept -> ::zp::siz { + static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); + + ::zp::siz len = 0x0u; + + if (val < typ {0x0}) { + val = typ {0x0}-val; + len = 0x1u; + } + + len += ::zp::prv::numdig(val,bs); + + return len; +} +#endif + +template<typename typ> zp_nthw ::zp::siz zp::prv::numdig(typ fmtval,::zp::i8m const bs) { + //static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); + + if (fmtval == typ (0x0)) return 0x1u; + + ::zp::siz len = 0x0u; + + for (typ val = fmtval;val > typ (0x0);val /= static_cast<typ>(bs)) {++len;} + + return len; +} diff --git a/zp/include/zp/mem b/zp/include/zp/mem index c6b400a..0b5427b 100644 --- a/zp/include/zp/mem +++ b/zp/include/zp/mem @@ -16,13 +16,13 @@ namespace zp { srctyp * src; }; - template<typename dsttyp,typename srctyp> zp_iln zp_nthrw inline ::zp::cpyres<dsttyp,srctyp> memcpy(dsttyp * dst, srctyp const * src, ::zp::siz const num); - template<typename ltyp, typename rtyp> zp_useres zp_iln zp_nthrw inline bool memequ(ltyp const * lbuf,rtyp const * rbuf,::zp::siz const num) {return ::zp_memequ(lbuf,rbuf,num);} - template<typename typ> zp_iln zp_nthrw inline typ * memfil(typ * dst, char unsigned val, ::zp::siz const num) {return static_cast<typ *>(::zp_memfil(dst,val,num));} - template<typename typ> zp_useres zp_nthrw zp_iln inline typ * memsrh(typ * buf, char unsigned val, ::zp::siz const num) {return static_cast<typ *>(::zp_memsrh(buf,val,num));} - template<typename typ> zp_useres zp_nthrw zp_iln inline typ const * memsrh(typ const * buf, char unsigned val, ::zp::siz const num) {return const_cast<typ const *>(static_cast<typ *>(::zp_memsrh(buf,val,num)));} + template<typename dsttyp,typename srctyp> zp_iln zp_nthw inline ::zp::cpyres<dsttyp,srctyp> memcpy(dsttyp * dst, srctyp const * src, ::zp::siz const num); + template<typename ltyp, typename rtyp> zp_useres zp_iln zp_nthw inline bool memequ(ltyp const * lbuf,rtyp const * rbuf,::zp::siz const num) {return ::zp_memequ(lbuf,rbuf,num);} + template<typename typ> zp_iln zp_nthw inline typ * memfil(typ * dst, char unsigned val, ::zp::siz const num) {return static_cast<typ *>(::zp_memfil(dst,val,num));} + template<typename typ> zp_useres zp_nthw zp_iln inline typ * memsrh(typ * buf, char unsigned val, ::zp::siz const num) {return static_cast<typ *>(::zp_memsrh(buf,val,num));} + template<typename typ> zp_useres zp_nthw zp_iln inline typ const * memsrh(typ const * buf, char unsigned val, ::zp::siz const num) {return const_cast<typ const *>(static_cast<typ *>(::zp_memsrh(buf,val,num)));} -#if zp_std_cxx14 +#if zp_std_cxx11 template<typename ltyp, typename rtyp> constexpr auto cpy(ltyp * dst, rtyp * src, ::zp::siz num) noexcept -> ::zp::cpyres<ltyp,rtyp>; template<typename ltyp, typename rtyp> constexpr auto equ(ltyp * lbuf,rtyp * rbuf,::zp::siz num) noexcept -> bool; template<typename buftyp,typename valtyp> constexpr auto fil(buftyp * buf, valtyp & val, ::zp::siz num) noexcept -> buftyp *; @@ -30,12 +30,6 @@ namespace zp { #endif } -#include <zp/mem.d/memcpy.ii> -#if zp_std_cxx14 -#include <zp/mem.d/cpy.ii> -#include <zp/mem.d/equ.ii> -#include <zp/mem.d/fil.ii> -#include <zp/mem.d/srh.ii> -#endif +#include <zp/imp/mem.ii> #endif diff --git a/zp/include/zp/mem.d/cpy.ii b/zp/include/zp/mem.d/cpy.ii deleted file mode 100644 index 3e96910..0000000 --- a/zp/include/zp/mem.d/cpy.ii +++ /dev/null @@ -1,12 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename ltyp,typename rtyp> constexpr auto zp::cpy(ltyp * dst,rtyp * src,::zp::siz const num) noexcept -> ::zp::cpyres<ltyp,rtyp> { - ltyp * const stp = dst+num; - while (dst != stp) {*dst++ = *src++;} - - return ::zp::cpyres<ltyp,rtyp> {dst,src,}; -} diff --git a/zp/include/zp/mem.d/equ.ii b/zp/include/zp/mem.d/equ.ii deleted file mode 100644 index 1bc0fbd..0000000 --- a/zp/include/zp/mem.d/equ.ii +++ /dev/null @@ -1,15 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename ltyp,typename rtyp> constexpr auto zp::equ(ltyp * lbuf,rtyp * rbuf,::zp::siz const num) noexcept -> bool { - ltyp const * const stp = lbuf+num; - - while (lbuf != stp) { - zp_lik (*lbuf++ != *rbuf++) {return false;} - } - - return true; -} diff --git a/zp/include/zp/mem.d/memcpy.ii b/zp/include/zp/mem.d/memcpy.ii deleted file mode 100644 index 6e1f6cb..0000000 --- a/zp/include/zp/mem.d/memcpy.ii +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename dsttyp,typename srctyp> zp_nthrw inline ::zp::cpyres<dsttyp,srctyp> zp::memcpy(dsttyp * dst,srctyp const * src,::zp::siz const num) { - ::zp_cpyres const cpyres = ::zp_memcpy(dst,src,num); - - ::zp::cpyres<dsttyp,srctyp> res = { - static_cast<dsttyp *>(cpyres.dst), - static_cast<srctyp *>(cpyres.src), - }; - - return res; -} diff --git a/zp/include/zp/mem.d/srh.ii b/zp/include/zp/mem.d/srh.ii deleted file mode 100644 index 8582dd7..0000000 --- a/zp/include/zp/mem.d/srh.ii +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename buftyp,typename valtyp> constexpr auto zp::srh(buftyp * buf,valtyp & val,::zp::siz const num) noexcept -> buftyp * { - buftyp * const stp = buf+num; - - while (buf != stp) { - buftyp * const addr = buf++; - zp_ulik (*addr == val) {return addr;} - } - - return nullptr; -} diff --git a/zp/include/zp/mem.h b/zp/include/zp/mem.h index b8fe85a..024a062 100644 --- a/zp/include/zp/mem.h +++ b/zp/include/zp/mem.h @@ -16,10 +16,10 @@ struct zp_cpyres { void * src; }; -zp_nthrw struct zp_cpyres zp_memcpy(void * dst, void const * src, zp_siz num); -zp_nthrw zp_useres bool zp_memequ(void const * lbuf,void const * rbuf,zp_siz num); -zp_nthrw void * zp_memfil(void * dst, char unsigned val, zp_siz num); -zp_nthrw zp_useres void * zp_memsrh(void const * buf, char unsigned val, zp_siz num); +zp_nthw struct zp_cpyres zp_memcpy(void * dst, void const * src, zp_siz num); +zp_nthw zp_useres bool zp_memequ(void const * lbuf,void const * rbuf,zp_siz num); +zp_nthw void * zp_memfil(void * dst, char unsigned val, zp_siz num); +zp_nthw zp_useres void * zp_memsrh(void const * buf, char unsigned val, zp_siz num); zp_prv_cdeclend diff --git a/zp/include/zp/mth b/zp/include/zp/mth index 528e46b..47959a3 100644 --- a/zp/include/zp/mth +++ b/zp/include/zp/mth @@ -12,17 +12,17 @@ namespace zp { #if zp_std_cxx11 - template<typename typ> struct inf {constexpr static auto val = ::zp::maxval<typ>::val;}; + template<typename typ> struct inf {constexpr static typ val = ::zp::maxval<typ>::val;}; - template<> struct inf<double> {constexpr static auto val = zp_inff;}; - template<> struct inf<float> {constexpr static auto val = zp_infd;}; - template<> struct inf<double long> {constexpr static auto val = zp_infld;}; + template<> struct inf<double> {constexpr static double const val = zp_inff;}; + template<> struct inf<double long> {constexpr static double long const val = zp_infld;}; + template<> struct inf<float> {constexpr static float const val = zp_infd;}; - template<typename typ> struct nan {constexpr static auto val = typ {0x0};}; + template<typename typ> struct nan {constexpr static typ val = typ {0x0};}; - template<> struct nan<double> {constexpr static auto val = zp_nanf;}; - template<> struct nan<float> {constexpr static auto val = zp_nand;}; - template<> struct nan<double long> {constexpr static auto val = zp_nanld;}; + template<> struct nan<double> {constexpr static double const val = zp_nanf;}; + template<> struct nan<double long> {constexpr static double long const val = zp_nanld;}; + template<> struct nan<float> {constexpr static float const val = zp_nand;}; #endif template<typename typ> struct divmodres { @@ -46,156 +46,215 @@ namespace zp { typ w; }; - zp_iln zp_nthrw zp_useq zp_useres inline float abs(float val) {return ::zp_absf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double abs(double val) {return ::zp_absd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long abs(double long val) {return ::zp_absdl(val);} - - zp_iln zp_nthrw zp_useq zp_useres inline float acos(float val) {return ::zp_acosf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double acos(double val) {return ::zp_acosd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long acos(double long val) {return ::zp_acosdl(val);} - - /* arccotangent */ - zp_iln zp_nthrw zp_useq zp_useres inline float zp_acot(float val) {return ::zp_acotf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double zp_acot(double val) {return ::zp_acotd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long zp_acot(double long val) {return ::zp_acotdl(val);} - - /* arccosecant */ - zp_iln zp_nthrw zp_useq zp_useres inline float zp_acsc(float val) {return ::zp_acscf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double zp_acsc(double val) {return ::zp_acscd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long zp_acsc(double long val) {return ::zp_acscdl(val);} - - /* arcsecant */ - zp_iln zp_nthrw zp_useq zp_useres inline float asec(float val) {return ::zp_asecf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double asec(double val) {return ::zp_asecd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long asec(double long val) {return ::zp_asecdl(val);} - - zp_iln zp_nthrw zp_useq zp_useres inline float asin(float val) {return ::zp_asinf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double asin(double val) {return ::zp_asind( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long asin(double long val) {return ::zp_asindl(val);} - - zp_iln zp_nthrw zp_useq zp_useres inline float atan(float val) {return ::zp_atanf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double atan(double val) {return ::zp_atand( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long atan(double long val) {return ::zp_atandl(val);} - - zp_iln zp_nthrw zp_useq zp_useres inline float atan2(float y,float x) {return ::zp_atan2f( y,x);} - zp_iln zp_nthrw zp_useq zp_useres inline double atan2(double y,double x) {return ::zp_atan2d( y,x);} - zp_iln zp_nthrw zp_useq zp_useres inline double long atan2(double long y,double long x) {return ::zp_atan2dl(y,x);} - - zp_iln zp_nthrw zp_useq zp_useres inline float cbrt(float val) {return ::zp_cbrtf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double cbrt(double val) {return ::zp_cbrtd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long cbrt(double long val) {return ::zp_cbrtdl(val);} - - zp_iln zp_nthrw zp_useq zp_useres inline float cos(float ang) {return ::zp_cosf( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double cos(double ang) {return ::zp_cosd( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double long cos(double long ang) {return ::zp_cosdl(ang);} - - zp_iln zp_nthrw zp_useq zp_useres inline float cot(float ang) {return ::zp_cotf( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double cot(double ang) {return ::zp_cotd( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double long cot(double long ang) {return ::zp_cotdl(ang);} - - zp_iln zp_nthrw zp_useq zp_useres inline float csc(float ang) {return ::zp_cscf( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double csc(double ang) {return ::zp_cscd( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double long csc(double long ang) {return ::zp_cscdl(ang);} - - zp_iln zp_nthrw zp_useq zp_useres inline float dist2(float x,float y) {return ::zp_dist2f( x,y);} - zp_iln zp_nthrw zp_useq zp_useres inline double dist2(double x,double y) {return ::zp_dist2d( x,y);} - zp_iln zp_nthrw zp_useq zp_useres inline double long dist2(double long x,double long y) {return ::zp_dist2dl(x,y);} - - zp_iln zp_nthrw zp_useq zp_useres inline float dist3(float x,float y,float z) {return ::zp_dist3f( x,y,z);} - zp_iln zp_nthrw zp_useq zp_useres inline double dist3(double x,double y,double z) {return ::zp_dist3d( x,y,z);} - zp_iln zp_nthrw zp_useq zp_useres inline double long dist3(double long x,double long y,double long z) {return ::zp_dist3dl(x,y,z);} - - zp_iln zp_nthrw zp_useq zp_useres inline float dist4(float x,float y,float z,float w) {return ::zp_dist4f( x,y,z,w);} - zp_iln zp_nthrw zp_useq zp_useres inline double dist4(double x,double y,double z,double w) {return ::zp_dist4d( x,y,z,w);} - zp_iln zp_nthrw zp_useq zp_useres inline double long dist4(double long x,double long y,double long z,double long w) {return ::zp_dist4dl(x,y,z,w);} - - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::divmodres<char signed> divmod(char signed num,char signed den); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::divmodres<short> divmod(short num,short den); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::divmodres<int> divmod(int num,int den); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::divmodres<long> divmod(long num,long den); +#if zp_std_cxx14 + namespace cst { + template<typename typ> zp_useres constexpr auto isnan(typ const val) noexcept -> bool { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + if (::zp::isinttyp<typ>::val) {return false;} + + return val != val; + } + + template<typename typ> zp_useres constexpr auto abs(typ const val) noexcept -> typename ::zp::usgn<typ>::typ { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + if (::zp::isusgn<typ>::val) {return val;} + + using newtyp = typename ::zp::usgn<typ>::typ; // The type is unchanged if it was a floating-point type. + + return newtyp {0x0}-static_cast<newtyp>(val); + } + + template<typename typ> zp_useres constexpr auto dot2(::zp::vec2<typ> const lvec,::zp::vec2<typ> const rvec) noexcept -> typ { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + return lvec.x*rvec.x+lvec.y*rvec.y; + } + + template<typename typ> zp_useres constexpr auto dot3(::zp::vec3<typ> const lvec,::zp::vec3<typ> const rvec) noexcept -> typ { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + return lvec.x*rvec.x+lvec.y*rvec.y+lvec.z*rvec.z; + } + + template<typename typ> zp_useres constexpr auto dot4(::zp::vec4<typ> const lvec,::zp::vec4<typ> const rvec) noexcept -> typ { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + return lvec.x*rvec.x+lvec.y*rvec.y+lvec.z*rvec.z+lvec.w*rvec.w; + } + + template<typename typ> zp_useres constexpr auto vadd2(::zp::vec2<typ> const lvec,::zp::vec2<typ> const rvec) noexcept -> ::zp::vec2<typ> { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + return ::zp::vec2<typ> {lvec.x+rvec.x,lvec.y+rvec.y}; + } + + template<typename typ> zp_useres constexpr auto vadd3(::zp::vec3<typ> const lvec,::zp::vec3<typ> const rvec) noexcept -> ::zp::vec3<typ> { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + return ::zp::vec3<typ> {lvec.x+rvec.x,lvec.y+rvec.y,lvec.z+rvec.z}; + } + + template<typename typ> zp_useres constexpr auto vadd4(::zp::vec4<typ> const lvec,::zp::vec4<typ> const rvec) noexcept -> ::zp::vec4<typ> { + static_assert(::zp::isarityp<typ>::val,"type must be an arithmetic type"); + + return ::zp::vec4<typ> {lvec.x+rvec.x,lvec.y+rvec.y,lvec.z+rvec.z,lvec.w+rvec.w}; + } + } +#endif + + zp_iln zp_nthw zp_useq zp_useres inline double isnan(double const val) {return zp_isnand( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long isnan(double long const val) {return zp_isnandl(val);} + zp_iln zp_nthw zp_useq zp_useres inline float isnan(float const val) {return zp_isnanf( val);} + + zp_iln zp_nthw zp_useq zp_useres inline float abs(float const val) {return ::zp_absf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double abs(double const val) {return ::zp_absd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long abs(double long const val) {return ::zp_absdl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float acos(float const val) {return ::zp_acosf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double acos(double const val) {return ::zp_acosd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long acos(double long const val) {return ::zp_acosdl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float zp_acot(float const val) {return ::zp_acotf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double zp_acot(double const val) {return ::zp_acotd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long zp_acot(double long const val) {return ::zp_acotdl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float zp_acsc(float const val) {return ::zp_acscf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double zp_acsc(double const val) {return ::zp_acscd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long zp_acsc(double long const val) {return ::zp_acscdl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float asec(float const val) {return ::zp_asecf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double asec(double const val) {return ::zp_asecd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long asec(double long const val) {return ::zp_asecdl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float asin(float const val) {return ::zp_asinf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double asin(double const val) {return ::zp_asind( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long asin(double long const val) {return ::zp_asindl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float atan(float const val) {return ::zp_atanf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double atan(double const val) {return ::zp_atand( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long atan(double long const val) {return ::zp_atandl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float atan2(float const y,float const x) {return ::zp_atan2f( y,x);} + zp_iln zp_nthw zp_useq zp_useres inline double atan2(double const y,double const x) {return ::zp_atan2d( y,x);} + zp_iln zp_nthw zp_useq zp_useres inline double long atan2(double long const y,double long const x) {return ::zp_atan2dl(y,x);} + + zp_iln zp_nthw zp_useq zp_useres inline float cbrt(float const val) {return ::zp_cbrtf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double cbrt(double const val) {return ::zp_cbrtd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long cbrt(double long const val) {return ::zp_cbrtdl(val);} + + zp_iln zp_nthw zp_useq zp_useres inline float cos(float const ang) {return ::zp_cosf( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double cos(double const ang) {return ::zp_cosd( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double long cos(double long const ang) {return ::zp_cosdl(ang);} + + zp_iln zp_nthw zp_useq zp_useres inline float cot(float const ang) {return ::zp_cotf( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double cot(double const ang) {return ::zp_cotd( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double long cot(double long const ang) {return ::zp_cotdl(ang);} + + zp_iln zp_nthw zp_useq zp_useres inline float csc(float const ang) {return ::zp_cscf( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double csc(double const ang) {return ::zp_cscd( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double long csc(double long const ang) {return ::zp_cscdl(ang);} + + zp_iln zp_nthw zp_useq zp_useres inline float dist2(float const x,float const y) {return ::zp_dst2f( x,y);} + zp_iln zp_nthw zp_useq zp_useres inline double dist2(double const x,double const y) {return ::zp_dst2d( x,y);} + zp_iln zp_nthw zp_useq zp_useres inline double long dist2(double long const x,double long const y) {return ::zp_dst2dl(x,y);} + + zp_iln zp_nthw zp_useq zp_useres inline float dist3(float const x,float const y,float const z) {return ::zp_dst3f( x,y,z);} + zp_iln zp_nthw zp_useq zp_useres inline double dist3(double const x,double const y,double const z) {return ::zp_dst3d( x,y,z);} + zp_iln zp_nthw zp_useq zp_useres inline double long dist3(double long const x,double long const y,double long const z) {return ::zp_dst3dl(x,y,z);} + + zp_iln zp_nthw zp_useq zp_useres inline float dist4(float const x,float const y,float const z,float w) {return ::zp_dst4f( x,y,z,w);} + zp_iln zp_nthw zp_useq zp_useres inline double dist4(double const x,double const y,double const z,double w) {return ::zp_dst4d( x,y,z,w);} + zp_iln zp_nthw zp_useq zp_useres inline double long dist4(double long const x,double long const y,double long const z,double long w) {return ::zp_dst4dl(x,y,z,w);} + + zp_iln zp_nthw zp_useq zp_useres inline ::zp::divmodres<char signed> divmod(char signed const num,char signed den); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::divmodres<short> divmod(short const num,short den); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::divmodres<int> divmod(int const num,int den); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::divmodres<long> divmod(long const num,long den); #if zp_std_c99 || zp_std_cxx11 - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::divmodres<long long> divmodl(long long num,long long den); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::divmodres<long long> divmodl(long long const num,long long den); #endif - zp_iln zp_nthrw zp_useq zp_useres inline float dot2(::zp::vec2<float> lvec,::zp::vec2<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline double dot2(::zp::vec2<double> lvec,::zp::vec2<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline double long dot2(::zp::vec2<double long> lvec,::zp::vec2<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline float dot2(::zp::vec2<float> const lvec,::zp::vec2<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline double dot2(::zp::vec2<double> const lvec,::zp::vec2<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline double long dot2(::zp::vec2<double long> const lvec,::zp::vec2<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline float dot3(::zp::vec3<float> lvec,::zp::vec3<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline double dot3(::zp::vec3<double> lvec,::zp::vec3<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline double long dot3(::zp::vec3<double long> lvec,::zp::vec3<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline float dot3(::zp::vec3<float> const lvec,::zp::vec3<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline double dot3(::zp::vec3<double> const lvec,::zp::vec3<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline double long dot3(::zp::vec3<double long> const lvec,::zp::vec3<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline float dot4(::zp::vec4<float> lvec,::zp::vec4<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline double dot4(::zp::vec4<double> lvec,::zp::vec4<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline double long dot4(::zp::vec4<double long> lvec,::zp::vec4<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline float dot4(::zp::vec4<float> const lvec,::zp::vec4<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline double dot4(::zp::vec4<double> const lvec,::zp::vec4<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline double long dot4(::zp::vec4<double long> const lvec,::zp::vec4<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline float exp(float val,float n) {return ::zp_expf( val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline double exp(double val,double n) {return ::zp_expd( val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline double long exp(double long val,double long n) {return ::zp_expdl(val,n);} + zp_iln zp_nthw zp_useq zp_useres inline float exp(float const val,float n) {return ::zp_expf( val,n);} + zp_iln zp_nthw zp_useq zp_useres inline double exp(double const val,double n) {return ::zp_expd( val,n);} + zp_iln zp_nthw zp_useq zp_useres inline double long exp(double long const val,double long n) {return ::zp_expdl(val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline float lb(float val) {return ::zp_lbf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double lb(double val) {return ::zp_lbd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long lb(double long val) {return ::zp_lbdl(val);} + zp_iln zp_nthw zp_useq zp_useres inline float lb(float const val) {return ::zp_lbf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double lb(double const val) {return ::zp_lbd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long lb(double long const val) {return ::zp_lbdl(val);} - zp_iln zp_nthrw zp_useq zp_useres inline float lg(float val) {return ::zp_lgf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double lg(double val) {return ::zp_lgd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long lg(double long val) {return ::zp_lgdl(val);} + zp_iln zp_nthw zp_useq zp_useres inline float lg(float const val) {return ::zp_lgf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double lg(double const val) {return ::zp_lgd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long lg(double long const val) {return ::zp_lgdl(val);} - zp_iln zp_nthrw zp_useq zp_useres inline float ln(float val) {return ::zp_lnf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double ln(double val) {return ::zp_lnd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long ln(double long val) {return ::zp_lndl(val);} + zp_iln zp_nthw zp_useq zp_useres inline float ln(float const val) {return ::zp_lnf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double ln(double const val) {return ::zp_lnd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long ln(double long const val) {return ::zp_lndl(val);} - zp_iln zp_nthrw zp_useq zp_useres inline float log(float val,float n) {return ::zp_logf( val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline double log(double val,double n) {return ::zp_logd( val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline double long log(double long val,double long n) {return ::zp_logdl(val,n);} + zp_iln zp_nthw zp_useq zp_useres inline float log(float const val,float n) {return ::zp_logf( val,n);} + zp_iln zp_nthw zp_useq zp_useres inline double log(double const val,double n) {return ::zp_logd( val,n);} + zp_iln zp_nthw zp_useq zp_useres inline double long log(double long const val,double long n) {return ::zp_logdl(val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline float nrt(float val,float n) {return ::zp_nrtf( val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline double nrt(double val,double n) {return ::zp_nrtd( val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline double long nrt(double long val,double long n) {return ::zp_nrtdl(val,n);} + zp_iln zp_nthw zp_useq zp_useres inline float nrt(float const val,float n) {return ::zp_nrtf( val,n);} + zp_iln zp_nthw zp_useq zp_useres inline double nrt(double const val,double n) {return ::zp_nrtd( val,n);} + zp_iln zp_nthw zp_useq zp_useres inline double long nrt(double long const val,double long n) {return ::zp_nrtdl(val,n);} - zp_iln zp_nthrw zp_useq zp_useres inline float sec(float ang) {return ::zp_secf( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double sec(double ang) {return ::zp_secd( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double long sec(double long ang) {return ::zp_secdl(ang);} + zp_iln zp_nthw zp_useq zp_useres inline float sec(float const ang) {return ::zp_secf( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double sec(double const ang) {return ::zp_secd( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double long sec(double long const ang) {return ::zp_secdl(ang);} - zp_iln zp_nthrw zp_useq zp_useres inline float sin(float ang) {return ::zp_sinf( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double sin(double ang) {return ::zp_sind( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double long sin(double long ang) {return ::zp_sindl(ang);} + zp_iln zp_nthw zp_useq zp_useres inline float sin(float const ang) {return ::zp_sinf( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double sin(double const ang) {return ::zp_sind( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double long sin(double long const ang) {return ::zp_sindl(ang);} - zp_iln zp_nthrw zp_useq zp_useres inline float sqrt(float val) {return ::zp_sqrtf( val);;} - zp_iln zp_nthrw zp_useq zp_useres inline double sqrt(double val) {return ::zp_sqrtd( val);;} - zp_iln zp_nthrw zp_useq zp_useres inline double long sqrt(double long val) {return ::zp_sqrtdl(val);;} + zp_iln zp_nthw zp_useq zp_useres inline float sqrt(float const val) {return ::zp_sqrtf( val);;} + zp_iln zp_nthw zp_useq zp_useres inline double sqrt(double const val) {return ::zp_sqrtd( val);;} + zp_iln zp_nthw zp_useq zp_useres inline double long sqrt(double long const val) {return ::zp_sqrtdl(val);;} - zp_iln zp_nthrw zp_useq zp_useres inline float tan(float ang) {return ::zp_tanf( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double tan(double ang) {return ::zp_tand( ang);} - zp_iln zp_nthrw zp_useq zp_useres inline double long tan(double long ang) {return ::zp_tandl(ang);} + zp_iln zp_nthw zp_useq zp_useres inline float tan(float const ang) {return ::zp_tanf( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double tan(double const ang) {return ::zp_tand( ang);} + zp_iln zp_nthw zp_useq zp_useres inline double long tan(double long const ang) {return ::zp_tandl(ang);} - zp_iln zp_nthrw zp_useq zp_useres inline float tsrt(float val) {return ::zp_tsrtf( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double tsrt(double val) {return ::zp_tsrtd( val);} - zp_iln zp_nthrw zp_useq zp_useres inline double long tsrt(double long val) {return ::zp_tsrtdl(val);} + zp_iln zp_nthw zp_useq zp_useres inline float tsrt(float const val) {return ::zp_tsrtf( val);} + zp_iln zp_nthw zp_useq zp_useres inline double tsrt(double const val) {return ::zp_tsrtd( val);} + zp_iln zp_nthw zp_useq zp_useres inline double long tsrt(double long const val) {return ::zp_tsrtdl(val);} - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec2<float> vadd2f( ::zp::vec2<float> lvec,::zp::vec2<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec2<double> vadd2d( ::zp::vec2<double> lvec,::zp::vec2<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec2<double long> vadd2dl(::zp::vec2<double long> lvec,::zp::vec2<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec2<float> vadd2f( ::zp::vec2<float> const lvec,::zp::vec2<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec2<double> vadd2d( ::zp::vec2<double> const lvec,::zp::vec2<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec2<double long> vadd2dl(::zp::vec2<double long> const lvec,::zp::vec2<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec3<float> vadd3f( ::zp::vec3<float> lvec,::zp::vec3<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec3<double> vadd3d( ::zp::vec3<double> lvec,::zp::vec3<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec3<double long> vadd3dl(::zp::vec3<double long> lvec,::zp::vec3<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec3<float> vadd3f( ::zp::vec3<float> const lvec,::zp::vec3<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec3<double> vadd3d( ::zp::vec3<double> const lvec,::zp::vec3<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec3<double long> vadd3dl(::zp::vec3<double long> const lvec,::zp::vec3<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec4<float> vadd4f( ::zp::vec4<float> lvec,::zp::vec4<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec4<double> vadd4d( ::zp::vec4<double> lvec,::zp::vec4<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec4<double long> vadd4dl(::zp::vec4<double long> lvec,::zp::vec4<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec4<float> vadd4f( ::zp::vec4<float> const lvec,::zp::vec4<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec4<double> vadd4d( ::zp::vec4<double> const lvec,::zp::vec4<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec4<double long> vadd4dl(::zp::vec4<double long> const lvec,::zp::vec4<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec2<float> vsub2f( ::zp::vec2<float> lvec,::zp::vec2<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec2<double> vsub2d( ::zp::vec2<double> lvec,::zp::vec2<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec2<double long> vsub2dl(::zp::vec2<double long> lvec,::zp::vec2<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec2<float> vsub2f( ::zp::vec2<float> const lvec,::zp::vec2<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec2<double> vsub2d( ::zp::vec2<double> const lvec,::zp::vec2<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec2<double long> vsub2dl(::zp::vec2<double long> const lvec,::zp::vec2<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec3<float> vsub3f( ::zp::vec3<float> lvec,::zp::vec3<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec3<double> vsub3d( ::zp::vec3<double> lvec,::zp::vec3<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec3<double long> vsub3dl(::zp::vec3<double long> lvec,::zp::vec3<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec3<float> vsub3f( ::zp::vec3<float> const lvec,::zp::vec3<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec3<double> vsub3d( ::zp::vec3<double> const lvec,::zp::vec3<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec3<double long> vsub3dl(::zp::vec3<double long> const lvec,::zp::vec3<double long> const rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec4<float> vsub4f( ::zp::vec4<float> lvec,::zp::vec4<float> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec4<double> vsub4d( ::zp::vec4<double> lvec,::zp::vec4<double> rvec); - zp_iln zp_nthrw zp_useq zp_useres inline ::zp::vec4<double long> vsub4dl(::zp::vec4<double long> lvec,::zp::vec4<double long> rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec4<float> vsub4f( ::zp::vec4<float> const lvec,::zp::vec4<float> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec4<double> vsub4d( ::zp::vec4<double> const lvec,::zp::vec4<double> const rvec); + zp_iln zp_nthw zp_useq zp_useres inline ::zp::vec4<double long> vsub4dl(::zp::vec4<double long> const lvec,::zp::vec4<double long> const rvec); } #endif diff --git a/zp/include/zp/mth.h b/zp/include/zp/mth.h index 2535f1e..b272851 100644 --- a/zp/include/zp/mth.h +++ b/zp/include/zp/mth.h @@ -120,188 +120,188 @@ struct zp_vec4dl { #define zp_isnanf( val) ((bool)((val) != (val))) /* absolute */ -zp_nthrw zp_useq zp_useres double zp_absd( double val); -zp_nthrw zp_useq zp_useres double long zp_absdl(double long val); -zp_nthrw zp_useq zp_useres float zp_absf( float val); +zp_nthw zp_useq zp_useres double zp_absd( double val); +zp_nthw zp_useq zp_useres double long zp_absdl(double long val); +zp_nthw zp_useq zp_useres float zp_absf( float val); /* arccosine */ -zp_nthrw zp_useq zp_useres double zp_acosd( double val); -zp_nthrw zp_useq zp_useres double long zp_acosdl(double long val); -zp_nthrw zp_useq zp_useres float zp_acosf( float val); +zp_nthw zp_useq zp_useres double zp_acosd( double val); +zp_nthw zp_useq zp_useres double long zp_acosdl(double long val); +zp_nthw zp_useq zp_useres float zp_acosf( float val); /* arccotangent */ -zp_nthrw zp_useq zp_useres double zp_acotd( double val); -zp_nthrw zp_useq zp_useres double long zp_acotdl(double long val); -zp_nthrw zp_useq zp_useres float zp_acotf( float val); +zp_nthw zp_useq zp_useres double zp_acotd( double val); +zp_nthw zp_useq zp_useres double long zp_acotdl(double long val); +zp_nthw zp_useq zp_useres float zp_acotf( float val); /* arccosecant */ -zp_nthrw zp_useq zp_useres double zp_acscd( double val); -zp_nthrw zp_useq zp_useres double long zp_acscdl(double long val); -zp_nthrw zp_useq zp_useres float zp_acscf( float val); +zp_nthw zp_useq zp_useres double zp_acscd( double val); +zp_nthw zp_useq zp_useres double long zp_acscdl(double long val); +zp_nthw zp_useq zp_useres float zp_acscf( float val); /* arcsecant */ -zp_nthrw zp_useq zp_useres double zp_asecd( double val); -zp_nthrw zp_useq zp_useres double long zp_asecdl(double long val); -zp_nthrw zp_useq zp_useres float zp_asecf( float val); +zp_nthw zp_useq zp_useres double zp_asecd( double val); +zp_nthw zp_useq zp_useres double long zp_asecdl(double long val); +zp_nthw zp_useq zp_useres float zp_asecf( float val); /* arcsine */ -zp_nthrw zp_useq zp_useres double zp_asind( double val); -zp_nthrw zp_useq zp_useres double long zp_asindl(double long val); -zp_nthrw zp_useq zp_useres float zp_asinf( float val); +zp_nthw zp_useq zp_useres double zp_asind( double val); +zp_nthw zp_useq zp_useres double long zp_asindl(double long val); +zp_nthw zp_useq zp_useres float zp_asinf( float val); /* arctangens */ -zp_nthrw zp_useq zp_useres double zp_atand( double val); -zp_nthrw zp_useq zp_useres double long zp_atandl(double long val); -zp_nthrw zp_useq zp_useres float zp_atanf( float val); +zp_nthw zp_useq zp_useres double zp_atand( double val); +zp_nthw zp_useq zp_useres double long zp_atandl(double long val); +zp_nthw zp_useq zp_useres float zp_atanf( float val); /* arctangens 2 */ -zp_nthrw zp_useq zp_useres double zp_atan2d( double y,double x); -zp_nthrw zp_useq zp_useres double long zp_atan2dl(double long y,double long x); -zp_nthrw zp_useq zp_useres float zp_atan2f( float y,float x); +zp_nthw zp_useq zp_useres double zp_atan2d( double y,double x); +zp_nthw zp_useq zp_useres double long zp_atan2dl(double long y,double long x); +zp_nthw zp_useq zp_useres float zp_atan2f( float y,float x); /* cube root */ -zp_nthrw zp_useq zp_useres double zp_cbrtd( double val); -zp_nthrw zp_useq zp_useres double long zp_cbrtdl(double long val); -zp_nthrw zp_useq zp_useres float zp_cbrtf( float val); +zp_nthw zp_useq zp_useres double zp_cbrtd( double val); +zp_nthw zp_useq zp_useres double long zp_cbrtdl(double long val); +zp_nthw zp_useq zp_useres float zp_cbrtf( float val); /* cosine */ -zp_nthrw zp_useq zp_useres double zp_cosd( double ang); -zp_nthrw zp_useq zp_useres double long zp_cosdl(double long ang); -zp_nthrw zp_useq zp_useres float zp_cosf( float ang); +zp_nthw zp_useq zp_useres double zp_cosd( double ang); +zp_nthw zp_useq zp_useres double long zp_cosdl(double long ang); +zp_nthw zp_useq zp_useres float zp_cosf( float ang); /* cotangent */ -zp_nthrw zp_useq zp_useres double zp_cotd( double ang); -zp_nthrw zp_useq zp_useres double long zp_cotdl(double long ang); -zp_nthrw zp_useq zp_useres float zp_cotf( float ang); +zp_nthw zp_useq zp_useres double zp_cotd( double ang); +zp_nthw zp_useq zp_useres double long zp_cotdl(double long ang); +zp_nthw zp_useq zp_useres float zp_cotf( float ang); /* cosecant */ -zp_nthrw zp_useq zp_useres double zp_cscd( double ang); -zp_nthrw zp_useq zp_useres double long zp_cscdl(double long ang); -zp_nthrw zp_useq zp_useres float zp_cscf( float ang); +zp_nthw zp_useq zp_useres double zp_cscd( double ang); +zp_nthw zp_useq zp_useres double long zp_cscdl(double long ang); +zp_nthw zp_useq zp_useres float zp_cscf( float ang); /* two-space distance */ -zp_nthrw zp_useq zp_useres double zp_dist2d( double x,double y); -zp_nthrw zp_useq zp_useres double long zp_dist2dl(double long x,double long y); -zp_nthrw zp_useq zp_useres float zp_dist2f( float x,float y); +zp_nthw zp_useq zp_useres double zp_dst2d( double x,double y); +zp_nthw zp_useq zp_useres double long zp_dst2dl(double long x,double long y); +zp_nthw zp_useq zp_useres float zp_dst2f( float x,float y); /* three-space distance */ -zp_nthrw zp_useq zp_useres double zp_dist3d( double x,double y,double z); -zp_nthrw zp_useq zp_useres double long zp_dist3dl(double long x,double long y,double long z); -zp_nthrw zp_useq zp_useres float zp_dist3f( float x,float y,float z); +zp_nthw zp_useq zp_useres double zp_dst3d( double x,double y,double z); +zp_nthw zp_useq zp_useres double long zp_dst3dl(double long x,double long y,double long z); +zp_nthw zp_useq zp_useres float zp_dst3f( float x,float y,float z); /* four-space distance */ -zp_nthrw zp_useq zp_useres double zp_dist4d( double x,double y,double z,double w); -zp_nthrw zp_useq zp_useres double long zp_dist4dl(double long x,double long y,double long z,double long w); -zp_nthrw zp_useq zp_useres float zp_dist4f( float x,float y,float z,float w); +zp_nthw zp_useq zp_useres double zp_dst4d( double x,double y,double z,double w); +zp_nthw zp_useq zp_useres double long zp_dst4dl(double long x,double long y,double long z,double long w); +zp_nthw zp_useq zp_useres float zp_dst4f( float x,float y,float z,float w); /* division-modulo */ -zp_nthrw zp_useq zp_useres struct divmodressc zp_divmodsc(char signed num,char signed den); -zp_nthrw zp_useq zp_useres struct divmodress zp_divmods( short num,short den); -zp_nthrw zp_useq zp_useres struct divmodresi zp_divmodi( int num,int den); -zp_nthrw zp_useq zp_useres struct divmodresl zp_divmodl( long num,long den); +zp_nthw zp_useq zp_useres struct divmodressc zp_divmodsc(char signed num,char signed den); +zp_nthw zp_useq zp_useres struct divmodress zp_divmods( short num,short den); +zp_nthw zp_useq zp_useres struct divmodresi zp_divmodi( int num,int den); +zp_nthw zp_useq zp_useres struct divmodresl zp_divmodl( long num,long den); #if zp_std_c99 || zp_std_cxx11 -zp_nthrw zp_useq zp_useres struct divmodresll zp_divmodll(long long num,long long den); +zp_nthw zp_useq zp_useres struct divmodresll zp_divmodll(long long num,long long den); #endif /* two-space dot product */ -zp_nthrw zp_useq zp_useres float zp_dot2f( zp_vec2f lvec,zp_vec2f rvec); -zp_nthrw zp_useq zp_useres double zp_dot2d( zp_vec2d lvec,zp_vec2d rvec); -zp_nthrw zp_useq zp_useres double long zp_dot2dl(zp_vec2dl lvec,zp_vec2dl rvec); +zp_nthw zp_useq zp_useres float zp_dot2f( zp_vec2f lvec,zp_vec2f rvec); +zp_nthw zp_useq zp_useres double zp_dot2d( zp_vec2d lvec,zp_vec2d rvec); +zp_nthw zp_useq zp_useres double long zp_dot2dl(zp_vec2dl lvec,zp_vec2dl rvec); /* three-space dot product */ -zp_nthrw zp_useq zp_useres float zp_dot3f( zp_vec3f lvec,zp_vec3f rvec); -zp_nthrw zp_useq zp_useres double zp_dot3d( zp_vec3d lvec,zp_vec3d rvec); -zp_nthrw zp_useq zp_useres double long zp_dot3dl(zp_vec3dl lvec,zp_vec3dl rvec); +zp_nthw zp_useq zp_useres float zp_dot3f( zp_vec3f lvec,zp_vec3f rvec); +zp_nthw zp_useq zp_useres double zp_dot3d( zp_vec3d lvec,zp_vec3d rvec); +zp_nthw zp_useq zp_useres double long zp_dot3dl(zp_vec3dl lvec,zp_vec3dl rvec); /* four-space dot product */ -zp_nthrw zp_useq zp_useres float zp_dot4f( zp_vec4f lvec,zp_vec4f rvec); -zp_nthrw zp_useq zp_useres double zp_dot4d( zp_vec4d lvec,zp_vec4d rvec); -zp_nthrw zp_useq zp_useres double long zp_dot4dl(zp_vec4dl lvec,zp_vec4dl rvec); +zp_nthw zp_useq zp_useres float zp_dot4f( zp_vec4f lvec,zp_vec4f rvec); +zp_nthw zp_useq zp_useres double zp_dot4d( zp_vec4d lvec,zp_vec4d rvec); +zp_nthw zp_useq zp_useres double long zp_dot4dl(zp_vec4dl lvec,zp_vec4dl rvec); /* exponentation */ -zp_nthrw zp_useq zp_useres float zp_expd( float val,float n); -zp_nthrw zp_useq zp_useres double zp_expf( double val,double n); -zp_nthrw zp_useq zp_useres double long zp_expdl(double long val,double long n); +zp_nthw zp_useq zp_useres float zp_expd( float val,float n); +zp_nthw zp_useq zp_useres double zp_expf( double val,double n); +zp_nthw zp_useq zp_useres double long zp_expdl(double long val,double long n); /* binary logarithm */ -zp_nthrw zp_useq zp_useres double zp_lbd( double val); -zp_nthrw zp_useq zp_useres double long zp_lbdl(double long val); -zp_nthrw zp_useq zp_useres float zp_lbf( float val); +zp_nthw zp_useq zp_useres double zp_lbd( double val); +zp_nthw zp_useq zp_useres double long zp_lbdl(double long val); +zp_nthw zp_useq zp_useres float zp_lbf( float val); /* common logarithm */ -zp_nthrw zp_useq zp_useres double zp_lgd( double val); -zp_nthrw zp_useq zp_useres double long zp_lgdl(double long val); -zp_nthrw zp_useq zp_useres float zp_lgf( float val); +zp_nthw zp_useq zp_useres double zp_lgd( double val); +zp_nthw zp_useq zp_useres double long zp_lgdl(double long val); +zp_nthw zp_useq zp_useres float zp_lgf( float val); /* natual logarithm */ -zp_nthrw zp_useq zp_useres double zp_lnd( double val); -zp_nthrw zp_useq zp_useres double long zp_lndl(double long val); -zp_nthrw zp_useq zp_useres float zp_lnf( float val); +zp_nthw zp_useq zp_useres double zp_lnd( double val); +zp_nthw zp_useq zp_useres double long zp_lndl(double long val); +zp_nthw zp_useq zp_useres float zp_lnf( float val); /* logarithm */ -zp_nthrw zp_useq zp_useres double zp_logd( double val,double n); -zp_nthrw zp_useq zp_useres double long zp_logdl(double long val,double long n); -zp_nthrw zp_useq zp_useres float zp_logf( float val,float n); +zp_nthw zp_useq zp_useres double zp_logd( double val,double n); +zp_nthw zp_useq zp_useres double long zp_logdl(double long val,double long n); +zp_nthw zp_useq zp_useres float zp_logf( float val,float n); /* nth root */ -zp_nthrw zp_useq zp_useres double zp_nrtd( double val,double n); -zp_nthrw zp_useq zp_useres double long zp_nrtdl(double long val,double long n); -zp_nthrw zp_useq zp_useres float zp_nrtf( float val,float n); +zp_nthw zp_useq zp_useres double zp_nrtd( double val,double n); +zp_nthw zp_useq zp_useres double long zp_nrtdl(double long val,double long n); +zp_nthw zp_useq zp_useres float zp_nrtf( float val,float n); /* secant */ -zp_nthrw zp_useq zp_useres double zp_secd( double ang); -zp_nthrw zp_useq zp_useres double long zp_secdl(double long ang); -zp_nthrw zp_useq zp_useres float zp_secf( float ang); +zp_nthw zp_useq zp_useres double zp_secd( double ang); +zp_nthw zp_useq zp_useres double long zp_secdl(double long ang); +zp_nthw zp_useq zp_useres float zp_secf( float ang); /* sine */ -zp_nthrw zp_useq zp_useres double zp_sind( double ang); -zp_nthrw zp_useq zp_useres double long zp_sindl(double long ang); -zp_nthrw zp_useq zp_useres float zp_sinf( float ang); +zp_nthw zp_useq zp_useres double zp_sind( double ang); +zp_nthw zp_useq zp_useres double long zp_sindl(double long ang); +zp_nthw zp_useq zp_useres float zp_sinf( float ang); /* square root */ -zp_nthrw zp_useq zp_useres double zp_sqrtd( double val); -zp_nthrw zp_useq zp_useres double long zp_sqrtdl(double long val); -zp_nthrw zp_useq zp_useres float zp_sqrtf( float val); +zp_nthw zp_useq zp_useres double zp_sqrtd( double val); +zp_nthw zp_useq zp_useres double long zp_sqrtdl(double long val); +zp_nthw zp_useq zp_useres float zp_sqrtf( float val); /* tangens */ -zp_nthrw zp_useq zp_useres double zp_tand( double ang); -zp_nthrw zp_useq zp_useres double long zp_tandl(double long ang); -zp_nthrw zp_useq zp_useres float zp_tanf( float ang); +zp_nthw zp_useq zp_useres double zp_tand( double ang); +zp_nthw zp_useq zp_useres double long zp_tandl(double long ang); +zp_nthw zp_useq zp_useres float zp_tanf( float ang); /* "tesseract" (fourth) root */ -zp_nthrw zp_useq zp_useres double zp_tsrtd( double val); -zp_nthrw zp_useq zp_useres double long zp_tsrtdl(double long val); -zp_nthrw zp_useq zp_useres float zp_tsrtf( float val); +zp_nthw zp_useq zp_useres double zp_tsrtd( double val); +zp_nthw zp_useq zp_useres double long zp_tsrtdl(double long val); +zp_nthw zp_useq zp_useres float zp_tsrtf( float val); /* two-space vector addition */ -zp_nthrw zp_useq zp_useres zp_vec2f zp_vadd2f( zp_vec2f lvec,zp_vec2f rvec); -zp_nthrw zp_useq zp_useres zp_vec2d zp_vadd2d( zp_vec2d lvec,zp_vec2d rvec); -zp_nthrw zp_useq zp_useres zp_vec2dl zp_vadd2dl(zp_vec2dl lvec,zp_vec2dl rvec); +zp_nthw zp_useq zp_useres zp_vec2f zp_vadd2f( zp_vec2f lvec,zp_vec2f rvec); +zp_nthw zp_useq zp_useres zp_vec2d zp_vadd2d( zp_vec2d lvec,zp_vec2d rvec); +zp_nthw zp_useq zp_useres zp_vec2dl zp_vadd2dl(zp_vec2dl lvec,zp_vec2dl rvec); /* three-space vector addition */ -zp_nthrw zp_useq zp_useres zp_vec3f zp_vadd3f( zp_vec3f lvec,zp_vec3f rvec); -zp_nthrw zp_useq zp_useres zp_vec3d zp_vadd3d( zp_vec3d lvec,zp_vec3d rvec); -zp_nthrw zp_useq zp_useres zp_vec3dl zp_vadd3dl(zp_vec3dl lvec,zp_vec3dl rvec); +zp_nthw zp_useq zp_useres zp_vec3f zp_vadd3f( zp_vec3f lvec,zp_vec3f rvec); +zp_nthw zp_useq zp_useres zp_vec3d zp_vadd3d( zp_vec3d lvec,zp_vec3d rvec); +zp_nthw zp_useq zp_useres zp_vec3dl zp_vadd3dl(zp_vec3dl lvec,zp_vec3dl rvec); /* four-space vector addition */ -zp_nthrw zp_useq zp_useres zp_vec4f zp_v4addf( zp_vec4f lvec,zp_vec4f rvec); -zp_nthrw zp_useq zp_useres zp_vec4d zp_v4addd( zp_vec4d lvec,zp_vec4d rvec); -zp_nthrw zp_useq zp_useres zp_vec4dl zp_v4adddl(zp_vec4dl lvec,zp_vec4dl rvec); +zp_nthw zp_useq zp_useres zp_vec4f zp_v4addf( zp_vec4f lvec,zp_vec4f rvec); +zp_nthw zp_useq zp_useres zp_vec4d zp_v4addd( zp_vec4d lvec,zp_vec4d rvec); +zp_nthw zp_useq zp_useres zp_vec4dl zp_v4adddl(zp_vec4dl lvec,zp_vec4dl rvec); /* two-space vector subtraction */ -zp_nthrw zp_useq zp_useres zp_vec2f zp_vsub2f( zp_vec2f lvec,zp_vec2f rvec); -zp_nthrw zp_useq zp_useres zp_vec2d zp_vsub2d( zp_vec2d lvec,zp_vec2d rvec); -zp_nthrw zp_useq zp_useres zp_vec2dl zp_vsub2dl(zp_vec2dl lvec,zp_vec2dl rvec); +zp_nthw zp_useq zp_useres zp_vec2f zp_vsub2f( zp_vec2f lvec,zp_vec2f rvec); +zp_nthw zp_useq zp_useres zp_vec2d zp_vsub2d( zp_vec2d lvec,zp_vec2d rvec); +zp_nthw zp_useq zp_useres zp_vec2dl zp_vsub2dl(zp_vec2dl lvec,zp_vec2dl rvec); /* three-space vector subtraction */ -zp_nthrw zp_useq zp_useres zp_vec3f zp_vsub3f( zp_vec3f lvec,zp_vec3f rvec); -zp_nthrw zp_useq zp_useres zp_vec3d zp_vsub3d( zp_vec3d lvec,zp_vec3d rvec); -zp_nthrw zp_useq zp_useres zp_vec3dl zp_vsub3dl(zp_vec3dl lvec,zp_vec3dl rvec); +zp_nthw zp_useq zp_useres zp_vec3f zp_vsub3f( zp_vec3f lvec,zp_vec3f rvec); +zp_nthw zp_useq zp_useres zp_vec3d zp_vsub3d( zp_vec3d lvec,zp_vec3d rvec); +zp_nthw zp_useq zp_useres zp_vec3dl zp_vsub3dl(zp_vec3dl lvec,zp_vec3dl rvec); /* four-space vector subtraction */ -zp_nthrw zp_useq zp_useres zp_vec4f zp_v4subf( zp_vec4f lvec,zp_vec4f rvec); -zp_nthrw zp_useq zp_useres zp_vec4d zp_v4subd( zp_vec4d lvec,zp_vec4d rvec); -zp_nthrw zp_useq zp_useres zp_vec4dl zp_v4subdl(zp_vec4dl lvec,zp_vec4dl rvec); +zp_nthw zp_useq zp_useres zp_vec4f zp_v4subf( zp_vec4f lvec,zp_vec4f rvec); +zp_nthw zp_useq zp_useres zp_vec4d zp_v4subd( zp_vec4d lvec,zp_vec4d rvec); +zp_nthw zp_useq zp_useres zp_vec4dl zp_v4subdl(zp_vec4dl lvec,zp_vec4dl rvec); zp_prv_cdeclend diff --git a/zp/include/zp/str b/zp/include/zp/str index ab954ef..76ede2d 100644 --- a/zp/include/zp/str +++ b/zp/include/zp/str @@ -12,49 +12,47 @@ namespace zp { namespace prv { - template<typename typ> zp_nthrw zp_useres ::zp::siz numdig(typ val,::zp::i8m bs); + template<typename typ> zp_nthw zp_useres ::zp::siz numdig(typ val,::zp::i8m bs); } - zp_iln zp_nthrw inline ::zp::siz strcpy(char * dst, char const * src) {return ::zp_strcpy(dst,src);} - zp_iln zp_nthrw zp_useres inline bool strequ(char const * lstr,char const * rstr) {return ::zp_strequ(lstr,rstr);} - zp_iln zp_nthrw zp_useres inline ::zp::siz strfil(char * str,char chr) {return ::zp_strfil(str,chr);} - zp_iln zp_nthrw inline ::zp::siz strlen(char const * str) {return ::zp_strlen(str);} - zp_iln zp_nthrw zp_useres inline char * strsrh(char * str, char chr) {return ::zp_strsrh(str,chr);} - zp_iln zp_nthrw zp_useres inline char const * strsrh(char const * str, char chr) {return const_cast<char const *>(::zp_strsrh(str,chr));} - - zp_iln zp_nthrw inline ::zp::siz wstrcpy(wchar_t * dst, wchar_t const * src) {return ::zp_wstrcpy(dst,src);} - zp_iln zp_nthrw zp_useres inline bool wstrequ(wchar_t const * lstr,wchar_t const * rstr) {return ::zp_wstrequ(lstr,rstr);} - zp_iln zp_nthrw zp_useres inline ::zp::siz wstrfil(wchar_t * str,wchar_t chr) {return ::zp_wstrfil(str,chr);} - zp_iln zp_nthrw inline ::zp::siz wstrlen(wchar_t const * str) {return ::zp_wstrlen(str);} - zp_iln zp_nthrw zp_useres inline wchar_t * wstrsrh(wchar_t * str, wchar_t chr) {return ::zp_wstrsrh(str,chr);} - zp_iln zp_nthrw zp_useres inline wchar_t const * wstrsrh(wchar_t const * str, wchar_t chr) {return const_cast<wchar_t const *>(::zp_wstrsrh(str,chr));} - - zp_iln zp_nthrw inline ::zp::siz utf32cpy(::zp::c02 * dst, ::zp::c02 const * src) {return ::zp_utf32cpy(dst,src);} - zp_iln zp_nthrw zp_useres inline bool utf32equ(::zp::c02 const * lstr,::zp::c02 const * rstr) {return ::zp_utf32equ(lstr,rstr);} - zp_iln zp_nthrw zp_useres inline ::zp::siz utf32fil(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32fil(str,chr);} - zp_iln zp_nthrw inline ::zp::siz utf32len(::zp::c02 const * str) {return ::zp_utf32len(str);} - zp_iln zp_nthrw zp_useres inline ::zp::c02 * utf32srh(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32srh(str,chr);} - zp_iln zp_nthrw zp_useres inline ::zp::c02 const * utf32srh(::zp::c02 const * str, ::zp::c02 chr) {return const_cast< ::zp::c02 const *>(::zp_utf32srh(str,chr));} - - zp_iln zp_nthrw zp_useres inline ::zp::siz utf8enclen( ::zp::c02 const * str) {return ::zp_utf8enclen(str);} - zp_iln zp_nthrw zp_useres inline ::zp::siz utf8declen( ::zp::c8 const * str) {return ::zp_utf8declen(str);} - zp_iln zp_nthrw zp_useres inline ::zp::siz utf16enclen(::zp::c02 const * str) {return ::zp_utf16enclen(str);} - zp_iln zp_nthrw zp_useres inline ::zp::siz utf16declen(::zp::c01 const * str) {return ::zp_utf16declen(str);} - - zp_iln zp_nthrw inline void utf8enc( ::zp::c8 * dst,::zp::c02 const * src) {return ::zp_utf8enc(dst,src);} - zp_iln zp_nthrw inline void utf8dec( ::zp::c02 * dst,::zp::c8 const * src) {return ::zp_utf8dec(dst,src);} - zp_iln zp_nthrw inline void utf16enc( ::zp::c01 * dst,::zp::c02 const * src) {return ::zp_utf16enc(dst,src);} - zp_iln zp_nthrw inline void utf16dec( ::zp::c02 * dst,::zp::c01 const * src) {return ::zp_utf16dec(dst,src);} - zp_iln zp_nthrw inline void win1252enc(::zp::c8 * dst,::zp::c02 const * src) {return ::zp_win1252enc(dst,src);} - zp_iln zp_nthrw inline void win1252dec(::zp::c02 * dst,::zp::c8 const * src) {return ::zp_win1252dec(dst,src);} - - //template<typename typ> zp_nthrw zp_useres ::zp::siz fmtlen(typ val,::zp::i8m bs); /* Including (potential) decorations. */ - - //template<typename typ> zp_nthrw void fmt(::zp::c02 * buf,typ val,::zp::i8m bs,bool rtl = false); + zp_iln zp_nthw inline ::zp::siz strcpy(char * dst, char const * src) {return ::zp_strcpy(dst,src);} + zp_iln zp_nthw zp_useres inline bool strequ(char const * lstr,char const * rstr) {return ::zp_strequ(lstr,rstr);} + zp_iln zp_nthw zp_useres inline ::zp::siz strfil(char * str,char chr) {return ::zp_strfil(str,chr);} + zp_iln zp_nthw inline ::zp::siz strlen(char const * str) {return ::zp_strlen(str);} + zp_iln zp_nthw zp_useres inline char * strsrh(char * str, char chr) {return ::zp_strsrh(str,chr);} + zp_iln zp_nthw zp_useres inline char const * strsrh(char const * str, char chr) {return const_cast<char const *>(::zp_strsrh(str,chr));} + + zp_iln zp_nthw inline ::zp::siz wstrcpy(wchar_t * dst, wchar_t const * src) {return ::zp_wstrcpy(dst,src);} + zp_iln zp_nthw zp_useres inline bool wstrequ(wchar_t const * lstr,wchar_t const * rstr) {return ::zp_wstrequ(lstr,rstr);} + zp_iln zp_nthw zp_useres inline ::zp::siz wstrfil(wchar_t * str,wchar_t chr) {return ::zp_wstrfil(str,chr);} + zp_iln zp_nthw inline ::zp::siz wstrlen(wchar_t const * str) {return ::zp_wstrlen(str);} + zp_iln zp_nthw zp_useres inline wchar_t * wstrsrh(wchar_t * str, wchar_t chr) {return ::zp_wstrsrh(str,chr);} + zp_iln zp_nthw zp_useres inline wchar_t const * wstrsrh(wchar_t const * str, wchar_t chr) {return const_cast<wchar_t const *>(::zp_wstrsrh(str,chr));} + + zp_iln zp_nthw inline ::zp::siz utf32cpy(::zp::c02 * dst, ::zp::c02 const * src) {return ::zp_utf32cpy(dst,src);} + zp_iln zp_nthw zp_useres inline bool utf32equ(::zp::c02 const * lstr,::zp::c02 const * rstr) {return ::zp_utf32equ(lstr,rstr);} + zp_iln zp_nthw zp_useres inline ::zp::siz utf32fil(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32fil(str,chr);} + zp_iln zp_nthw inline ::zp::siz utf32len(::zp::c02 const * str) {return ::zp_utf32len(str);} + zp_iln zp_nthw zp_useres inline ::zp::c02 * utf32srh(::zp::c02 * str, ::zp::c02 chr) {return ::zp_utf32srh(str,chr);} + zp_iln zp_nthw zp_useres inline ::zp::c02 const * utf32srh(::zp::c02 const * str, ::zp::c02 chr) {return const_cast< ::zp::c02 const *>(::zp_utf32srh(str,chr));} + + zp_iln zp_nthw zp_useres inline ::zp::siz utf8enclen( ::zp::c02 const * str) {return ::zp_utf8enclen(str);} + zp_iln zp_nthw zp_useres inline ::zp::siz utf8declen( ::zp::c8 const * str) {return ::zp_utf8declen(str);} + zp_iln zp_nthw zp_useres inline ::zp::siz utf16enclen(::zp::c02 const * str) {return ::zp_utf16enclen(str);} + zp_iln zp_nthw zp_useres inline ::zp::siz utf16declen(::zp::c01 const * str) {return ::zp_utf16declen(str);} + + zp_iln zp_nthw inline void utf8enc( ::zp::c8 * dst,::zp::c02 const * src) {return ::zp_utf8enc(dst,src);} + zp_iln zp_nthw inline void utf8dec( ::zp::c02 * dst,::zp::c8 const * src) {return ::zp_utf8dec(dst,src);} + zp_iln zp_nthw inline void utf16enc( ::zp::c01 * dst,::zp::c02 const * src) {return ::zp_utf16enc(dst,src);} + zp_iln zp_nthw inline void utf16dec( ::zp::c02 * dst,::zp::c01 const * src) {return ::zp_utf16dec(dst,src);} + zp_iln zp_nthw inline void win1252enc(::zp::c8 * dst,::zp::c02 const * src) {return ::zp_win1252enc(dst,src);} + zp_iln zp_nthw inline void win1252dec(::zp::c02 * dst,::zp::c8 const * src) {return ::zp_win1252dec(dst,src);} + + //template<typename typ> zp_nthw zp_useres ::zp::siz fmtlen(typ val,::zp::i8m bs); /* Including (potential) decorations. */ + + //template<typename typ> zp_nthw void fmt(::zp::c02 * buf,typ val,::zp::i8m bs,bool rtl = false); } -//#include <zp/str.d/fmt.ii> -//#include <zp/str.d/fmtlen.ii> -#include <zp/str.d/numdig.ii> +#include <zp/imp/str.ii> #endif diff --git a/zp/include/zp/str.d/fmtlen.ii b/zp/include/zp/str.d/fmtlen.ii deleted file mode 100644 index 7509b1a..0000000 --- a/zp/include/zp/str.d/fmtlen.ii +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> constexpr auto zp::fmtlen(typ val,::zp::i8m const bs) noexcept -> ::zp::siz { - static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); - - ::zp::siz len = 0x0u; - - if (val < typ {0x0}) { - val = typ {0x0}-val; - len = 0x1u; - } - - len += ::zp::prv::numdig(val,bs); - - return len; -} diff --git a/zp/include/zp/str.d/numdig.ii b/zp/include/zp/str.d/numdig.ii deleted file mode 100644 index f7a792d..0000000 --- a/zp/include/zp/str.d/numdig.ii +++ /dev/null @@ -1,17 +0,0 @@ -/* - Copyright 2022-2023 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>. -*/ - -template<typename typ> zp_nthrw ::zp::siz zp::prv::numdig(typ fmtval,::zp::i8m const bs) { - //static_assert(::zp::isinttyp<typ>::val,"type must be an integral type"); - - if (fmtval == typ (0x0)) return 0x1u; - - ::zp::siz len = 0x0u; - - for (typ val = fmtval;val > typ (0x0);val /= static_cast<typ>(bs)) {++len;} - - return len; -} diff --git a/zp/include/zp/str.h b/zp/include/zp/str.h index 324853e..97b9e17 100644 --- a/zp/include/zp/str.h +++ b/zp/include/zp/str.h @@ -11,60 +11,60 @@ zp_prv_cdecl -zp_nthrw zp_siz zp_strcpy(char * dst, char const * src); -zp_nthrw zp_useres bool zp_strequ(char const * lstr,char const * rstr); -zp_nthrw zp_siz zp_strfil(char * str, char chr); -zp_nthrw zp_siz zp_strlen(char const * str); -zp_nthrw char * zp_strsrh(char const * str, char chr); +zp_nthw zp_siz zp_strcpy(char * dst, char const * src); +zp_nthw zp_useres bool zp_strequ(char const * lstr,char const * rstr); +zp_nthw zp_siz zp_strfil(char * str, char chr); +zp_nthw zp_siz zp_strlen(char const * str); +zp_nthw char * zp_strsrh(char const * str, char chr); -zp_nthrw zp_siz zp_wstrcpy(zp_wchr * dst, zp_wchr const * src); -zp_nthrw zp_useres bool zp_wstrequ(zp_wchr const * lstr,zp_wchr const * rstr); -zp_nthrw zp_siz zp_wstrfil(zp_wchr * str, zp_wchr chr); -zp_nthrw zp_siz zp_wstrlen(zp_wchr const * str); -zp_nthrw zp_wchr * zp_wstrsrh(zp_wchr const * str, zp_wchr chr); +zp_nthw zp_siz zp_wstrcpy(zp_wchr * dst, zp_wchr const * src); +zp_nthw zp_useres bool zp_wstrequ(zp_wchr const * lstr,zp_wchr const * rstr); +zp_nthw zp_siz zp_wstrfil(zp_wchr * str, zp_wchr chr); +zp_nthw zp_siz zp_wstrlen(zp_wchr const * str); +zp_nthw zp_wchr * zp_wstrsrh(zp_wchr const * str, zp_wchr chr); -zp_nthrw zp_siz zp_utf32cpy(zp_c02 * dst, zp_c02 const * src); -zp_nthrw zp_useres bool zp_utf32equ(zp_c02 const * lstr,zp_c02 const * rstr); -zp_nthrw zp_siz zp_utf32fil(zp_c02 * str, zp_c02 chr); -zp_nthrw zp_siz zp_utf32len(zp_c02 const * str); -zp_nthrw zp_c02 * zp_utf32srh(zp_c02 const * str, zp_c02 chr); +zp_nthw zp_siz zp_utf32cpy(zp_c02 * dst, zp_c02 const * src); +zp_nthw zp_useres bool zp_utf32equ(zp_c02 const * lstr,zp_c02 const * rstr); +zp_nthw zp_siz zp_utf32fil(zp_c02 * str, zp_c02 chr); +zp_nthw zp_siz zp_utf32len(zp_c02 const * str); +zp_nthw zp_c02 * zp_utf32srh(zp_c02 const * str, zp_c02 chr); -zp_nthrw zp_useres zp_siz zp_utf8enclen( zp_c02 const * str); -zp_nthrw zp_useres zp_siz zp_utf8declen( zp_c8 const * str); -zp_nthrw zp_useres zp_siz zp_utf16enclen(zp_c02 const * str); -zp_nthrw zp_useres zp_siz zp_utf16declen(zp_c01 const * str); +zp_nthw zp_useres zp_siz zp_utf8enclen( zp_c02 const * str); +zp_nthw zp_useres zp_siz zp_utf8declen( zp_c8 const * str); +zp_nthw zp_useres zp_siz zp_utf16enclen(zp_c02 const * str); +zp_nthw zp_useres zp_siz zp_utf16declen(zp_c01 const * str); -zp_nthrw void zp_utf8enc( zp_c8 * dst,zp_c02 const * src); -zp_nthrw void zp_utf8dec( zp_c02 * dst,zp_c8 const * src); -zp_nthrw void zp_utf16enc( zp_c01 * dst,zp_c02 const * src); -zp_nthrw void zp_utf16dec( zp_c02 * dst,zp_c01 const * src); -zp_nthrw void zp_win1252enc(zp_c8 * dst,zp_c02 const * src); -zp_nthrw void zp_win1252dec(zp_c02 * dst,zp_c8 const * src); +zp_nthw void zp_utf8enc( zp_c8 * dst,zp_c02 const * src); +zp_nthw void zp_utf8dec( zp_c02 * dst,zp_c8 const * src); +zp_nthw void zp_utf16enc( zp_c01 * dst,zp_c02 const * src); +zp_nthw void zp_utf16dec( zp_c02 * dst,zp_c01 const * src); +zp_nthw void zp_win1252enc(zp_c8 * dst,zp_c02 const * src); +zp_nthw void zp_win1252dec(zp_c02 * dst,zp_c8 const * src); -zp_nthrw zp_useres zp_siz zp_fmtleni( int val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlenl( long val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlens( short val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlensc( char signed val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlenuc( char unsigned val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlenui( int unsigned val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlenul( long unsigned val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlenus( short unsigned val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtleni( int val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenl( long val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlens( short val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlensc( char signed val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenuc( char unsigned val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenui( int unsigned val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenul( long unsigned val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenus( short unsigned val,zp_i8m bs); #if zp_std_c99 || zp_std_cxx11 -zp_nthrw zp_useres zp_siz zp_fmtlenll( long long val,zp_i8m bs); -zp_nthrw zp_useres zp_siz zp_fmtlenull(long long unsigned val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenll( long long val,zp_i8m bs); +zp_nthw zp_useres zp_siz zp_fmtlenull(long long unsigned val,zp_i8m bs); #endif -zp_nthrw void zp_fmti( zp_c02 * buf,int val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtl( zp_c02 * buf,long val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmts( zp_c02 * buf,short val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtsc( zp_c02 * buf,char signed val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtuc( zp_c02 * buf,char unsigned val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtui( zp_c02 * buf,int unsigned val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtul( zp_c02 * buf,long unsigned val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtus( zp_c02 * buf,short unsigned val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmti( zp_c02 * buf,int val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtl( zp_c02 * buf,long val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmts( zp_c02 * buf,short val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtsc( zp_c02 * buf,char signed val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtuc( zp_c02 * buf,char unsigned val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtui( zp_c02 * buf,int unsigned val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtul( zp_c02 * buf,long unsigned val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtus( zp_c02 * buf,short unsigned val,zp_i8m bs,bool rtl); #if zp_std_c99 || zp_std_cxx11 -zp_nthrw void zp_fmtll( zp_c02 * buf,long long val,zp_i8m bs,bool rtl); -zp_nthrw void zp_fmtull(zp_c02 * buf,long long unsigned val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtll( zp_c02 * buf,long long val,zp_i8m bs,bool rtl); +zp_nthw void zp_fmtull(zp_c02 * buf,long long unsigned val,zp_i8m bs,bool rtl); #endif zp_prv_cdeclend diff --git a/zp/source/any/mem/memcpy.c b/zp/source/any/mem/memcpy.c index 3a20ca1..dbfbebd 100644 --- a/zp/source/any/mem/memcpy.c +++ b/zp/source/any/mem/memcpy.c @@ -6,7 +6,7 @@ #include <zp/mem.h> -zp_nthrw struct zp_cpyres zp_memcpy(void * const dstptr,void const * const srcptr,zp_siz const num) { +zp_nthw struct zp_cpyres zp_memcpy(void * const dstptr,void const * const srcptr,zp_siz const num) { struct zp_cpyres res; char unsigned * dst = dstptr; diff --git a/zp/source/any/mth/abs.cc b/zp/source/any/mth/abs.cc index b60d2b5..55cfe0f 100644 --- a/zp/source/any/mth/abs.cc +++ b/zp/source/any/mth/abs.cc @@ -7,7 +7,7 @@ #include <zp/mth> extern "C" { - zp_nthrw float zp_absf( float const val) {return ::zp::abs(val);} - zp_nthrw double zp_absd( double const val) {return ::zp::abs(val);} - zp_nthrw double long zp_absdl(double long const val) {return ::zp::abs(val);} + zp_nthw float zp_absf( float const val) {return ::zp::abs(val);} + zp_nthw double zp_absd( double const val) {return ::zp::abs(val);} + zp_nthw double long zp_absdl(double long const val) {return ::zp::abs(val);} } diff --git a/zp/source/any/mth/divmod.cc b/zp/source/any/mth/divmod.cc index 9456f0a..ab3621a 100644 --- a/zp/source/any/mth/divmod.cc +++ b/zp/source/any/mth/divmod.cc @@ -7,9 +7,9 @@ #include <zp/mth> extern "C" { - zp_nthrw auto zp_divmodsc(char signed const num,char signed const den) -> ::divmodressc {return ::zp::divmod(num,den).cpair();} - zp_nthrw auto zp_divmods( short const num,short const den) -> ::divmodress {return ::zp::divmod(num,den).cpair();} - zp_nthrw auto zp_divmodi( int const num,int const den) -> ::divmodresi {return ::zp::divmod(num,den).cpair();} - zp_nthrw auto zp_divmodl( long const num,long const den) -> ::divmodresl {return ::zp::divmod(num,den).cpair();} - zp_nthrw auto zp_divmodll(long long const num,long long const den) -> ::divmodresll {return ::zp::divmod(num,den).cpair();} + zp_nthw auto zp_divmodsc(char signed const num,char signed const den) -> ::divmodressc {return ::zp::divmod(num,den).cpair();} + zp_nthw auto zp_divmods( short const num,short const den) -> ::divmodress {return ::zp::divmod(num,den).cpair();} + zp_nthw auto zp_divmodi( int const num,int const den) -> ::divmodresi {return ::zp::divmod(num,den).cpair();} + zp_nthw auto zp_divmodl( long const num,long const den) -> ::divmodresl {return ::zp::divmod(num,den).cpair();} + zp_nthw auto zp_divmodll(long long const num,long long const den) -> ::divmodresll {return ::zp::divmod(num,den).cpair();} } diff --git a/zp/source/any/mth/dot.cc b/zp/source/any/mth/dot.cc index a68bc41..ac58cac 100644 --- a/zp/source/any/mth/dot.cc +++ b/zp/source/any/mth/dot.cc @@ -7,15 +7,15 @@ #include <zp/mth> extern "C" { - zp_nthrw auto zp_dot2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> float {return ::zp::dot(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,});} - zp_nthrw auto zp_dot2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> double {return ::zp::dot(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,});} - zp_nthrw auto zp_dot2dl(::zp_vec2dl const lvec,::zp_vec2dl const rvec) -> double long {return ::zp::dot(::zp::vec2<double long> {lvec.x,lvec.y,},::zp::vec2<double long> {rvec.x,rvec.y,});} + zp_nthw auto zp_dot2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> float {return ::zp::dot(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,});} + zp_nthw auto zp_dot2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> double {return ::zp::dot(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,});} + zp_nthw auto zp_dot2dl(::zp_vec2dl const lvec,::zp_vec2dl const rvec) -> double long {return ::zp::dot(::zp::vec2<double long> {lvec.x,lvec.y,},::zp::vec2<double long> {rvec.x,rvec.y,});} - zp_nthrw auto zp_dot3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> float {return ::zp::dot(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,});} - zp_nthrw auto zp_dot3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> double {return ::zp::dot(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,});} - zp_nthrw auto zp_dot3dl(::zp_vec3dl const lvec,::zp_vec3dl const rvec) -> double long {return ::zp::dot(::zp::vec3<double long> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double long> {rvec.x,rvec.y,rvec.z,});} + zp_nthw auto zp_dot3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> float {return ::zp::dot(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,});} + zp_nthw auto zp_dot3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> double {return ::zp::dot(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,});} + zp_nthw auto zp_dot3dl(::zp_vec3dl const lvec,::zp_vec3dl const rvec) -> double long {return ::zp::dot(::zp::vec3<double long> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double long> {rvec.x,rvec.y,rvec.z,});} - zp_nthrw auto zp_dot4f( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> float {return ::zp::dot(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,});} - zp_nthrw auto zp_dot4d( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> double {return ::zp::dot(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,});} - zp_nthrw auto zp_dot4dl(::zp_vec4dl const lvec,::zp_vec4dl const rvec) -> double long {return ::zp::dot(::zp::vec4<double long> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double long> {rvec.x,rvec.y,rvec.z,rvec.w,});} + zp_nthw auto zp_dot4f( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> float {return ::zp::dot(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,});} + zp_nthw auto zp_dot4d( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> double {return ::zp::dot(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,});} + zp_nthw auto zp_dot4dl(::zp_vec4dl const lvec,::zp_vec4dl const rvec) -> double long {return ::zp::dot(::zp::vec4<double long> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double long> {rvec.x,rvec.y,rvec.z,rvec.w,});} } diff --git a/zp/source/any/mth/vadd.cc b/zp/source/any/mth/vadd.cc index afc2005..31c3dc3 100644 --- a/zp/source/any/mth/vadd.cc +++ b/zp/source/any/mth/vadd.cc @@ -7,15 +7,15 @@ #include <zp/mth> extern "C" { - zp_nthrw auto zp_vadd2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vadd(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();} - zp_nthrw auto zp_vadd2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vadd(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();} - zp_nthrw auto zp_vadd2dl(::zp_vec2dl const lvec,::zp_vec2dl const rvec) -> ::zp_vec2dl {return ::zp::vadd(::zp::vec2<double long> {lvec.x,lvec.y,},::zp::vec2<double long> {rvec.x,rvec.y,}).cvec();} + zp_nthw auto zp_vadd2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vadd(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();} + zp_nthw auto zp_vadd2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vadd(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();} + zp_nthw auto zp_vadd2dl(::zp_vec2dl const lvec,::zp_vec2dl const rvec) -> ::zp_vec2dl {return ::zp::vadd(::zp::vec2<double long> {lvec.x,lvec.y,},::zp::vec2<double long> {rvec.x,rvec.y,}).cvec();} - zp_nthrw auto zp_vadd3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vadd(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();} - zp_nthrw auto zp_vadd3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vadd(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();} - zp_nthrw auto zp_vadd3dl(::zp_vec3dl const lvec,::zp_vec3dl const rvec) -> ::zp_vec3dl {return ::zp::vadd(::zp::vec3<double long> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double long> {rvec.x,rvec.y,rvec.z,}).cvec();} + zp_nthw auto zp_vadd3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vadd(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();} + zp_nthw auto zp_vadd3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vadd(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();} + zp_nthw auto zp_vadd3dl(::zp_vec3dl const lvec,::zp_vec3dl const rvec) -> ::zp_vec3dl {return ::zp::vadd(::zp::vec3<double long> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double long> {rvec.x,rvec.y,rvec.z,}).cvec();} - zp_nthrw auto zp_v4addf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vadd(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} - zp_nthrw auto zp_v4addd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vadd(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} - zp_nthrw auto zp_v4adddl(::zp_vec4dl const lvec,::zp_vec4dl const rvec) -> ::zp_vec4dl {return ::zp::vadd(::zp::vec4<double long> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double long> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} + zp_nthw auto zp_v4addf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vadd(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} + zp_nthw auto zp_v4addd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vadd(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} + zp_nthw auto zp_v4adddl(::zp_vec4dl const lvec,::zp_vec4dl const rvec) -> ::zp_vec4dl {return ::zp::vadd(::zp::vec4<double long> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double long> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} } diff --git a/zp/source/any/mth/vsub.cc b/zp/source/any/mth/vsub.cc index 2c5c8e2..feac3e6 100644 --- a/zp/source/any/mth/vsub.cc +++ b/zp/source/any/mth/vsub.cc @@ -7,15 +7,15 @@ #include <zp/mth> extern "C" { - zp_nthrw auto zp_vsub2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vsub(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();} - zp_nthrw auto zp_vsub2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vsub(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();} - zp_nthrw auto zp_vsub2dl(::zp_vec2dl const lvec,::zp_vec2dl const rvec) -> ::zp_vec2dl {return ::zp::vsub(::zp::vec2<double long> {lvec.x,lvec.y,},::zp::vec2<double long> {rvec.x,rvec.y,}).cvec();} + zp_nthw auto zp_vsub2f( ::zp_vec2f const lvec,::zp_vec2f const rvec) -> ::zp_vec2f {return ::zp::vsub(::zp::vec2<float> {lvec.x,lvec.y,},::zp::vec2<float> {rvec.x,rvec.y,}).cvec();} + zp_nthw auto zp_vsub2d( ::zp_vec2d const lvec,::zp_vec2d const rvec) -> ::zp_vec2d {return ::zp::vsub(::zp::vec2<double> {lvec.x,lvec.y,},::zp::vec2<double> {rvec.x,rvec.y,}).cvec();} + zp_nthw auto zp_vsub2dl(::zp_vec2dl const lvec,::zp_vec2dl const rvec) -> ::zp_vec2dl {return ::zp::vsub(::zp::vec2<double long> {lvec.x,lvec.y,},::zp::vec2<double long> {rvec.x,rvec.y,}).cvec();} - zp_nthrw auto zp_vsub3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vsub(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();} - zp_nthrw auto zp_vsub3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vsub(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();} - zp_nthrw auto zp_vsub3dl(::zp_vec3dl const lvec,::zp_vec3dl const rvec) -> ::zp_vec3dl {return ::zp::vsub(::zp::vec3<double long> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double long> {rvec.x,rvec.y,rvec.z,}).cvec();} + zp_nthw auto zp_vsub3f( ::zp_vec3f const lvec,::zp_vec3f const rvec) -> ::zp_vec3f {return ::zp::vsub(::zp::vec3<float> {lvec.x,lvec.y,lvec.z,},::zp::vec3<float> {rvec.x,rvec.y,rvec.z,}).cvec();} + zp_nthw auto zp_vsub3d( ::zp_vec3d const lvec,::zp_vec3d const rvec) -> ::zp_vec3d {return ::zp::vsub(::zp::vec3<double> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double> {rvec.x,rvec.y,rvec.z,}).cvec();} + zp_nthw auto zp_vsub3dl(::zp_vec3dl const lvec,::zp_vec3dl const rvec) -> ::zp_vec3dl {return ::zp::vsub(::zp::vec3<double long> {lvec.x,lvec.y,lvec.z,},::zp::vec3<double long> {rvec.x,rvec.y,rvec.z,}).cvec();} - zp_nthrw auto zp_v4subf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vsub(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} - zp_nthrw auto zp_v4subd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vsub(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} - zp_nthrw auto zp_v4subdl(::zp_vec4dl const lvec,::zp_vec4dl const rvec) -> ::zp_vec4dl {return ::zp::vsub(::zp::vec4<double long> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double long> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} + zp_nthw auto zp_v4subf( ::zp_vec4f const lvec,::zp_vec4f const rvec) -> ::zp_vec4f {return ::zp::vsub(::zp::vec4<float> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<float> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} + zp_nthw auto zp_v4subd( ::zp_vec4d const lvec,::zp_vec4d const rvec) -> ::zp_vec4d {return ::zp::vsub(::zp::vec4<double> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} + zp_nthw auto zp_v4subdl(::zp_vec4dl const lvec,::zp_vec4dl const rvec) -> ::zp_vec4dl {return ::zp::vsub(::zp::vec4<double long> {lvec.x,lvec.y,lvec.z,lvec.w,},::zp::vec4<double long> {rvec.x,rvec.y,rvec.z,rvec.w,}).cvec();} } diff --git a/zp/source/any/str/fmt.cc b/zp/source/any/str/fmt.cc index 46583c6..8abe76f 100644 --- a/zp/source/any/str/fmt.cc +++ b/zp/source/any/str/fmt.cc @@ -7,14 +7,14 @@ #include <zp/str> /*extern "C" { - zp_nthrw auto zp_fmti( char32_t * const buf,int const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtl( char32_t * const buf,long const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtll( char32_t * const buf,long long const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmts( char32_t * const buf,short const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtsc( char32_t * const buf,char signed const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtuc( char32_t * const buf,char unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtui( char32_t * const buf,int unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtul( char32_t * const buf,long unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtull(char32_t * const buf,long long unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} - zp_nthrw auto zp_fmtus( char32_t * const buf,short unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmti( char32_t * const buf,int const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtl( char32_t * const buf,long const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtll( char32_t * const buf,long long const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmts( char32_t * const buf,short const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtsc( char32_t * const buf,char signed const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtuc( char32_t * const buf,char unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtui( char32_t * const buf,int unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtul( char32_t * const buf,long unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtull(char32_t * const buf,long long unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} + zp_nthw auto zp_fmtus( char32_t * const buf,short unsigned const val,::zp::i8m const bs,bool const rtl) -> void {return ::zp::fmt(buf,val,bs,rtl);} }*/ diff --git a/zp/source/any/str/fmtlen.cc b/zp/source/any/str/fmtlen.cc index 4306877..f95b2a8 100644 --- a/zp/source/any/str/fmtlen.cc +++ b/zp/source/any/str/fmtlen.cc @@ -8,14 +8,14 @@ #include <zp/str> /* extern "C" { - zp_nthrw auto zp_fmtleni( int const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenl( long const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenll( long long const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlens( short const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlensc( char signed const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenuc( char unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenui( int unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenul( long unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenull(long long unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} - zp_nthrw auto zp_fmtlenus( short unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtleni( int const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenl( long const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenll( long long const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlens( short const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlensc( char signed const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenuc( char unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenui( int unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenul( long unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenull(long long unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} + zp_nthw auto zp_fmtlenus( short unsigned const val,::zp::i8m const bs) -> ::zp::siz {return ::zp::fmtlen(val,bs);} } */ diff --git a/zp/source/any/str/strcpy.cc b/zp/source/any/str/strcpy.cc index ca23353..bcd4583 100644 --- a/zp/source/any/str/strcpy.cc +++ b/zp/source/any/str/strcpy.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::siz zp_strcpy(char * const dst,char const * const src) { +extern "C" zp_nthw ::zp::siz zp_strcpy(char * const dst,char const * const src) { return ::zp::det::strcpy(dst,src); } diff --git a/zp/source/any/str/strequ.cc b/zp/source/any/str/strequ.cc index df28a58..2bc3b85 100644 --- a/zp/source/any/str/strequ.cc +++ b/zp/source/any/str/strequ.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw bool zp_strequ(char const * const lstr,char const * const rstr) { +extern "C" zp_nthw bool zp_strequ(char const * const lstr,char const * const rstr) { return ::zp::det::strequ(lstr,rstr); } diff --git a/zp/source/any/str/strfil.cc b/zp/source/any/str/strfil.cc index 39b2a5e..a456d14 100644 --- a/zp/source/any/str/strfil.cc +++ b/zp/source/any/str/strfil.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw bool zp_strfil(char * const str,char const chr) { +extern "C" zp_nthw bool zp_strfil(char * const str,char const chr) { return ::zp::det::strfil(str,chr); } diff --git a/zp/source/any/str/strlen.cc b/zp/source/any/str/strlen.cc index 074cb4b..6a9a0a8 100644 --- a/zp/source/any/str/strlen.cc +++ b/zp/source/any/str/strlen.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::siz zp_strlen(char const * const str) { +extern "C" zp_nthw ::zp::siz zp_strlen(char const * const str) { return ::zp::det::strlen(str); } diff --git a/zp/source/any/str/strsrh.cc b/zp/source/any/str/strsrh.cc index 8902cf4..a3f99dd 100644 --- a/zp/source/any/str/strsrh.cc +++ b/zp/source/any/str/strsrh.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw char * zp_strsrh(char const * const str,char const chr) { +extern "C" zp_nthw char * zp_strsrh(char const * const str,char const chr) { return ::zp::det::strsrh(str,chr); } diff --git a/zp/source/any/str/utf32cpy.cc b/zp/source/any/str/utf32cpy.cc index 57836cb..630b539 100644 --- a/zp/source/any/str/utf32cpy.cc +++ b/zp/source/any/str/utf32cpy.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::siz zp_utf32cpy(::zp::c02 * const dst,::zp::c02 const * const src) { +extern "C" zp_nthw ::zp::siz zp_utf32cpy(::zp::c02 * const dst,::zp::c02 const * const src) { return ::zp::det::strcpy(dst,src); } diff --git a/zp/source/any/str/utf32equ.cc b/zp/source/any/str/utf32equ.cc index a7b1d39..483d1a8 100644 --- a/zp/source/any/str/utf32equ.cc +++ b/zp/source/any/str/utf32equ.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw bool zp_utf32equ(::zp::c02 const * const lstr,::zp::c02 const * const rstr) { +extern "C" zp_nthw bool zp_utf32equ(::zp::c02 const * const lstr,::zp::c02 const * const rstr) { return ::zp::det::strequ(lstr,rstr); } diff --git a/zp/source/any/str/utf32fil.cc b/zp/source/any/str/utf32fil.cc index 4a99e2e..7760ebc 100644 --- a/zp/source/any/str/utf32fil.cc +++ b/zp/source/any/str/utf32fil.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw bool zp_utf32fil(::zp::c02 * const str,::zp::c02 const chr) { +extern "C" zp_nthw bool zp_utf32fil(::zp::c02 * const str,::zp::c02 const chr) { return ::zp::det::strfil(str,chr); } diff --git a/zp/source/any/str/utf32len.cc b/zp/source/any/str/utf32len.cc index c79bb10..7847f74 100644 --- a/zp/source/any/str/utf32len.cc +++ b/zp/source/any/str/utf32len.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::siz zp_utf32len(::zp::c02 const * const str) { +extern "C" zp_nthw ::zp::siz zp_utf32len(::zp::c02 const * const str) { return ::zp::det::strlen(str); } diff --git a/zp/source/any/str/utf32srh.cc b/zp/source/any/str/utf32srh.cc index 5beaea5..31bda0c 100644 --- a/zp/source/any/str/utf32srh.cc +++ b/zp/source/any/str/utf32srh.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::c02 * zp_utf32srh(::zp::c02 const * const str,::zp::c02 const chr) { +extern "C" zp_nthw ::zp::c02 * zp_utf32srh(::zp::c02 const * const str,::zp::c02 const chr) { return ::zp::det::strsrh(str,chr); } diff --git a/zp/source/any/str/wstrcpy.cc b/zp/source/any/str/wstrcpy.cc index 8b5949d..9d17061 100644 --- a/zp/source/any/str/wstrcpy.cc +++ b/zp/source/any/str/wstrcpy.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::siz zp_wstrcpy(::zp::wchr * const dst,::zp::wchr const * const src) { +extern "C" zp_nthw ::zp::siz zp_wstrcpy(::zp::wchr * const dst,::zp::wchr const * const src) { return ::zp::det::strcpy(dst,src); } diff --git a/zp/source/any/str/wstrequ.cc b/zp/source/any/str/wstrequ.cc index 23d1cbb..9d3c90b 100644 --- a/zp/source/any/str/wstrequ.cc +++ b/zp/source/any/str/wstrequ.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw bool zp_wstrequ(::zp::wchr const * const lstr,::zp::wchr const * const rstr) { +extern "C" zp_nthw bool zp_wstrequ(::zp::wchr const * const lstr,::zp::wchr const * const rstr) { return ::zp::det::strequ(lstr,rstr);; } diff --git a/zp/source/any/str/wstrfil.cc b/zp/source/any/str/wstrfil.cc index e1d3728..1c8172c 100644 --- a/zp/source/any/str/wstrfil.cc +++ b/zp/source/any/str/wstrfil.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw bool zp_wstrfil(::zp::wchr * const str,::zp::wchr const chr) { +extern "C" zp_nthw bool zp_wstrfil(::zp::wchr * const str,::zp::wchr const chr) { return ::zp::det::strfil(str,chr); } diff --git a/zp/source/any/str/wstrlen.cc b/zp/source/any/str/wstrlen.cc index f2ef808..9aed25f 100644 --- a/zp/source/any/str/wstrlen.cc +++ b/zp/source/any/str/wstrlen.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::siz zp_wstrlen(::zp::wchr const * const str) { +extern "C" zp_nthw ::zp::siz zp_wstrlen(::zp::wchr const * const str) { return ::zp::det::strlen(str); } diff --git a/zp/source/any/str/wstrsrh.cc b/zp/source/any/str/wstrsrh.cc index e0df52e..1076d9b 100644 --- a/zp/source/any/str/wstrsrh.cc +++ b/zp/source/any/str/wstrsrh.cc @@ -6,6 +6,6 @@ #include <zp/prv> -extern "C" zp_nthrw ::zp::wchr * zp_wstrsrh(::zp::wchr const * const str,::zp::wchr const chr) { +extern "C" zp_nthw ::zp::wchr * zp_wstrsrh(::zp::wchr const * const str,::zp::wchr const chr) { return ::zp::det::strsrh(str,chr); } |