diff --git a/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj b/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj index 7382788..ee1f011 100644 --- a/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj +++ b/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj @@ -789,6 +789,7 @@ + @@ -1340,6 +1341,7 @@ + diff --git a/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj.filters b/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj.filters index b093eb8..8c07b91 100644 --- a/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj.filters +++ b/mk_clib/projects/vs2022/mk_clib_slib/mk_clib_slib.vcxproj.filters @@ -752,6 +752,7 @@ src src src + src src src src @@ -1303,6 +1304,7 @@ src src src + src src src src diff --git a/mk_clib/src/mk_clib_fuzz.c b/mk_clib/src/mk_clib_fuzz.c index 680096e..d3e6312 100644 --- a/mk_clib/src/mk_clib_fuzz.c +++ b/mk_clib/src/mk_clib_fuzz.c @@ -18,6 +18,7 @@ #include "mk_lib_crypto_xof_stream_shake_128_fuzz.h" #include "mk_lib_crypto_xof_stream_shake_256_fuzz.h" #include "mk_lib_fmt_fuzz.h" +#include "mk_sl_cui_fuzz.h" #include "mk_sl_sort_merge_fuzz.h" #if defined mk_clib_test_smol_want && mk_clib_test_smol_want == 1 @@ -40,6 +41,7 @@ mk_lang_constexpr mk_lang_jumbo void mk_clib_fuzz(unsigned char const* const dat mk_lib_crypto_xof_stream_shake_128_fuzz(data, size); mk_lib_crypto_xof_stream_shake_256_fuzz(data, size); mk_lib_fmt_fuzz(data, size); + mk_sl_cui_fuzz(data, size); mk_sl_sort_merge_fuzz(data, size); #if(!(defined __GNUC__ && defined __GNUC_MINOR__)) diff --git a/mk_clib/src/mk_clib_fuzz_constexpr.c b/mk_clib/src/mk_clib_fuzz_constexpr.c index 7ec99c3..295cef2 100644 --- a/mk_clib/src/mk_clib_fuzz_constexpr.c +++ b/mk_clib/src/mk_clib_fuzz_constexpr.c @@ -13,6 +13,7 @@ #include "mk_sl_uint8.h" #include "mk_lang_bui_fuzz.h" +#include "mk_sl_cui_fuzz.h" mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_clib_fuzz_constexpr_append_file(mk_lib_crypto_xof_stream_shake_128_pt const shaker, mk_lang_types_pchar_pct const file) mk_lang_noexcept @@ -107,6 +108,7 @@ mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_clib_fuzz_conste mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_clib_fuzz_constexpr_impl(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept { mk_lang_bui_fuzz(data, size); + mk_sl_cui_fuzz(data, size); } mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_clib_fuzz_constexpr_test_nth_block(mk_lang_types_sint_t const nth) mk_lang_noexcept diff --git a/mk_clib/src/mk_sl_cui_fuzz.c b/mk_clib/src/mk_sl_cui_fuzz.c new file mode 100644 index 0000000..15ae154 --- /dev/null +++ b/mk_clib/src/mk_sl_cui_fuzz.c @@ -0,0 +1,1162 @@ +#include "mk_sl_cui_fuzz.h" + +#include "mk_lang_assert.h" +#include "mk_lang_constexpr.h" +#include "mk_lang_countof.h" +#include "mk_lang_inline.h" +#include "mk_lang_jumbo.h" +#include "mk_lang_noexcept.h" +#include "mk_lang_sizeof.h" +#include "mk_lang_static_assert.h" +#include "mk_lang_string.h" +#include "mk_lang_test.h" +#include "mk_lang_types.h" +#include "mk_lang_version.h" + + +#define mk_lang_bui_t_name mk_sl_cui_fuzz_zzz_buiuc +#define mk_lang_bui_t_base uchar +#define mk_lang_bui_t_inline 0 +#include "mk_lang_bui_inl_fileh.h" +#include "mk_lang_bui_inl_filec.h" +#define mk_sl_cui_fuzz_zzz_buiuc_sizebits_d (mk_lang_sizeof_bi_uchar_t * mk_lang_charbit) + +#define mk_lang_bui_t_name mk_sl_cui_fuzz_zzz_buius +#define mk_lang_bui_t_base ushort +#define mk_lang_bui_t_inline 0 +#include "mk_lang_bui_inl_fileh.h" +#include "mk_lang_bui_inl_filec.h" +#define mk_sl_cui_fuzz_zzz_buius_sizebits_d (mk_lang_sizeof_bi_ushort_t * mk_lang_charbit) + +#define mk_lang_bui_t_name mk_sl_cui_fuzz_zzz_buiui +#define mk_lang_bui_t_base uint +#define mk_lang_bui_t_inline 0 +#include "mk_lang_bui_inl_fileh.h" +#include "mk_lang_bui_inl_filec.h" +#define mk_sl_cui_fuzz_zzz_buiui_sizebits_d (mk_lang_sizeof_bi_uint_t * mk_lang_charbit) + +#define mk_sl_cui_t_name mk_sl_cui_fuzz_zzz_cuia +#define mk_sl_cui_t_base mk_sl_cui_fuzz_zzz_buiuc +#define mk_sl_cui_t_count (mk_sl_cui_fuzz_zzz_buiui_sizebits_d / mk_sl_cui_fuzz_zzz_buiuc_sizebits_d) +#define mk_sl_cui_t_base_sizebits_d mk_sl_cui_fuzz_zzz_buiuc_sizebits_d +#define mk_sl_cui_t_str_style 1001 +#define mk_sl_cui_t_inline 0 +#include "mk_sl_cui_inl_fileh.h" +#include "mk_sl_cui_inl_filec.h" + +#define mk_sl_cui_t_name mk_sl_cui_fuzz_zzz_cuib +#define mk_sl_cui_t_base mk_sl_cui_fuzz_zzz_buiuc +#define mk_sl_cui_t_count (mk_sl_cui_fuzz_zzz_buiui_sizebits_d / mk_sl_cui_fuzz_zzz_buiuc_sizebits_d) +#define mk_sl_cui_t_base_sizebits_d mk_sl_cui_fuzz_zzz_buiuc_sizebits_d +#define mk_sl_cui_t_str_style 1003 +#define mk_sl_cui_t_inline 0 +#include "mk_sl_cui_inl_fileh.h" +#include "mk_sl_cui_inl_filec.h" + +#define mk_sl_cui_t_name mk_sl_cui_fuzz_zzz_cuic +#define mk_sl_cui_t_base mk_sl_cui_fuzz_zzz_buius +#define mk_sl_cui_t_count (mk_sl_cui_fuzz_zzz_buiui_sizebits_d / mk_sl_cui_fuzz_zzz_buius_sizebits_d) +#define mk_sl_cui_t_base_sizebits_d mk_sl_cui_fuzz_zzz_buius_sizebits_d +#define mk_sl_cui_t_str_style 1001 +#define mk_sl_cui_t_inline 0 +#include "mk_sl_cui_inl_fileh.h" +#include "mk_sl_cui_inl_filec.h" + +#define mk_sl_cui_t_name mk_sl_cui_fuzz_zzz_cuid +#define mk_sl_cui_t_base mk_sl_cui_fuzz_zzz_buius +#define mk_sl_cui_t_count (mk_sl_cui_fuzz_zzz_buiui_sizebits_d / mk_sl_cui_fuzz_zzz_buius_sizebits_d) +#define mk_sl_cui_t_base_sizebits_d mk_sl_cui_fuzz_zzz_buius_sizebits_d +#define mk_sl_cui_t_str_style 1003 +#define mk_sl_cui_t_inline 0 +#include "mk_sl_cui_inl_fileh.h" +#include "mk_sl_cui_inl_filec.h" + + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_bin_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_pchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenbin_v]; + mk_lang_types_pchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenbin_v]; + mk_lang_types_pchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenbin_v]; + mk_lang_types_pchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenbin_v]; + mk_lang_types_pchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenbin_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_bin_n(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_bin_n(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_bin_n(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_bin_n(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_bin_n(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_bin_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_wchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenbin_v]; + mk_lang_types_wchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenbin_v]; + mk_lang_types_wchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenbin_v]; + mk_lang_types_wchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenbin_v]; + mk_lang_types_wchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenbin_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_bin_w(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_bin_w(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_bin_w(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_bin_w(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_bin_w(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_bin_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_pchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlenbin_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_pchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_bin_n(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_bin_n(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_bin_n(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_bin_n(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_bin_n(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_bin_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_wchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlenbin_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_wchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_bin_w(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_bin_w(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_bin_w(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_bin_w(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_bin_w(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_oct_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_pchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenoct_v]; + mk_lang_types_pchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenoct_v]; + mk_lang_types_pchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenoct_v]; + mk_lang_types_pchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenoct_v]; + mk_lang_types_pchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenoct_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_oct_n(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_oct_n(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_oct_n(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_oct_n(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_oct_n(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_oct_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_wchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenoct_v]; + mk_lang_types_wchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenoct_v]; + mk_lang_types_wchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenoct_v]; + mk_lang_types_wchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenoct_v]; + mk_lang_types_wchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenoct_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_oct_w(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_oct_w(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_oct_w(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_oct_w(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_oct_w(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_oct_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_pchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlenoct_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_pchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_oct_n(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_oct_n(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_oct_n(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_oct_n(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_oct_n(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_oct_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_wchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlenoct_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_wchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_oct_w(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_oct_w(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_oct_w(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_oct_w(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_oct_w(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_dec_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_pchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlendec_v]; + mk_lang_types_pchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlendec_v]; + mk_lang_types_pchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlendec_v]; + mk_lang_types_pchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlendec_v]; + mk_lang_types_pchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlendec_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_dec_n(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_dec_n(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_dec_n(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_dec_n(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_dec_n(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_dec_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_wchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlendec_v]; + mk_lang_types_wchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlendec_v]; + mk_lang_types_wchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlendec_v]; + mk_lang_types_wchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlendec_v]; + mk_lang_types_wchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlendec_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_dec_w(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_dec_w(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_dec_w(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_dec_w(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_dec_w(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_dec_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_pchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlendec_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_pchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_dec_n(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_dec_n(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_dec_n(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_dec_n(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_dec_n(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_dec_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_wchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlendec_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_wchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_dec_w(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_dec_w(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_dec_w(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_dec_w(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_dec_w(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_hex_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_pchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenhex_v]; + mk_lang_types_pchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenhex_v]; + mk_lang_types_pchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenhex_v]; + mk_lang_types_pchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenhex_v]; + mk_lang_types_pchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenhex_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_hex_n(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_hex_n(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_hex_n(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_hex_n(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_hex_n(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_hex_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_wchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenhex_v]; + mk_lang_types_wchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenhex_v]; + mk_lang_types_wchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenhex_v]; + mk_lang_types_wchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenhex_v]; + mk_lang_types_wchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenhex_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_hex_w(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_hex_w(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_hex_w(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_hex_w(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_hex_w(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_hex_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_pchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlenhex_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_pchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_hex_n(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_hex_n(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_hex_n(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_hex_n(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_hex_n(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_from_str_hex_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_lang_types_wchar_t str[4 * mk_sl_cui_fuzz_zzz_buiui_strlenhex_v] mk_lang_constexpr_init; + mk_lang_types_sint_t sz mk_lang_constexpr_init; + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_buiui_t tui mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + + if(!(size >= 0 && size <= mk_lang_countof(str))) + { + return; + } + sz = ((mk_lang_types_sint_t)(size)); + for(i = 0; i != sz; ++i) + { + str[i] = ((mk_lang_types_wchar_t)(data[i])); + } + len_buiui = mk_sl_cui_fuzz_zzz_buiui_from_str_hex_w(&buiui, &str[0], sz); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_from_str_hex_w(&cuia, &str[0], sz); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_from_str_hex_w(&cuib, &str[0], sz); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_from_str_hex_w(&cuic, &str[0], sz); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_from_str_hex_w(&cuid, &str[0], sz); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + if(len_buiui >= 1) + { + mk_sl_cui_fuzz_zzz_cuia_to_bi_uint(&cuia, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuib_to_bi_uint(&cuib, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuic_to_bi_uint(&cuic, &tui); mk_lang_test(tui == buiui); + mk_sl_cui_fuzz_zzz_cuid_to_bi_uint(&cuid, &tui); mk_lang_test(tui == buiui); + } +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_binf_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_pchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenbin_v]; + mk_lang_types_pchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenbin_v]; + mk_lang_types_pchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenbin_v]; + mk_lang_types_pchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenbin_v]; + mk_lang_types_pchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenbin_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_binf_n(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_binf_n(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_binf_n(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_binf_n(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_binf_n(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_binf_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_wchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenbin_v]; + mk_lang_types_wchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenbin_v]; + mk_lang_types_wchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenbin_v]; + mk_lang_types_wchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenbin_v]; + mk_lang_types_wchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenbin_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_binf_w(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_binf_w(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_binf_w(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_binf_w(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_binf_w(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_hexf_n(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_pchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenhex_v]; + mk_lang_types_pchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenhex_v]; + mk_lang_types_pchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenhex_v]; + mk_lang_types_pchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenhex_v]; + mk_lang_types_pchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenhex_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_hexf_n(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_hexf_n(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_hexf_n(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_hexf_n(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_hexf_n(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_pc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + +mk_lang_constexpr static mk_lang_inline mk_lang_types_void_t mk_sl_cui_fuzz_to_str_hexf_w(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_zzz_buiui_t buiui mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuia_t cuia mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuib_t cuib mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuic_t cuic mk_lang_constexpr_init; + mk_sl_cui_fuzz_zzz_cuid_t cuid mk_lang_constexpr_init; + mk_lang_types_wchar_t str_buiui[mk_sl_cui_fuzz_zzz_buiui_strlenhex_v]; + mk_lang_types_wchar_t str_cuia[mk_sl_cui_fuzz_zzz_cuia_strlenhex_v]; + mk_lang_types_wchar_t str_cuib[mk_sl_cui_fuzz_zzz_cuib_strlenhex_v]; + mk_lang_types_wchar_t str_cuic[mk_sl_cui_fuzz_zzz_cuic_strlenhex_v]; + mk_lang_types_wchar_t str_cuid[mk_sl_cui_fuzz_zzz_cuid_strlenhex_v]; + mk_lang_types_sint_t len_buiui mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuia mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuib mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuic mk_lang_constexpr_init; + mk_lang_types_sint_t len_cuid mk_lang_constexpr_init; + + mk_lang_assert(data || size == 0); + mk_lang_assert(size >= 0); + + mk_lang_static_assert(sizeof(cuia) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuib) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuic) == sizeof(buiui)); + mk_lang_static_assert(sizeof(cuid) == sizeof(buiui)); + mk_lang_static_assert(sizeof(str_cuia) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuib) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuic) == sizeof(str_buiui)); + mk_lang_static_assert(sizeof(str_cuid) == sizeof(str_buiui)); + + if(!(size == sizeof(buiui))) + { + return; + } + mk_sl_cui_fuzz_zzz_buiui_from_buis_uchar_le(&buiui, &data[0]); + mk_sl_cui_fuzz_zzz_cuia_from_buis_uchar_le(&cuia, &data[0]); + mk_sl_cui_fuzz_zzz_cuib_from_buis_uchar_le(&cuib, &data[0]); + mk_sl_cui_fuzz_zzz_cuic_from_buis_uchar_le(&cuic, &data[0]); + mk_sl_cui_fuzz_zzz_cuid_from_buis_uchar_le(&cuid, &data[0]); + len_buiui = mk_sl_cui_fuzz_zzz_buiui_to_str_hexf_w(&buiui, &str_buiui[0], mk_lang_countof(str_buiui)); + len_cuia = mk_sl_cui_fuzz_zzz_cuia_to_str_hexf_w(&cuia, &str_cuia[0], mk_lang_countof(str_cuia)); + len_cuib = mk_sl_cui_fuzz_zzz_cuib_to_str_hexf_w(&cuib, &str_cuib[0], mk_lang_countof(str_cuib)); + len_cuic = mk_sl_cui_fuzz_zzz_cuic_to_str_hexf_w(&cuic, &str_cuic[0], mk_lang_countof(str_cuic)); + len_cuid = mk_sl_cui_fuzz_zzz_cuid_to_str_hexf_w(&cuid, &str_cuid[0], mk_lang_countof(str_cuid)); + mk_lang_test(len_cuia == len_buiui); + mk_lang_test(len_cuib == len_buiui); + mk_lang_test(len_cuic == len_buiui); + mk_lang_test(len_cuid == len_buiui); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuia[0], &str_buiui[0], len_cuia) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuib[0], &str_buiui[0], len_cuib) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuic[0], &str_buiui[0], len_cuic) == 0); + mk_lang_test(mk_lang_string_memcmp_wc_fn(&str_cuid[0], &str_buiui[0], len_cuid) == 0); +} + + +mk_lang_constexpr mk_lang_jumbo mk_lang_types_void_t mk_sl_cui_fuzz(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept +{ + mk_sl_cui_fuzz_to_str_bin_n(data, size); + mk_sl_cui_fuzz_to_str_bin_w(data, size); + mk_sl_cui_fuzz_from_str_bin_n(data, size); + mk_sl_cui_fuzz_from_str_bin_w(data, size); + mk_sl_cui_fuzz_to_str_oct_n(data, size); + mk_sl_cui_fuzz_to_str_oct_w(data, size); + mk_sl_cui_fuzz_from_str_oct_n(data, size); + mk_sl_cui_fuzz_from_str_oct_w(data, size); + mk_sl_cui_fuzz_to_str_dec_n(data, size); + mk_sl_cui_fuzz_to_str_dec_w(data, size); + mk_sl_cui_fuzz_from_str_dec_n(data, size); + mk_sl_cui_fuzz_from_str_dec_w(data, size); + mk_sl_cui_fuzz_to_str_hex_n(data, size); + mk_sl_cui_fuzz_to_str_hex_w(data, size); + mk_sl_cui_fuzz_from_str_hex_n(data, size); + mk_sl_cui_fuzz_from_str_hex_w(data, size); + mk_sl_cui_fuzz_to_str_binf_n(data, size); + mk_sl_cui_fuzz_to_str_binf_w(data, size); + mk_sl_cui_fuzz_to_str_hexf_n(data, size); + mk_sl_cui_fuzz_to_str_hexf_w(data, size); +} diff --git a/mk_clib/src/mk_sl_cui_fuzz.h b/mk_clib/src/mk_sl_cui_fuzz.h new file mode 100644 index 0000000..06517fb --- /dev/null +++ b/mk_clib/src/mk_sl_cui_fuzz.h @@ -0,0 +1,17 @@ +#ifndef mk_include_guard_mk_sl_cui_fuzz +#define mk_include_guard_mk_sl_cui_fuzz + + +#include "mk_lang_constexpr.h" +#include "mk_lang_jumbo.h" +#include "mk_lang_noexcept.h" +#include "mk_lang_types.h" + + +mk_lang_constexpr mk_lang_jumbo mk_lang_types_void_t mk_sl_cui_fuzz(mk_lang_types_uchar_pct const data, mk_lang_types_usize_t const size) mk_lang_noexcept; + + +#if mk_lang_jumbo_want == 1 +#include "mk_sl_cui_fuzz.c" +#endif +#endif diff --git a/mk_clib/src/mk_sl_cui_inl_defd.h.m4 b/mk_clib/src/mk_sl_cui_inl_defd.h.m4 index 63f49bb..4ae8da2 100644 --- a/mk_clib/src/mk_sl_cui_inl_defd.h.m4 +++ b/mk_clib/src/mk_sl_cui_inl_defd.h.m4 @@ -12,6 +12,7 @@ include(`mk_sl_cui_inl.m')dnl ((defined mk_sl_cui_t_endian && (mk_sl_cui_t_endian == mk_lang_endian_little || mk_sl_cui_t_endian == mk_lang_endian_big)) || !defined mk_sl_cui_t_endian) && \ ((defined mk_sl_cui_t_disable_big_div && (mk_sl_cui_t_disable_big_div == 0 || mk_sl_cui_t_disable_big_div == 1)) || !defined mk_sl_cui_t_disable_big_div) && \ ((defined mk_sl_cui_t_base_sizebits_d && mk_sl_cui_t_base_sizebits_d >= 1) || !defined mk_sl_cui_t_base_sizebits_d) && \ + ((defined mk_sl_cui_t_str_style && ((mk_sl_cui_t_str_style) == 1001 || (mk_sl_cui_t_str_style) == 1002 || (mk_sl_cui_t_str_style) == 1003)) || !defined mk_sl_cui_t_str_style) && \ ((defined mk_sl_cui_t_inline && ((mk_sl_cui_t_inline) == 0 || (mk_sl_cui_t_inline) == 1)) || !defined mk_sl_cui_t_inline) && \ 1)) #error xxxxxxxxxx @@ -34,6 +35,16 @@ include(`mk_sl_cui_inl.m')dnl #define mk_sl_cui_inl_defd_inline 0 #endif +/* + 1001 - table + 1002 - ascii / ebcdic offset + 1003 - offset if possible, table otherwise +*/ +#if defined mk_sl_cui_t_str_style +#define mk_sl_cui_inl_defd_str_style (mk_sl_cui_t_str_style) +#else +#define mk_sl_cui_inl_defd_str_style 1003 +#endif #if mk_sl_cui_inl_defd_inline #define mk_sl_cui_inl_defd_flatten mk_lang_attribute_msvc_flatten @@ -154,11 +165,32 @@ mm_per_bui(`#define mk_sl_cui_inl_defd_base_to_buis_$1_be mk_lang_concat(mk_sl_c #define mk_sl_cui_inl_defd_base_div2_wrap mk_lang_concat(mk_sl_cui_inl_defd_base, _div2_wrap) #define mk_sl_cui_inl_defd_base_mod2_wrap mk_lang_concat(mk_sl_cui_inl_defd_base, _mod2_wrap) #define mk_sl_cui_inl_defd_base_divmod2_wrap mk_lang_concat(mk_sl_cui_inl_defd_base, _divmod2_wrap) +#define mk_sl_cui_inl_defd_base_to_str_bin_n mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_bin_n) +#define mk_sl_cui_inl_defd_base_to_str_bin_w mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_bin_w) +#define mk_sl_cui_inl_defd_base_from_str_bin_n mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_bin_n) +#define mk_sl_cui_inl_defd_base_from_str_bin_w mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_bin_w) +#define mk_sl_cui_inl_defd_base_to_str_oct_n mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_oct_n) +#define mk_sl_cui_inl_defd_base_to_str_oct_w mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_oct_w) +#define mk_sl_cui_inl_defd_base_from_str_oct_n mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_oct_n) +#define mk_sl_cui_inl_defd_base_from_str_oct_w mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_oct_w) +#define mk_sl_cui_inl_defd_base_to_str_dec_n mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_dec_n) +#define mk_sl_cui_inl_defd_base_to_str_dec_w mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_dec_w) +#define mk_sl_cui_inl_defd_base_from_str_dec_n mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_dec_n) +#define mk_sl_cui_inl_defd_base_from_str_dec_w mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_dec_w) +#define mk_sl_cui_inl_defd_base_to_str_hex_n mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_hex_n) +#define mk_sl_cui_inl_defd_base_to_str_hex_w mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_hex_w) +#define mk_sl_cui_inl_defd_base_from_str_hex_n mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_hex_n) +#define mk_sl_cui_inl_defd_base_from_str_hex_w mk_lang_concat(mk_sl_cui_inl_defd_base, _from_str_hex_w) +#define mk_sl_cui_inl_defd_base_to_str_binf_n mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_binf_n) +#define mk_sl_cui_inl_defd_base_to_str_binf_w mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_binf_w) +#define mk_sl_cui_inl_defd_base_to_str_hexf_n mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_hexf_n) +#define mk_sl_cui_inl_defd_base_to_str_hexf_w mk_lang_concat(mk_sl_cui_inl_defd_base, _to_str_hexf_w) #define mk_sl_cui_inl_defd_strlendec_log 19728ul /* floor(log10(2) * (2^16)) */ #define mk_sl_cui_inl_defd_sizebits_d (mk_sl_cui_inl_defd_count * mk_sl_cui_inl_defd_base_sizebits_d) #define mk_sl_cui_inl_defd_strlenbin_d mk_sl_cui_inl_defd_sizebits_d +#define mk_sl_cui_inl_defd_strlenoct_d mk_lang_div_roundup(mk_sl_cui_inl_defd_sizebits_d, 3) #define mk_sl_cui_inl_defd_strlendec_d (((mk_sl_cui_inl_defd_sizebits_d * mk_sl_cui_inl_defd_strlendec_log) >> 16) + 1) #define mk_sl_cui_inl_defd_strlenhex_d mk_lang_div_roundup(mk_sl_cui_inl_defd_sizebits_d, 4) @@ -182,22 +214,31 @@ mm_per_bui(`#define mk_sl_cui_inl_defd_base_to_buis_$1_be mk_lang_concat(mk_sl_c #define mk_sl_cui_inl_defd_sizebits_t mk_lang_concat(mk_sl_cui_inl_defd_name, _sizebits_t) #define mk_sl_cui_inl_defd_sizebits_v mk_lang_concat(mk_sl_cui_inl_defd_name, _sizebits_v) +#define mk_sl_cui_inl_defd_symbols_bin_a mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_a) +#define mk_sl_cui_inl_defd_symbols_bin_b mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_b) +#define mk_sl_cui_inl_defd_symbols_bin_c mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_c) +#define mk_sl_cui_inl_defd_symbols_bin_d mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_d) +#define mk_sl_cui_inl_defd_symbols_oct_a mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_oct_a) +#define mk_sl_cui_inl_defd_symbols_oct_b mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_oct_b) +#define mk_sl_cui_inl_defd_symbols_oct_c mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_oct_c) +#define mk_sl_cui_inl_defd_symbols_oct_d mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_oct_d) #define mk_sl_cui_inl_defd_symbols_dec_a mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_dec_a) #define mk_sl_cui_inl_defd_symbols_dec_b mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_dec_b) #define mk_sl_cui_inl_defd_symbols_dec_c mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_dec_c) #define mk_sl_cui_inl_defd_symbols_dec_d mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_dec_d) #define mk_sl_cui_inl_defd_symbols_hex_a mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_a) #define mk_sl_cui_inl_defd_symbols_hex_b mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_b) -#define mk_sl_cui_inl_defd_symbols_hex_c mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_c) -#define mk_sl_cui_inl_defd_symbols_hex_d mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_d) -#define mk_sl_cui_inl_defd_symbols_bin_a mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_a) -#define mk_sl_cui_inl_defd_symbols_bin_b mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_b) -#define mk_sl_cui_inl_defd_symbols_bin_c mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_c) -#define mk_sl_cui_inl_defd_symbols_bin_d mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_bin_d) +#define mk_sl_cui_inl_defd_symbols_hex_ca mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_ca) +#define mk_sl_cui_inl_defd_symbols_hex_cb mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_cb) +#define mk_sl_cui_inl_defd_symbols_hex_da mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_da) +#define mk_sl_cui_inl_defd_symbols_hex_db mk_lang_concat(mk_sl_cui_inl_defd_name, _symbols_hex_db) #define mk_sl_cui_inl_defd_strlenbin_e mk_lang_concat(mk_sl_cui_inl_defd_name, _strlenbin_e) #define mk_sl_cui_inl_defd_strlenbin_t mk_lang_concat(mk_sl_cui_inl_defd_name, _strlenbin_t) #define mk_sl_cui_inl_defd_strlenbin_v mk_lang_concat(mk_sl_cui_inl_defd_name, _strlenbin_v) +#define mk_sl_cui_inl_defd_strlenoct_e mk_lang_concat(mk_sl_cui_inl_defd_name, _strlenoct_e) +#define mk_sl_cui_inl_defd_strlenoct_t mk_lang_concat(mk_sl_cui_inl_defd_name, _strlenoct_t) +#define mk_sl_cui_inl_defd_strlenoct_v mk_lang_concat(mk_sl_cui_inl_defd_name, _strlenoct_v) #define mk_sl_cui_inl_defd_strlendec_e mk_lang_concat(mk_sl_cui_inl_defd_name, _strlendec_e) #define mk_sl_cui_inl_defd_strlendec_t mk_lang_concat(mk_sl_cui_inl_defd_name, _strlendec_t) #define mk_sl_cui_inl_defd_strlendec_v mk_lang_concat(mk_sl_cui_inl_defd_name, _strlendec_v) @@ -316,15 +357,27 @@ mm_per_bui(`#define mk_sl_cui_inl_defd_to_buis_$1_be mk_lang_concat(mk_sl_cui_in #define mk_sl_cui_inl_defd_div2_wrap mk_lang_concat(mk_sl_cui_inl_defd_name, _div2_wrap) #define mk_sl_cui_inl_defd_mod2_wrap mk_lang_concat(mk_sl_cui_inl_defd_name, _mod2_wrap) #define mk_sl_cui_inl_defd_divmod2_wrap mk_lang_concat(mk_sl_cui_inl_defd_name, _divmod2_wrap) +#define mk_sl_cui_inl_defd_to_str_bin_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_bin_n) +#define mk_sl_cui_inl_defd_to_str_bin_w mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_bin_w) +#define mk_sl_cui_inl_defd_from_str_bin_n mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_bin_n) +#define mk_sl_cui_inl_defd_from_str_bin_w mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_bin_w) +#define mk_sl_cui_inl_defd_to_str_oct_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_oct_n) +#define mk_sl_cui_inl_defd_to_str_oct_w mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_oct_w) +#define mk_sl_cui_inl_defd_from_str_oct_n mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_oct_n) +#define mk_sl_cui_inl_defd_from_str_oct_w mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_oct_w) #define mk_sl_cui_inl_defd_to_str_dec_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_dec_n) #define mk_sl_cui_inl_defd_to_str_dec_w mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_dec_w) #define mk_sl_cui_inl_defd_from_str_dec_n mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_dec_n) #define mk_sl_cui_inl_defd_from_str_dec_w mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_dec_w) #define mk_sl_cui_inl_defd_to_str_hex_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_hex_n) #define mk_sl_cui_inl_defd_to_str_hex_w mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_hex_w) -#define mk_sl_cui_inl_defd_to_str_hexf_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_hexf_n) -#define mk_sl_cui_inl_defd_to_str_bin_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_bin_n) +#define mk_sl_cui_inl_defd_from_str_hex_n mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_hex_n) +#define mk_sl_cui_inl_defd_from_str_hex_w mk_lang_concat(mk_sl_cui_inl_defd_name, _from_str_hex_w) #define mk_sl_cui_inl_defd_to_str_binf_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_binf_n) +#define mk_sl_cui_inl_defd_to_str_binf_w mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_binf_w) +#define mk_sl_cui_inl_defd_to_str_hexf_n mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_hexf_n) +#define mk_sl_cui_inl_defd_to_str_hexf_w mk_lang_concat(mk_sl_cui_inl_defd_name, _to_str_hexf_w) + #define mk_sl_cui_inl_defd_mul3_wrap_lo_restrict mk_lang_concat(mk_sl_cui_inl_defd_name, _mul3_wrap_lo_restrict) #define mk_sl_cui_inl_defd_mul3_wrap_lo_alias mk_lang_concat(mk_sl_cui_inl_defd_name, _mul3_wrap_lo_alias) diff --git a/mk_clib/src/mk_sl_cui_inl_defu.h.m4 b/mk_clib/src/mk_sl_cui_inl_defu.h.m4 index aa2fb4a..f2fe623 100644 --- a/mk_clib/src/mk_sl_cui_inl_defu.h.m4 +++ b/mk_clib/src/mk_sl_cui_inl_defu.h.m4 @@ -18,6 +18,7 @@ include(`mk_sl_cui_inl.m')dnl + `#'undef mk_sl_cui_inl_defd_name `#'undef mk_sl_cui_inl_defd_base `#'undef mk_sl_cui_inl_defd_count @@ -36,6 +37,16 @@ include(`mk_sl_cui_inl.m')dnl + + + + +`#'undef mk_sl_cui_inl_defd_str_style + +`#'undef mk_sl_cui_inl_defd_str_style + + + `#'undef mk_sl_cui_inl_defd_flatten `#'undef mk_sl_cui_inl_defd_forceinline @@ -154,11 +165,32 @@ mm_per_bui(`#undef mk_sl_cui_inl_defd_base_to_buis_$1_be') `#'undef mk_sl_cui_inl_defd_base_div2_wrap `#'undef mk_sl_cui_inl_defd_base_mod2_wrap `#'undef mk_sl_cui_inl_defd_base_divmod2_wrap +`#'undef mk_sl_cui_inl_defd_base_to_str_bin_n +`#'undef mk_sl_cui_inl_defd_base_to_str_bin_w +`#'undef mk_sl_cui_inl_defd_base_from_str_bin_n +`#'undef mk_sl_cui_inl_defd_base_from_str_bin_w +`#'undef mk_sl_cui_inl_defd_base_to_str_oct_n +`#'undef mk_sl_cui_inl_defd_base_to_str_oct_w +`#'undef mk_sl_cui_inl_defd_base_from_str_oct_n +`#'undef mk_sl_cui_inl_defd_base_from_str_oct_w +`#'undef mk_sl_cui_inl_defd_base_to_str_dec_n +`#'undef mk_sl_cui_inl_defd_base_to_str_dec_w +`#'undef mk_sl_cui_inl_defd_base_from_str_dec_n +`#'undef mk_sl_cui_inl_defd_base_from_str_dec_w +`#'undef mk_sl_cui_inl_defd_base_to_str_hex_n +`#'undef mk_sl_cui_inl_defd_base_to_str_hex_w +`#'undef mk_sl_cui_inl_defd_base_from_str_hex_n +`#'undef mk_sl_cui_inl_defd_base_from_str_hex_w +`#'undef mk_sl_cui_inl_defd_base_to_str_binf_n +`#'undef mk_sl_cui_inl_defd_base_to_str_binf_w +`#'undef mk_sl_cui_inl_defd_base_to_str_hexf_n +`#'undef mk_sl_cui_inl_defd_base_to_str_hexf_w `#'undef mk_sl_cui_inl_defd_strlendec_log `#'undef mk_sl_cui_inl_defd_sizebits_d `#'undef mk_sl_cui_inl_defd_strlenbin_d +`#'undef mk_sl_cui_inl_defd_strlenoct_d `#'undef mk_sl_cui_inl_defd_strlendec_d `#'undef mk_sl_cui_inl_defd_strlenhex_d @@ -182,22 +214,31 @@ mm_per_bui(`#undef mk_sl_cui_inl_defd_base_to_buis_$1_be') `#'undef mk_sl_cui_inl_defd_sizebits_t `#'undef mk_sl_cui_inl_defd_sizebits_v +`#'undef mk_sl_cui_inl_defd_symbols_bin_a +`#'undef mk_sl_cui_inl_defd_symbols_bin_b +`#'undef mk_sl_cui_inl_defd_symbols_bin_c +`#'undef mk_sl_cui_inl_defd_symbols_bin_d +`#'undef mk_sl_cui_inl_defd_symbols_oct_a +`#'undef mk_sl_cui_inl_defd_symbols_oct_b +`#'undef mk_sl_cui_inl_defd_symbols_oct_c +`#'undef mk_sl_cui_inl_defd_symbols_oct_d `#'undef mk_sl_cui_inl_defd_symbols_dec_a `#'undef mk_sl_cui_inl_defd_symbols_dec_b `#'undef mk_sl_cui_inl_defd_symbols_dec_c `#'undef mk_sl_cui_inl_defd_symbols_dec_d `#'undef mk_sl_cui_inl_defd_symbols_hex_a `#'undef mk_sl_cui_inl_defd_symbols_hex_b -`#'undef mk_sl_cui_inl_defd_symbols_hex_c -`#'undef mk_sl_cui_inl_defd_symbols_hex_d -`#'undef mk_sl_cui_inl_defd_symbols_bin_a -`#'undef mk_sl_cui_inl_defd_symbols_bin_b -`#'undef mk_sl_cui_inl_defd_symbols_bin_c -`#'undef mk_sl_cui_inl_defd_symbols_bin_d +`#'undef mk_sl_cui_inl_defd_symbols_hex_ca +`#'undef mk_sl_cui_inl_defd_symbols_hex_cb +`#'undef mk_sl_cui_inl_defd_symbols_hex_da +`#'undef mk_sl_cui_inl_defd_symbols_hex_db `#'undef mk_sl_cui_inl_defd_strlenbin_e `#'undef mk_sl_cui_inl_defd_strlenbin_t `#'undef mk_sl_cui_inl_defd_strlenbin_v +`#'undef mk_sl_cui_inl_defd_strlenoct_e +`#'undef mk_sl_cui_inl_defd_strlenoct_t +`#'undef mk_sl_cui_inl_defd_strlenoct_v `#'undef mk_sl_cui_inl_defd_strlendec_e `#'undef mk_sl_cui_inl_defd_strlendec_t `#'undef mk_sl_cui_inl_defd_strlendec_v @@ -316,15 +357,27 @@ mm_per_bui(`#undef mk_sl_cui_inl_defd_to_buis_$1_be') `#'undef mk_sl_cui_inl_defd_div2_wrap `#'undef mk_sl_cui_inl_defd_mod2_wrap `#'undef mk_sl_cui_inl_defd_divmod2_wrap +`#'undef mk_sl_cui_inl_defd_to_str_bin_n +`#'undef mk_sl_cui_inl_defd_to_str_bin_w +`#'undef mk_sl_cui_inl_defd_from_str_bin_n +`#'undef mk_sl_cui_inl_defd_from_str_bin_w +`#'undef mk_sl_cui_inl_defd_to_str_oct_n +`#'undef mk_sl_cui_inl_defd_to_str_oct_w +`#'undef mk_sl_cui_inl_defd_from_str_oct_n +`#'undef mk_sl_cui_inl_defd_from_str_oct_w `#'undef mk_sl_cui_inl_defd_to_str_dec_n `#'undef mk_sl_cui_inl_defd_to_str_dec_w `#'undef mk_sl_cui_inl_defd_from_str_dec_n `#'undef mk_sl_cui_inl_defd_from_str_dec_w `#'undef mk_sl_cui_inl_defd_to_str_hex_n `#'undef mk_sl_cui_inl_defd_to_str_hex_w -`#'undef mk_sl_cui_inl_defd_to_str_hexf_n -`#'undef mk_sl_cui_inl_defd_to_str_bin_n +`#'undef mk_sl_cui_inl_defd_from_str_hex_n +`#'undef mk_sl_cui_inl_defd_from_str_hex_w `#'undef mk_sl_cui_inl_defd_to_str_binf_n +`#'undef mk_sl_cui_inl_defd_to_str_binf_w +`#'undef mk_sl_cui_inl_defd_to_str_hexf_n +`#'undef mk_sl_cui_inl_defd_to_str_hexf_w + `#'undef mk_sl_cui_inl_defd_mul3_wrap_lo_restrict `#'undef mk_sl_cui_inl_defd_mul3_wrap_lo_alias diff --git a/mk_clib/src/mk_sl_cui_inl_filec.h.m4 b/mk_clib/src/mk_sl_cui_inl_filec.h.m4 index c1d4234..104ac07 100644 --- a/mk_clib/src/mk_sl_cui_inl_filec.h.m4 +++ b/mk_clib/src/mk_sl_cui_inl_filec.h.m4 @@ -3709,662 +3709,1741 @@ mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo m mk_sl_cui_inl_defd_divmod4_wrap(a, b, a, b); }} -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_bin_a[] = {'0', '1'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_bin_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_bin_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; + mk_lang_types_sint_t rem mk_lang_constexpr_init; + mk_lang_types_bool_t lsb mk_lang_constexpr_init; + mk_lang_types_bool_t zero mk_lang_constexpr_init; + mk_lang_types_sint_t ret mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + xx = *x; + ptr = &str[str_len - 1]; ++ptr; + rem = str_len; + for(;;) + { + if(rem == 0) + { + return 0; /* todo return negative? */ + } + --rem; + lsb = mk_sl_cui_inl_defd_has_lsb(&xx); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_bin_a[lsb ? 1 : 0]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = ((mk_lang_types_pchar_t)('0' + (lsb ? 1 : 0))); + #endif + mk_sl_cui_inl_defd_shr2(&xx, 1); + zero = mk_sl_cui_inl_defd_is_zero(&xx); + if(zero) + { + break; + } + } + ret = str_len - rem; + if(ret != str_len) + { + mk_lang_string_memmove_pc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); + } + return ret; +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_bin_b[] = {L'0', L'1'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_bin_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_bin_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_lang_types_wchar_pt ptr mk_lang_constexpr_init; + mk_lang_types_sint_t rem mk_lang_constexpr_init; + mk_lang_types_bool_t lsb mk_lang_constexpr_init; + mk_lang_types_bool_t zero mk_lang_constexpr_init; + mk_lang_types_sint_t ret mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + xx = *x; + ptr = &str[str_len - 1]; ++ptr; + rem = str_len; + for(;;) + { + if(rem == 0) + { + return 0; /* todo return negative? */ + } + --rem; + lsb = mk_sl_cui_inl_defd_has_lsb(&xx); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_bin_a[lsb ? 1 : 0]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = ((mk_lang_types_pchar_t)(L'0' + (lsb ? 1 : 0))); + #endif + mk_sl_cui_inl_defd_shr2(&xx, 1); + zero = mk_sl_cui_inl_defd_is_zero(&xx); + if(zero) + { + break; + } + } + ret = str_len - rem; + if(ret != str_len) + { + mk_lang_string_memmove_wc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); + } + return ret; +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_bin_c[] = {'0', '1'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_bin_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_from_str_bin_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_lang_types_pchar_pct it mk_lang_constexpr_init; + mk_lang_types_pchar_pct ite mk_lang_constexpr_init; + mk_lang_types_pchar_t e mk_lang_constexpr_init; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_types_sint_t n mk_lang_constexpr_init; + #endif + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t overflow mk_lang_constexpr_init; + mk_lang_types_sint_t shifts mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t digit mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + if(str_len == 0) + { + return 0; + } + it = str; + ite = str + str_len; + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_bin_c); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_bin_c[i]) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '1') + { + i = e - '0'; + } + else + { + return 0; + } + #endif + overflow = 1; + shifts = 0; + mk_sl_cui_inl_defd_from_bi_sint(&xx, &i); + for(++it; it != ite; ++it) + { + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_bin_c); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_bin_c[i]) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '1') + { + i = e - '0'; + } + else + { + break; + } + #endif + if(!mk_sl_cui_inl_defd_is_zero(&xx)) + { + ++shifts; + if(shifts == mk_sl_cui_inl_defd_sizebits_d) + { + overflow = -1; + break; + } + } + mk_sl_cui_inl_defd_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_shl2(&xx, 1); + mk_sl_cui_inl_defd_or2(&xx, &digit); + } + if(overflow == 1) + { + *x = xx; + } + return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_bin_d[] = {L'0', L'1'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_bin_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_from_str_bin_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_lang_types_wchar_pct it mk_lang_constexpr_init; + mk_lang_types_wchar_pct ite mk_lang_constexpr_init; + mk_lang_types_wchar_t e mk_lang_constexpr_init; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_types_sint_t n mk_lang_constexpr_init; + #endif + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t overflow mk_lang_constexpr_init; + mk_lang_types_sint_t shifts mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t digit mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + if(str_len == 0) + { + return 0; + } + it = str; + ite = str + str_len; + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_bin_d); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_bin_d[i]) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= L'0' && e <= L'1') + { + i = e - L'0'; + } + else + { + return 0; + } + #endif + overflow = 1; + shifts = 0; + mk_sl_cui_inl_defd_from_bi_sint(&xx, &i); + for(++it; it != ite; ++it) + { + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_bin_d); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_bin_d[i]) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= L'0' && e <= L'1') + { + i = e - L'0'; + } + else + { + break; + } + #endif + ++shifts; + if(shifts == mk_sl_cui_inl_defd_sizebits_d) + { + overflow = -1; + break; + } + mk_sl_cui_inl_defd_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_shl2(&xx, 1); + mk_sl_cui_inl_defd_or2(&xx, &digit); + } + if(overflow == 1) + { + *x = xx; + } + return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_oct_a[] = {'0', '1', '2', '3', '4', '5', '6', '7'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_oct_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_oct_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; + mk_lang_types_sint_t rem mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc mk_lang_constexpr_init; + mk_lang_types_sint_t ret mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + xx = *x; + ptr = &str[str_len - 1]; ++ptr; + rem = str_len; + for(;;) + { + mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); + tuc = tuc & 0x7; + if(rem == 0) + { + return 0; /* todo return negative? */ + } + --rem; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_oct_a[tuc]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = ((mk_lang_types_pchar_t)('0' + tuc)); + #endif + mk_sl_cui_inl_defd_shr2(&xx, 3); + if(mk_sl_cui_inl_defd_is_zero(&xx)) + { + break; + } + } + ret = str_len - rem; + if(ret != str_len) + { + mk_lang_string_memmove_pc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); + } + return ret; +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_oct_b[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_oct_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_oct_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_lang_types_wchar_pt ptr mk_lang_constexpr_init; + mk_lang_types_sint_t rem mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc mk_lang_constexpr_init; + mk_lang_types_sint_t ret mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + xx = *x; + ptr = &str[str_len - 1]; ++ptr; + rem = str_len; + for(;;) + { + mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); + tuc = tuc & 0x7; + if(rem == 0) + { + return 0; /* todo return negative? */ + } + --rem; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_oct_a[tuc]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = ((mk_lang_types_wchar_t)(L'0' + tuc)); + #endif + mk_sl_cui_inl_defd_shr2(&xx, 3); + if(mk_sl_cui_inl_defd_is_zero(&xx)) + { + break; + } + } + ret = str_len - rem; + if(ret != str_len) + { + mk_lang_string_memmove_wc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); + } + return ret; +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_oct_c[] = {'0', '1', '2', '3', '4', '5', '6', '7'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_oct_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_from_str_oct_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_lang_types_pchar_pct it mk_lang_constexpr_init; + mk_lang_types_pchar_pct ite mk_lang_constexpr_init; + mk_lang_types_pchar_t e mk_lang_constexpr_init; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_types_sint_t n mk_lang_constexpr_init; + #endif + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t overflow mk_lang_constexpr_init; + mk_lang_types_sint_t shifts mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t digit mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + mk_lang_static_assert(mk_lang_charbit % mk_lang_charbit == 0); + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + if(str_len == 0) + { + return 0; + } + it = str; + ite = str + str_len; + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_oct_c); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_oct_c[i]) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '7') + { + i = e - '0'; + } + else + { + return 0; + } + #endif + overflow = 1; + shifts = 0; + mk_sl_cui_inl_defd_from_bi_sint(&xx, &i); + for(++it; it != ite; ++it) + { + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_oct_c); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_oct_c[i]) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '7') + { + i = e - '0'; + } + else + { + break; + } + #endif + if(!mk_sl_cui_inl_defd_is_zero(&xx)) + { + ++shifts; + if(shifts > mk_sl_cui_inl_defd_sizebits_d / 3 || (shifts == mk_sl_cui_inl_defd_sizebits_d / 3 && mk_sl_cui_inl_defd_count_leading_zeros(&xx) < 3)) + { + overflow = -1; + break; + } + } + mk_sl_cui_inl_defd_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_shl2(&xx, 3); + mk_sl_cui_inl_defd_or2(&xx, &digit); + } + if(overflow == 1) + { + *x = xx; + } + return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_oct_d[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_oct_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_from_str_oct_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_lang_types_wchar_pct it mk_lang_constexpr_init; + mk_lang_types_wchar_pct ite mk_lang_constexpr_init; + mk_lang_types_wchar_t e mk_lang_constexpr_init; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_types_sint_t n mk_lang_constexpr_init; + #endif + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t overflow mk_lang_constexpr_init; + mk_lang_types_sint_t shifts mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t digit mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + mk_lang_static_assert(mk_lang_charbit % mk_lang_charbit == 0); + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + if(str_len == 0) + { + return 0; + } + it = str; + ite = str + str_len; + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_oct_d); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_oct_d[i]) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= L'0' && e <= L'7') + { + i = e - L'0'; + } + else + { + return 0; + } + #endif + overflow = 1; + shifts = 0; + mk_sl_cui_inl_defd_from_bi_sint(&xx, &i); + for(++it; it != ite; ++it) + { + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_oct_d); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_oct_d[i]) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= L'0' && e <= L'7') + { + i = e - L'0'; + } + else + { + break; + } + #endif + ++shifts; + if(shifts > mk_sl_cui_inl_defd_sizebits_d / 3 || (shifts == mk_sl_cui_inl_defd_sizebits_d / 3 && mk_sl_cui_inl_defd_count_leading_zeros(&xx) < 3)) + { + overflow = -1; + break; + } + mk_sl_cui_inl_defd_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_shl2(&xx, 3); + mk_sl_cui_inl_defd_or2(&xx, &digit); + } + if(overflow == 1) + { + *x = xx; + } + return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_dec_a[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; #endif -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_dec_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_dec_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_dec_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t n mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt pa1 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t a1 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt pa2 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t a2 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt pa3 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t b mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + i = str_len; + n = 10; + mk_sl_cui_inl_defd_base_from_bi_sint(&base, &n); + pa1 = &a1; + pa2 = &a2; + *pa2 = *x; + for(;;) + { + pa3 = pa1; + pa1 = pa2; + pa2 = pa3; + mk_sl_cui_inl_defd_divmod4_wrap_smol(pa1, &base, pa2, &b); + mk_sl_cui_inl_defd_base_to_bi_sint(&b, &n); + mk_lang_assert(n >= 0 && n < 10); + --i; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + str[i] = mk_sl_cui_inl_defd_symbols_dec_a[n]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + str[i] = ((mk_lang_types_pchar_t)('0' + n)); + #endif + if(mk_sl_cui_inl_defd_is_zero(pa2)) + { + break; + } + if(i == 0) + { + return 0; + } + } + if(i != 0) + { + mk_lang_assert(str_len - i >= 1); + mk_lang_string_memmove_pc_fn(str, str + i, ((mk_lang_types_uint_t)(str_len - i))); + } + mk_lang_assert(str_len - i >= 0); + mk_lang_assert(str_len - i <= mk_sl_cui_inl_defd_strlendec_v); + return str_len - i; +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_dec_b[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_dec_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_dec_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t n mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt pa1 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t a1 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt pa2 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t a2 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt pa3 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t b mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + i = str_len; + n = 10; + mk_sl_cui_inl_defd_base_from_bi_sint(&base, &n); + pa1 = &a1; + pa2 = &a2; + *pa2 = *x; + for(;;) + { + pa3 = pa1; + pa1 = pa2; + pa2 = pa3; + mk_sl_cui_inl_defd_divmod4_wrap_smol(pa1, &base, pa2, &b); + mk_sl_cui_inl_defd_base_to_bi_sint(&b, &n); + mk_lang_assert(n >= 0 && n < 10); + --i; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + str[i] = mk_sl_cui_inl_defd_symbols_dec_b[n]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + str[i] = ((mk_lang_types_wchar_t)(L'0' + n)); + #endif + if(mk_sl_cui_inl_defd_is_zero(pa2)) + { + break; + } + if(i == 0) + { + return 0; + } + } + if(i != 0) + { + mk_lang_assert(str_len - i >= 1); + mk_lang_string_memmove_wc_fn(str, str + i, ((mk_lang_types_uint_t)(str_len - i))); + } + mk_lang_assert(str_len - i >= 0); + mk_lang_assert(str_len - i <= mk_sl_cui_inl_defd_strlendec_v); + return str_len - i; +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_dec_c[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_base_t mk_sl_cui_inl_defd_from_str_dec_border_base_impl(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ + mk_lang_types_sint_t tsi mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; + + tsi = 10; + mk_sl_cui_inl_defd_base_from_bi_sint(&base, &tsi); + return base; +}} + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_t mk_sl_cui_inl_defd_from_str_dec_border_value_impl(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ + mk_lang_types_sint_t tsi mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t mx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t border_value mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t border_digit mk_lang_constexpr_init; + + tsi = 10; + mk_sl_cui_inl_defd_base_from_bi_sint(&base, &tsi); + mk_sl_cui_inl_defd_set_max(&mx); + mk_sl_cui_inl_defd_divmod4_wrap_smol(&mx, &base, &border_value, &border_digit); + return border_value; +}} + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_border_digit_impl(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ + mk_lang_types_sint_t tsi mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t mx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t border_value mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t border_digit mk_lang_constexpr_init; + + tsi = 10; + mk_sl_cui_inl_defd_base_from_bi_sint(&base, &tsi); + mk_sl_cui_inl_defd_set_max(&mx); + mk_sl_cui_inl_defd_divmod4_wrap_smol(&mx, &base, &border_value, &border_digit); + mk_sl_cui_inl_defd_base_to_bi_sint(&border_digit, &tsi); + return tsi; +}} + +#if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 +mk_lang_constexpr_static_inline mk_sl_cui_inl_defd_base_t const mk_sl_cui_inl_defd_from_str_dec_border_base_val = mk_sl_cui_inl_defd_from_str_dec_border_base_impl(); +mk_lang_constexpr_static_inline mk_sl_cui_inl_defd_t const mk_sl_cui_inl_defd_from_str_dec_border_value_val = mk_sl_cui_inl_defd_from_str_dec_border_value_impl(); +mk_lang_constexpr_static_inline mk_lang_types_sint_t const mk_sl_cui_inl_defd_from_str_dec_border_digit_val = mk_sl_cui_inl_defd_from_str_dec_border_digit_impl(); +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_base_t mk_sl_cui_inl_defd_from_str_dec_border_base(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ + #if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 + return mk_sl_cui_inl_defd_from_str_dec_border_base_val; + #else + return mk_sl_cui_inl_defd_from_str_dec_border_base_impl(); + #endif +}} + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_t mk_sl_cui_inl_defd_from_str_dec_border_value(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ + #if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 + return mk_sl_cui_inl_defd_from_str_dec_border_value_val; + #else + return mk_sl_cui_inl_defd_from_str_dec_border_value_impl(); + #endif +}} + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_border_digit(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ + #if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 + return mk_sl_cui_inl_defd_from_str_dec_border_digit_val; + #else + return mk_sl_cui_inl_defd_from_str_dec_border_digit_impl(); + #endif +}} + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten { +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_from_str_dec_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_base_t s_base mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t s_border_value mk_lang_constexpr_init; + mk_lang_types_sint_t s_border_digit mk_lang_constexpr_init; + + mk_lang_types_pchar_pct it mk_lang_constexpr_init; + mk_lang_types_pchar_pct ite mk_lang_constexpr_init; + mk_lang_types_pchar_t e mk_lang_constexpr_init; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_types_sint_t n mk_lang_constexpr_init; + #endif mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t overflow mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt px1 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt px2 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t digit mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt px3 mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str); + mk_lang_assert(str_len >= 0); + + if(str_len == 0) + { + return 0; + } + s_base = mk_sl_cui_inl_defd_from_str_dec_border_base(); + s_border_value = mk_sl_cui_inl_defd_from_str_dec_border_value(); + s_border_digit = mk_sl_cui_inl_defd_from_str_dec_border_digit(); + it = str; + ite = str + str_len; + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_c); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_dec_c[i]) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '9') + { + i = e - '0'; + } + else + { + return 0; + } + #endif + overflow = 1; + px1 = &xx; + px2 = x; + mk_sl_cui_inl_defd_from_bi_sint(px1, &i); + for(++it; it != ite; ++it) + { + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_c); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_dec_c[i]) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '9') + { + i = e - '0'; + } + else + { + break; + } + #endif + if(!(mk_sl_cui_inl_defd_lt(px1, &s_border_value) || (mk_sl_cui_inl_defd_eq(px1, &s_border_value) && i <= s_border_digit))) + { + overflow = -1; + break; + } + mk_sl_cui_inl_defd_mul3_wrap_lo_smol(px1, &s_base, px2); + mk_sl_cui_inl_defd_base_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_add2_wrap_cid_cod_smol(px2, &digit); + px3 = px1; + px1 = px2; + px2 = px3; + } + if(px1 == &xx) + { + *x = xx; + } + return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_dec_d[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_from_str_dec_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_base_t s_base mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t s_border_value mk_lang_constexpr_init; + mk_lang_types_sint_t s_border_digit mk_lang_constexpr_init; + + mk_lang_types_wchar_pct it mk_lang_constexpr_init; + mk_lang_types_wchar_pct ite mk_lang_constexpr_init; + mk_lang_types_wchar_t e mk_lang_constexpr_init; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) mk_lang_types_sint_t n mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt pa1 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t a1 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt pa2 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t a2 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt pa3 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t b mk_lang_constexpr_init; + #endif + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_sint_t overflow mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt px1 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt px2 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_base_t digit mk_lang_constexpr_init; + mk_sl_cui_inl_defd_pt px3 mk_lang_constexpr_init; + + mk_lang_assert(x); + mk_lang_assert(str); + mk_lang_assert(str_len >= 0); + + if(str_len == 0) + { + return 0; + } + s_base = mk_sl_cui_inl_defd_from_str_dec_border_base(); + s_border_value = mk_sl_cui_inl_defd_from_str_dec_border_value(); + s_border_digit = mk_sl_cui_inl_defd_from_str_dec_border_digit(); + it = str; + ite = str + str_len; + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_d); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_dec_d[i]) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= L'0' && e <= L'9') + { + i = e - L'0'; + } + else + { + return 0; + } + #endif + overflow = 1; + px1 = &xx; + px2 = x; + mk_sl_cui_inl_defd_from_bi_sint(px1, &i); + for(++it; it != ite; ++it) + { + e = *it; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_d); + for(i = 0; i != n; ++i) + { + if(e == mk_sl_cui_inl_defd_symbols_dec_d[i]) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= L'0' && e <= L'9') + { + i = e - L'0'; + } + else + { + break; + } + #endif + if(!(mk_sl_cui_inl_defd_lt(px1, &s_border_value) || (mk_sl_cui_inl_defd_eq(px1, &s_border_value) && i <= s_border_digit))) + { + overflow = -1; + break; + } + mk_sl_cui_inl_defd_mul3_wrap_lo_smol(px1, &s_base, px2); + mk_sl_cui_inl_defd_base_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_add2_wrap_cid_cod_smol(px2, &digit); + px3 = px1; + px1 = px2; + px2 = px3; + } + if(px1 == &xx) + { + *x = xx; + } + return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif +}} + +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_hex_a[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; +#endif + +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hex_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +{ +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_hex_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; + mk_lang_types_sint_t rem mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc mk_lang_constexpr_init; + mk_lang_types_bool_t zero mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc_lo mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc_hi mk_lang_constexpr_init; + mk_lang_types_sint_t ret mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit % 2 == 0); + mk_lang_static_assert(mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit / 2); mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - i = str_len; - n = 10; - mk_sl_cui_inl_defd_base_from_bi_sint(&base, &n); - pa1 = &a1; - pa2 = &a2; - *pa2 = *x; + xx = *x; + ptr = &str[str_len - 1]; ++ptr; + rem = str_len; for(;;) { - pa3 = pa1; - pa1 = pa2; - pa2 = pa3; - mk_sl_cui_inl_defd_divmod4_wrap_smol(pa1, &base, pa2, &b); - mk_sl_cui_inl_defd_base_to_bi_sint(&b, &n); - mk_lang_assert(n >= 0 && n < 10); - --i; - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - str[i] = ((mk_lang_types_pchar_t)('0' + n)); + mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); + #if mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit); #else - str[i] = mk_sl_cui_inl_defd_symbols_dec_a[n]; + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); #endif - if(mk_sl_cui_inl_defd_is_zero(pa2)) + zero = mk_sl_cui_inl_defd_is_zero(&xx); + tuc_lo = ((mk_lang_types_uchar_t)((tuc >> 0) & 0xf)); + if(rem == 0) + { + return 0; /* todo return negative? */ + } + --rem; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_a[tuc_lo]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_lo)) : ((mk_lang_types_pchar_t)('a' + (tuc_lo - 10))); + #endif + tuc_hi = ((mk_lang_types_uchar_t)((tuc >> 4) & 0xf)); + if(tuc_hi == 0 && zero) { break; } - if(i == 0) + if(rem == 0) { - return 0; + return 0; /* todo return negative? */ + } + --rem; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_a[tuc_hi]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_hi)) : ((mk_lang_types_pchar_t)('a' + (tuc_hi - 10))); + #endif + if(zero) + { + break; } } - if(i != 0) + ret = str_len - rem; + if(ret != str_len) { - mk_lang_assert(str_len - i >= 1); - mk_sl_cui_inl_filec_memmove_pc_fn(str, str + i, ((mk_lang_types_uint_t)(str_len - i))); + mk_lang_string_memmove_pc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); } - mk_lang_assert(str_len - i >= 0); - mk_lang_assert(str_len - i <= mk_sl_cui_inl_defd_strlendec_v); - return str_len - i; + return ret; +#endif }} -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_dec_b[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'}; +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_hex_b[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9', L'a', L'b', L'c', L'd', L'e', L'f'}; #endif -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_dec_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hex_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten { - mk_lang_types_sint_t i mk_lang_constexpr_init; - mk_lang_types_sint_t n mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt pa1 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t a1 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt pa2 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t a2 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt pa3 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t b mk_lang_constexpr_init; +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_hex_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else + mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; + mk_lang_types_wchar_pt ptr mk_lang_constexpr_init; + mk_lang_types_sint_t rem mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc mk_lang_constexpr_init; + mk_lang_types_bool_t zero mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc_lo mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc_hi mk_lang_constexpr_init; + mk_lang_types_sint_t ret mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit % 2 == 0); + mk_lang_static_assert(mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit / 2); mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - i = str_len; - n = 10; - mk_sl_cui_inl_defd_base_from_bi_sint(&base, &n); - pa1 = &a1; - pa2 = &a2; - *pa2 = *x; + xx = *x; + ptr = &str[str_len - 1]; ++ptr; + rem = str_len; for(;;) { - pa3 = pa1; - pa1 = pa2; - pa2 = pa3; - mk_sl_cui_inl_defd_divmod4_wrap_smol(pa1, &base, pa2, &b); - mk_sl_cui_inl_defd_base_to_bi_sint(&b, &n); - mk_lang_assert(n >= 0 && n < 10); - --i; - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - str[i] = ((mk_lang_types_wchar_t)(L'0' + n)); + mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); + #if mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit); #else - str[i] = mk_sl_cui_inl_defd_symbols_dec_b[n]; + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); #endif - if(mk_sl_cui_inl_defd_is_zero(pa2)) + zero = mk_sl_cui_inl_defd_is_zero(&xx); + tuc_lo = ((mk_lang_types_uchar_t)((tuc >> 0) & 0xf)); + if(rem == 0) + { + return 0; /* todo return negative? */ + } + --rem; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_b[tuc_lo]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_wchar_t)(L'0' + tuc_lo)) : ((mk_lang_types_wchar_t)(L'a' + (tuc_lo - 10))); + #endif + tuc_hi = ((mk_lang_types_uchar_t)((tuc >> 4) & 0xf)); + if(tuc_hi == 0 && zero) { break; } - if(i == 0) + if(rem == 0) { - return 0; + return 0; /* todo return negative? */ + } + --rem; + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_b[tuc_hi]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_wchar_t)(L'0' + tuc_hi)) : ((mk_lang_types_wchar_t)(L'a' + (tuc_hi - 10))); + #endif + if(zero) + { + break; } } - if(i != 0) + ret = str_len - rem; + if(ret != str_len) { - mk_lang_assert(str_len - i >= 1); - mk_sl_cui_inl_filec_memmove_wc_fn(str, str + i, ((mk_lang_types_uint_t)(str_len - i))); + mk_lang_string_memmove_wc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); } - mk_lang_assert(str_len - i >= 0); - mk_lang_assert(str_len - i <= mk_sl_cui_inl_defd_strlendec_v); - return str_len - i; -}} - -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_dec_c[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + return ret; #endif - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_base_t mk_sl_cui_inl_defd_from_str_dec_border_base_impl(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ - mk_lang_types_sint_t tsi mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; - - tsi = 10; - mk_sl_cui_inl_defd_base_from_bi_sint(&base, &tsi); - return base; -}} - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_t mk_sl_cui_inl_defd_from_str_dec_border_value_impl(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ - mk_lang_types_sint_t tsi mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t mx mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t border_value mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t border_digit mk_lang_constexpr_init; - - tsi = 10; - mk_sl_cui_inl_defd_base_from_bi_sint(&base, &tsi); - mk_sl_cui_inl_defd_set_max(&mx); - mk_sl_cui_inl_defd_divmod4_wrap_smol(&mx, &base, &border_value, &border_digit); - mk_sl_cui_inl_defd_base_to_bi_sint(&border_digit, &tsi); - return border_value; -}} - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_border_digit_impl(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ - mk_lang_types_sint_t tsi mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t mx mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t border_value mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t border_digit mk_lang_constexpr_init; - - tsi = 10; - mk_sl_cui_inl_defd_base_from_bi_sint(&base, &tsi); - mk_sl_cui_inl_defd_set_max(&mx); - mk_sl_cui_inl_defd_divmod4_wrap_smol(&mx, &base, &border_value, &border_digit); - mk_sl_cui_inl_defd_base_to_bi_sint(&border_digit, &tsi); - return tsi; }} -#if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 -mk_lang_constexpr_static_inline mk_sl_cui_inl_defd_base_t const mk_sl_cui_inl_defd_from_str_dec_border_base_val = mk_sl_cui_inl_defd_from_str_dec_border_base_impl(); -mk_lang_constexpr_static_inline mk_sl_cui_inl_defd_t const mk_sl_cui_inl_defd_from_str_dec_border_value_val = mk_sl_cui_inl_defd_from_str_dec_border_value_impl(); -mk_lang_constexpr_static_inline mk_lang_types_sint_t const mk_sl_cui_inl_defd_from_str_dec_border_digit_val = mk_sl_cui_inl_defd_from_str_dec_border_digit_impl(); +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_hex_ca[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; +mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_hex_cb[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; #endif -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_base_t mk_sl_cui_inl_defd_from_str_dec_border_base(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ - #if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 - return mk_sl_cui_inl_defd_from_str_dec_border_base_val; - #else - return mk_sl_cui_inl_defd_from_str_dec_border_base_impl(); - #endif -}} - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_sl_cui_inl_defd_t mk_sl_cui_inl_defd_from_str_dec_border_value(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ - #if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 - return mk_sl_cui_inl_defd_from_str_dec_border_value_val; - #else - return mk_sl_cui_inl_defd_from_str_dec_border_value_impl(); - #endif -}} - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias static mk_lang_inline mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_border_digit(mk_lang_types_void_t) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ - #if mk_lang_version_at_least_cpp_14 || mk_lang_version_at_least_msvc_cpp_14 - return mk_sl_cui_inl_defd_from_str_dec_border_digit_val; - #else - return mk_sl_cui_inl_defd_from_str_dec_border_digit_impl(); - #endif -}} - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_hex_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten { - mk_sl_cui_inl_defd_base_t s_base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t s_border_value mk_lang_constexpr_init; - mk_lang_types_sint_t s_border_digit mk_lang_constexpr_init; +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + return mk_sl_cui_inl_defd_base_from_str_hex_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else mk_lang_types_pchar_pct it mk_lang_constexpr_init; mk_lang_types_pchar_pct ite mk_lang_constexpr_init; mk_lang_types_pchar_t e mk_lang_constexpr_init; - #if(!(mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) mk_lang_types_sint_t n mk_lang_constexpr_init; #endif mk_lang_types_sint_t i mk_lang_constexpr_init; mk_lang_types_sint_t overflow mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt px1 mk_lang_constexpr_init; + mk_lang_types_sint_t shifts mk_lang_constexpr_init; mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt px2 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t digit mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt px3 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t digit mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + mk_lang_static_assert(mk_lang_charbit % mk_lang_charbit == 0); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_static_assert(mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_ca) == mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_cb)); + #endif mk_lang_assert(x); - mk_lang_assert(str); + mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); if(str_len == 0) { return 0; } - { - s_base = mk_sl_cui_inl_defd_from_str_dec_border_base(); - s_border_value = mk_sl_cui_inl_defd_from_str_dec_border_value(); - s_border_digit = mk_sl_cui_inl_defd_from_str_dec_border_digit(); - } it = str; ite = str + str_len; e = *it; - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_ca); + for(i = 0; i != n; ++i) + { + if + ( + e == mk_sl_cui_inl_defd_symbols_hex_ca[i] || + e == mk_sl_cui_inl_defd_symbols_hex_cb[i] + ) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) if(e >= '0' && e <= '9') { i = e - '0'; } - else + else if(e >= 'a' && e <= 'f') { - return 0; + i = 10 + (e - 'a'); } - #else - n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_c); - for(i = 0; i != n; ++i) + else if(e >= 'A' && e <= 'F') { - if(e == mk_sl_cui_inl_defd_symbols_dec_c[i]) - { - break; - } + i = 10 + (e - 'A'); } - if(i == n) + else { return 0; } #endif overflow = 1; - px1 = &xx; - px2 = x; - mk_sl_cui_inl_defd_from_bi_sint(px1, &i); + shifts = 0; + mk_sl_cui_inl_defd_from_bi_sint(&xx, &i); for(++it; it != ite; ++it) { e = *it; - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - if(e >= '0' && e <= '9') + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_ca); + for(i = 0; i != n; ++i) { - i = e - '0'; + if + ( + e == mk_sl_cui_inl_defd_symbols_hex_ca[i] || + e == mk_sl_cui_inl_defd_symbols_hex_cb[i] + ) + { + break; + } } - else + if(i == n) { break; } - #else - n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_c); - for(i = 0; i != n; ++i) + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + if(e >= '0' && e <= '9') + { + i = e - '0'; + } + else if(e >= 'a' && e <= 'f') + { + i = 10 + (e - 'a'); + } + else if(e >= 'A' && e <= 'F') { - if(e == mk_sl_cui_inl_defd_symbols_dec_c[i]) - { - break; - } + i = 10 + (e - 'A'); } - if(i == n) + else { break; } #endif - if(!(mk_sl_cui_inl_defd_lt(px1, &s_border_value) || (mk_sl_cui_inl_defd_eq(px1, &s_border_value) && i <= s_border_digit))) + if(!mk_sl_cui_inl_defd_is_zero(&xx)) { - overflow = -1; - break; + ++shifts; + if(shifts == mk_sl_cui_inl_defd_sizebits_d / mk_lang_charbit * 2) + { + overflow = -1; + break; + } } - mk_sl_cui_inl_defd_mul3_wrap_lo_smol(px1, &s_base, px2); - mk_sl_cui_inl_defd_base_from_bi_sint(&digit, &i); - mk_sl_cui_inl_defd_add2_wrap_cid_cod_smol(px2, &digit); - px3 = px1; - px1 = px2; - px2 = px3; + mk_sl_cui_inl_defd_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_shl2(&xx, mk_lang_charbit / 2); + mk_sl_cui_inl_defd_or2(&xx, &digit); } - if(px1 == &xx) + if(overflow == 1) { *x = xx; } return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); +#endif }} -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_dec_d[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'}; +#if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_hex_da[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9', L'a', L'b', L'c', L'd', L'e', L'f'}; +mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_hex_db[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F'}; #endif -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_hex_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten { - mk_sl_cui_inl_defd_base_t s_base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t s_border_value mk_lang_constexpr_init; - mk_lang_types_sint_t s_border_digit mk_lang_constexpr_init; +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + return mk_sl_cui_inl_defd_base_from_str_hex_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else mk_lang_types_wchar_pct it mk_lang_constexpr_init; mk_lang_types_wchar_pct ite mk_lang_constexpr_init; mk_lang_types_wchar_t e mk_lang_constexpr_init; - #if(!(mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) mk_lang_types_sint_t n mk_lang_constexpr_init; #endif mk_lang_types_sint_t i mk_lang_constexpr_init; mk_lang_types_sint_t overflow mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt px1 mk_lang_constexpr_init; + mk_lang_types_sint_t shifts mk_lang_constexpr_init; mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt px2 mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t digit mk_lang_constexpr_init; - mk_sl_cui_inl_defd_pt px3 mk_lang_constexpr_init; + mk_sl_cui_inl_defd_t digit mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + mk_lang_static_assert(mk_lang_charbit % mk_lang_charbit == 0); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + mk_lang_static_assert(mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_da) == mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_db)); + #endif mk_lang_assert(x); - mk_lang_assert(str); + mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); if(str_len == 0) { return 0; } - { - mk_lang_types_sint_t nn mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t base mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t mx mk_lang_constexpr_init; - mk_sl_cui_inl_defd_t border_value mk_lang_constexpr_init; - mk_sl_cui_inl_defd_base_t border_digit mk_lang_constexpr_init; - - nn = 10; - mk_sl_cui_inl_defd_base_from_bi_sint(&base, &nn); - mk_sl_cui_inl_defd_set_max(&mx); - mk_sl_cui_inl_defd_divmod4_wrap_smol(&mx, &base, &border_value, &border_digit); - mk_sl_cui_inl_defd_base_to_bi_sint(&border_digit, &nn); - s_base = base; - s_border_value = border_value; - s_border_digit = nn; - } - it = str; ite = str + str_len; e = *it; - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_da); + for(i = 0; i != n; ++i) + { + if + ( + e == mk_sl_cui_inl_defd_symbols_hex_da[i] || + e == mk_sl_cui_inl_defd_symbols_hex_db[i] + ) + { + break; + } + } + if(i == n) + { + return 0; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) if(e >= L'0' && e <= L'9') { i = e - L'0'; } - else + else if(e >= L'a' && e <= L'f') { - return 0; + i = 10 + (e - L'a'); } - #else - n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_d); - for(i = 0; i != n; ++i) + else if(e >= L'A' && e <= L'F') { - if(e == mk_sl_cui_inl_defd_symbols_dec_d[i]) - { - break; - } + i = 10 + (e - L'A'); } - if(i == n) + else { return 0; } #endif overflow = 1; - px1 = &xx; - px2 = x; - mk_sl_cui_inl_defd_from_bi_sint(px1, &i); + shifts = 0; + mk_sl_cui_inl_defd_from_bi_sint(&xx, &i); for(++it; it != ite; ++it) { e = *it; - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_hex_da); + for(i = 0; i != n; ++i) + { + if + ( + e == mk_sl_cui_inl_defd_symbols_hex_da[i] || + e == mk_sl_cui_inl_defd_symbols_hex_db[i] + ) + { + break; + } + } + if(i == n) + { + break; + } + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) if(e >= L'0' && e <= L'9') { i = e - L'0'; } - else + else if(e >= L'a' && e <= L'f') { - break; + i = 10 + (e - L'a'); } - #else - n = mk_lang_countof(mk_sl_cui_inl_defd_symbols_dec_d); - for(i = 0; i != n; ++i) + else if(e >= L'A' && e <= L'F') { - if(e == mk_sl_cui_inl_defd_symbols_dec_d[i]) - { - break; - } + i = 10 + (e - L'A'); } - if(i == n) + else { break; } #endif - if(!(mk_sl_cui_inl_defd_lt(px1, &s_border_value) || (mk_sl_cui_inl_defd_eq(px1, &s_border_value) && i <= s_border_digit))) + ++shifts; + if(shifts == mk_sl_cui_inl_defd_sizebits_d / mk_lang_charbit * 2) { overflow = -1; break; } - mk_sl_cui_inl_defd_mul3_wrap_lo_smol(px1, &s_base, px2); - mk_sl_cui_inl_defd_base_from_bi_sint(&digit, &i); - mk_sl_cui_inl_defd_add2_wrap_cid_cod_smol(px2, &digit); - px3 = px1; - px1 = px2; - px2 = px3; + mk_sl_cui_inl_defd_from_bi_sint(&digit, &i); + mk_sl_cui_inl_defd_shl2(&xx, mk_lang_charbit / 2); + mk_sl_cui_inl_defd_or2(&xx, &digit); } - if(px1 == &xx) + if(overflow == 1) { *x = xx; } return ((mk_lang_types_sint_t)(((mk_lang_types_sint_t)(it - str)) * overflow)); -}} - -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_hex_a[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; #endif +}} -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hex_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_binf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_binf_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; - mk_lang_types_sint_t rem mk_lang_constexpr_init; - mk_lang_types_uchar_t tuc mk_lang_constexpr_init; - mk_lang_types_bool_t zero mk_lang_constexpr_init; - mk_lang_types_uchar_t tuc_lo mk_lang_constexpr_init; - mk_lang_types_uchar_t tuc_hi mk_lang_constexpr_init; - mk_lang_types_sint_t ret mk_lang_constexpr_init; - - mk_lang_static_assert(mk_lang_charbit % 2 == 0); + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_bool_t lsb mk_lang_constexpr_init; mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - xx = *x; - ptr = &str[str_len - 1]; - rem = str_len; - for(;;) + mk_lang_static_assert(mk_lang_charbit == 8); + + if(!(str_len >= mk_sl_cui_inl_defd_strlenbin_v)) { - mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); - mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); - mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); - zero = mk_sl_cui_inl_defd_is_zero(&xx); - tuc_lo = ((mk_lang_types_uchar_t)((tuc >> 0) & 0xf)); - if(rem == 0){ return 0; } --rem; /* todo return negative? */ - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_lo)) : ((mk_lang_types_pchar_t)('a' + (tuc_lo - 10))); --ptr; - #else - ptr[0] = mk_sl_cui_inl_defd_symbols_hex_a[tuc_lo]; --ptr; - #endif - tuc_hi = ((mk_lang_types_uchar_t)((tuc >> 4) & 0xf)); - if(tuc_hi == 0 && zero){ break; } - if(rem == 0){ return 0; } --rem; /* todo return negative? */ - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_hi)) : ((mk_lang_types_pchar_t)('a' + (tuc_hi - 10))); --ptr; - #else - ptr[0] = mk_sl_cui_inl_defd_symbols_hex_a[tuc_hi]; --ptr; - #endif - if(zero){ break; } + return 0; /* todo return negative? */ } - ret = str_len - rem; - if(ret != str_len) + xx = *x; + ptr = &str[mk_sl_cui_inl_defd_strlenbin_v - 1]; ++ptr; + for(i = 0; i != mk_sl_cui_inl_defd_strlenbin_v; ++i) { - mk_sl_cui_inl_filec_memmove_pc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); + lsb = mk_sl_cui_inl_defd_has_lsb(&xx); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_bin_a[lsb ? 1 : 0]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = ((mk_lang_types_pchar_t)('0' + (lsb ? 1 : 0))); + #endif + mk_sl_cui_inl_defd_shr2(&xx, 1); } - return ret; -}} - -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_wchar_t const mk_sl_cui_inl_defd_symbols_hex_b[] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9', L'a', L'b', L'c', L'd', L'e', L'f'}; + mk_lang_assert(mk_sl_cui_inl_defd_is_zero(&xx)); + return mk_sl_cui_inl_defd_strlenbin_v; #endif +} -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hex_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_binf_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_binf_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; mk_lang_types_wchar_pt ptr mk_lang_constexpr_init; - mk_lang_types_sint_t rem mk_lang_constexpr_init; - mk_lang_types_uchar_t tuc mk_lang_constexpr_init; - mk_lang_types_bool_t zero mk_lang_constexpr_init; - mk_lang_types_uchar_t tuc_lo mk_lang_constexpr_init; - mk_lang_types_uchar_t tuc_hi mk_lang_constexpr_init; - mk_lang_types_sint_t ret mk_lang_constexpr_init; - - mk_lang_static_assert(mk_lang_charbit % 2 == 0); + mk_lang_types_sint_t i mk_lang_constexpr_init; + mk_lang_types_bool_t lsb mk_lang_constexpr_init; mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - xx = *x; - ptr = &str[str_len - 1]; - rem = str_len; - for(;;) + mk_lang_static_assert(mk_lang_charbit == 8); + + if(!(str_len >= mk_sl_cui_inl_defd_strlenbin_v)) { - mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); - mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); - mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); - zero = mk_sl_cui_inl_defd_is_zero(&xx); - tuc_lo = ((mk_lang_types_uchar_t)((tuc >> 0) & 0xf)); - if(rem == 0){ return 0; } --rem; /* todo return negative? */ - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_wchar_t)(L'0' + tuc_lo)) : ((mk_lang_types_wchar_t)(L'a' + (tuc_lo - 10))); --ptr; - #else - ptr[0] = mk_sl_cui_inl_defd_symbols_hex_b[tuc_lo]; --ptr; - #endif - tuc_hi = ((mk_lang_types_uchar_t)((tuc >> 4) & 0xf)); - if(tuc_hi == 0 && zero){ break; } - if(rem == 0){ return 0; } --rem; /* todo return negative? */ - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_wchar_t)(L'0' + tuc_hi)) : ((mk_lang_types_wchar_t)(L'a' + (tuc_hi - 10))); --ptr; - #else - ptr[0] = mk_sl_cui_inl_defd_symbols_hex_b[tuc_hi]; --ptr; - #endif - if(zero){ break; } + return 0; /* todo return negative? */ } - ret = str_len - rem; - if(ret != str_len) + xx = *x; + ptr = &str[mk_sl_cui_inl_defd_strlenbin_v - 1]; ++ptr; + for(i = 0; i != mk_sl_cui_inl_defd_strlenbin_v; ++i) { - mk_sl_cui_inl_filec_memmove_wc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); + lsb = mk_sl_cui_inl_defd_has_lsb(&xx); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_bin_b[lsb ? 1 : 0]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = ((mk_lang_types_pchar_t)(L'0' + (lsb ? 1 : 0))); + #endif + mk_sl_cui_inl_defd_shr2(&xx, 1); } - return ret; -}} - -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_hex_c[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + mk_lang_assert(mk_sl_cui_inl_defd_is_zero(&xx)); + return mk_sl_cui_inl_defd_strlenbin_v; #endif +} -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hexf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hexf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { +#if mk_sl_cui_inl_defd_count == 1 + mk_lang_assert(x); + mk_lang_assert(str || str_len == 0); + mk_lang_assert(str_len >= 0); + + return mk_sl_cui_inl_defd_base_to_str_hexf_n(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; - mk_lang_types_sint_t n mk_lang_constexpr_init; mk_lang_types_sint_t i mk_lang_constexpr_init; mk_lang_types_uchar_t tuc mk_lang_constexpr_init; mk_lang_types_uchar_t tuc_lo mk_lang_constexpr_init; mk_lang_types_uchar_t tuc_hi mk_lang_constexpr_init; - mk_lang_static_assert(mk_sl_cui_inl_defd_strlenhex_v % 2 == 0); - mk_lang_static_assert(mk_lang_charbit % 2 == 0); + mk_lang_static_assert(mk_lang_charbit == 8); + mk_lang_static_assert(mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit / 2); mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - if(!(str_len >= mk_sl_cui_inl_defd_strlenhex_v)){ return 0; } /* todo return negative? */ + if(!(str_len >= mk_sl_cui_inl_defd_strlenhex_v)) + { + return 0; /* todo return negative? */ + } xx = *x; - ptr = &str[mk_sl_cui_inl_defd_strlenhex_v - 1]; - n = mk_sl_cui_inl_defd_strlenhex_v / 2; - for(i = 0; i != n; ++i) + ptr = &str[mk_sl_cui_inl_defd_strlenhex_v - 1]; ++ptr; + for(i = 0; i != mk_sl_cui_inl_defd_strlenhex_v / 2; ++i) { mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); + tuc_lo = ((mk_lang_types_uchar_t)((tuc >> (0 * 4)) & 0xf)); + tuc_hi = ((mk_lang_types_uchar_t)((tuc >> (1 * 4)) & 0xf)); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_a[tuc_lo]; + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_a[tuc_hi]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_lo)) : ((mk_lang_types_pchar_t)('a' + (tuc_lo - 10))); + --ptr; ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_hi)) : ((mk_lang_types_pchar_t)('a' + (tuc_hi - 10))); + #endif + #if mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit); + #else mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); - tuc_lo = ((mk_lang_types_uchar_t)((tuc >> 0) & 0xf)); - tuc_hi = ((mk_lang_types_uchar_t)((tuc >> 4) & 0xf)); - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_lo)) : ((mk_lang_types_pchar_t)('a' + (tuc_lo - 10))); --ptr; - ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_pchar_t)('0' + tuc_hi)) : ((mk_lang_types_pchar_t)('a' + (tuc_hi - 10))); --ptr; - #else - ptr[0] = mk_sl_cui_inl_defd_symbols_hex_c[tuc_lo]; --ptr; - ptr[0] = mk_sl_cui_inl_defd_symbols_hex_c[tuc_hi]; --ptr; #endif } + mk_lang_assert(mk_sl_cui_inl_defd_is_zero(&xx)); return mk_sl_cui_inl_defd_strlenhex_v; -}} - -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_bin_a[] = {'0', '1'}; #endif +} -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_bin_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hexf_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { - mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; - mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; - mk_lang_types_sint_t rem mk_lang_constexpr_init; - mk_lang_types_bool_t lsb mk_lang_constexpr_init; - mk_lang_types_sint_t ret mk_lang_constexpr_init; - +#if mk_sl_cui_inl_defd_count == 1 mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - xx = *x; - ptr = &str[str_len - 1]; - rem = str_len; - for(;;) - { - if(rem == 0){ return 0; } --rem; /* todo return negative? */ - lsb = mk_sl_cui_inl_defd_has_lsb(&xx); - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = ((mk_lang_types_pchar_t)('0' + (lsb ? 1 : 0))); --ptr; - #else - ptr[0] = mk_sl_cui_inl_defd_symbols_bin_a[lsb ? 1 : 0]; --ptr; - #endif - mk_sl_cui_inl_defd_shr2(&xx, 1); - if(mk_sl_cui_inl_defd_is_zero(&xx)) - { - break; - } - } - ret = str_len - rem; - if(ret != str_len) - { - mk_sl_cui_inl_filec_memmove_pc_fn(&str[0], &str[str_len - ret], ((mk_lang_types_usize_t)(ret))); - } - return ret; -}} - -#if !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic -mk_lang_constexpr_static_inline mk_lang_types_pchar_t const mk_sl_cui_inl_defd_symbols_bin_b[] = {'0', '1'}; -#endif - -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_binf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept { mk_sl_cui_inl_defd_flatten -{ + return mk_sl_cui_inl_defd_base_to_str_hexf_w(&x->m_data[mk_sl_cui_inl_defd_idx(0)], str, str_len); +#else mk_sl_cui_inl_defd_t xx mk_lang_constexpr_init; - mk_lang_types_pchar_pt ptr mk_lang_constexpr_init; - mk_lang_types_sint_t n mk_lang_constexpr_init; + mk_lang_types_wchar_pt ptr mk_lang_constexpr_init; mk_lang_types_sint_t i mk_lang_constexpr_init; - mk_lang_types_bool_t lsb mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc_lo mk_lang_constexpr_init; + mk_lang_types_uchar_t tuc_hi mk_lang_constexpr_init; + + mk_lang_static_assert(mk_lang_charbit == 8); + mk_lang_static_assert(mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit / 2); mk_lang_assert(x); mk_lang_assert(str || str_len == 0); mk_lang_assert(str_len >= 0); - if(!(str_len >= mk_sl_cui_inl_defd_strlenbin_v)){ return 0; } /* todo return negative? */ + if(!(str_len >= mk_sl_cui_inl_defd_strlenhex_v)) + { + return 0; /* todo return negative? */ + } xx = *x; - ptr = &str[mk_sl_cui_inl_defd_strlenbin_v - 1]; - n = mk_sl_cui_inl_defd_strlenbin_v; - for(i = 0; i != n; ++i) + ptr = &str[mk_sl_cui_inl_defd_strlenhex_v - 1]; ++ptr; + for(i = 0; i != mk_sl_cui_inl_defd_strlenhex_v / 2; ++i) { - lsb = mk_sl_cui_inl_defd_has_lsb(&xx); - #if mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic - ptr[0] = ((mk_lang_types_pchar_t)('0' + (lsb ? 1 : 0))); --ptr; + mk_sl_cui_inl_defd_to_bi_uchar(&xx, &tuc); + tuc_lo = ((mk_lang_types_uchar_t)((tuc >> (0 * 4)) & 0xf)); + tuc_hi = ((mk_lang_types_uchar_t)((tuc >> (1 * 4)) & 0xf)); + #if (mk_sl_cui_inl_defd_str_style == 1001) || (mk_sl_cui_inl_defd_str_style == 1003 && !mk_lang_encoding_is_ascii && !mk_lang_encoding_is_ebcdic) + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_b[tuc_lo]; + --ptr; ptr[0] = mk_sl_cui_inl_defd_symbols_hex_b[tuc_hi]; + #elif (mk_sl_cui_inl_defd_str_style == 1002) || (mk_sl_cui_inl_defd_str_style == 1003 && (mk_lang_encoding_is_ascii || mk_lang_encoding_is_ebcdic)) + --ptr; ptr[0] = (tuc_lo >= 0 && tuc_lo <= 9) ? ((mk_lang_types_pchar_t)(L'0' + tuc_lo)) : ((mk_lang_types_pchar_t)(L'a' + (tuc_lo - 10))); + --ptr; ptr[0] = (tuc_hi >= 0 && tuc_hi <= 9) ? ((mk_lang_types_pchar_t)(L'0' + tuc_hi)) : ((mk_lang_types_pchar_t)(L'a' + (tuc_hi - 10))); + #endif + #if mk_sl_cui_inl_defd_sizebits_d > mk_lang_charbit + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit); #else - ptr[0] = mk_sl_cui_inl_defd_symbols_bin_b[lsb ? 1 : 0]; --ptr; + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); + mk_sl_cui_inl_defd_shr2(&xx, mk_lang_charbit / 2); #endif - mk_sl_cui_inl_defd_shr2(&xx, 1); } - return mk_sl_cui_inl_defd_strlenbin_v; -}} + mk_lang_assert(mk_sl_cui_inl_defd_is_zero(&xx)); + return mk_sl_cui_inl_defd_strlenhex_v; +#endif +} + #undef mk_sl_cui_inl_defd_t1_sizebits_d #undef mk_sl_cui_inl_defd_t2_sizebits_d @@ -4388,4 +5467,5 @@ mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noali #undef mk_sl_cui_t_endian #undef mk_sl_cui_t_disable_big_div #undef mk_sl_cui_t_base_sizebits_d +#undef mk_sl_cui_t_str_style #undef mk_sl_cui_t_inline diff --git a/mk_clib/src/mk_sl_cui_inl_fileh.h.m4 b/mk_clib/src/mk_sl_cui_inl_fileh.h.m4 index c021af5..e59d526 100644 --- a/mk_clib/src/mk_sl_cui_inl_fileh.h.m4 +++ b/mk_clib/src/mk_sl_cui_inl_fileh.h.m4 @@ -23,10 +23,10 @@ typedef mk_sl_cui_inl_defd_t* mk_lang_restrict mk_sl_cui_inl_defd_prt; typedef mk_sl_cui_inl_defd_t const* mk_sl_cui_inl_defd_pct; typedef mk_sl_cui_inl_defd_t const* mk_lang_restrict mk_sl_cui_inl_defd_prct; -enum mk_sl_cui_inl_defd_sizebits_e{ mk_sl_cui_inl_defd_sizebits_v = mk_sl_cui_inl_defd_sizebits_d }; -typedef enum mk_sl_cui_inl_defd_sizebits_e mk_sl_cui_inl_defd_sizebits_t; +enum mk_sl_cui_inl_defd_sizebits_e{ mk_sl_cui_inl_defd_sizebits_v = mk_sl_cui_inl_defd_sizebits_d }; typedef enum mk_sl_cui_inl_defd_sizebits_e mk_sl_cui_inl_defd_sizebits_t; enum mk_sl_cui_inl_defd_strlenbin_e{ mk_sl_cui_inl_defd_strlenbin_v = mk_sl_cui_inl_defd_strlenbin_d }; typedef enum mk_sl_cui_inl_defd_strlenbin_e mk_sl_cui_inl_defd_strlenbin_t; +enum mk_sl_cui_inl_defd_strlenoct_e{ mk_sl_cui_inl_defd_strlenoct_v = mk_sl_cui_inl_defd_strlenoct_d }; typedef enum mk_sl_cui_inl_defd_strlenoct_e mk_sl_cui_inl_defd_strlenoct_t; enum mk_sl_cui_inl_defd_strlendec_e{ mk_sl_cui_inl_defd_strlendec_v = mk_sl_cui_inl_defd_strlendec_d }; typedef enum mk_sl_cui_inl_defd_strlendec_e mk_sl_cui_inl_defd_strlendec_t; enum mk_sl_cui_inl_defd_strlenhex_e{ mk_sl_cui_inl_defd_strlenhex_v = mk_sl_cui_inl_defd_strlenhex_d }; typedef enum mk_sl_cui_inl_defd_strlenhex_e mk_sl_cui_inl_defd_strlenhex_t; @@ -125,15 +125,26 @@ mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo m mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_void_t mk_sl_cui_inl_defd_div2_wrap(mk_sl_cui_inl_defd_pt const a, mk_sl_cui_inl_defd_pct const b) mk_lang_noexcept; mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_void_t mk_sl_cui_inl_defd_mod2_wrap(mk_sl_cui_inl_defd_pt const a, mk_sl_cui_inl_defd_pct const b) mk_lang_noexcept; mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_void_t mk_sl_cui_inl_defd_divmod2_wrap(mk_sl_cui_inl_defd_pt const a, mk_sl_cui_inl_defd_pt const b) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_bin_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_bin_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_bin_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_bin_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_oct_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_oct_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_oct_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_oct_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_dec_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_dec_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_dec_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hex_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hex_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hexf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; -mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_bin_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_hex_n(mk_sl_cui_inl_defd_pt const x, mk_lang_types_pchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_from_str_hex_w(mk_sl_cui_inl_defd_pt const x, mk_lang_types_wchar_pct const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_binf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_binf_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hexf_n(mk_sl_cui_inl_defd_pct const x, mk_lang_types_pchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; +mk_lang_nodiscard mk_sl_cui_inl_defd_forceinline mk_lang_constexpr mk_lang_noalias mk_lang_jumbo mk_lang_types_sint_t mk_sl_cui_inl_defd_to_str_hexf_w(mk_sl_cui_inl_defd_pct const x, mk_lang_types_wchar_pt const str, mk_lang_types_sint_t const str_len) mk_lang_noexcept; #include "mk_sl_cui_inl_defu.h"