Skip to content

Commit

Permalink
πŸ“† Update copyright year!
Browse files Browse the repository at this point in the history
β€” πŸ’š Remove redundant .clang-format entries
β€” 🎨 Shift around implementation of cuneicode benchmarks and improve error reporting
β€” πŸ›  Fix up boost.text benchmarks and examples to compile with less extra effort about its warnings and other issues
  • Loading branch information
ThePhD committed Jan 3, 2024
1 parent c07fba7 commit 9996554
Show file tree
Hide file tree
Showing 618 changed files with 1,391 additions and 1,095 deletions.
3 changes: 1 addition & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: false
AfterStruct: false
AfterUnion: false
AfterControlStatement: false
AfterClass: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
BeforeElse: true
BeforeCatch: true
IndentBraces: false
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: [email protected]
#
# Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: [email protected]
#
# Commercial License Usage
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: [email protected]
#
# Commercial License Usage
Expand Down Expand Up @@ -107,6 +107,7 @@ if(ZTD_TEXT_IS_TOP_LEVEL_PROJECT)
# Warning flags
check_compiler_flag(warn-pedantic MSVC /permissive- GCC -pedantic)
check_compiler_flag(warn-all MSVC /W4 GCC -Wall)
check_compiler_flag(warn-none MSVC /W0 GCC -w Clang -w)
check_compiler_flag(warn-errors MSVC /WX GCC -Werror)
check_compiler_flag(warn-extra GCC -Wextra Clang -Wextra)
check_compiler_diagnostic(alignas-extra-padding MSVC 4324 LANGUAGES CXX)
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ztd.text
Non-Commerical License
Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Contact: [email protected]


Expand Down Expand Up @@ -68,7 +68,7 @@ END OF TERMS AND CONDITIONS

ztd.text
Commerical License Usage
Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Contact: [email protected]


Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ztd.text
Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Contact: [email protected]

This product includes software developed at
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: [email protected]
#
# Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: [email protected]
#
# Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/include/barrier/api.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// =============================================================================
//
// ztd.idk
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/include/barrier/barrier.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/include/barrier/convert.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/include/barrier/data.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/include/barrier/version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/source/convert.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
15 changes: 9 additions & 6 deletions benchmarks/barrier/source/data.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down Expand Up @@ -53,7 +53,7 @@ static auto init_u8_unicode_data() {
const ztd_char32_t* input = &c;
size_t input_size = 1;
size_t output_size = ztdc_c_array_size(output_buffer);
cnc_mcerr err = cnc_c32ntoc8n(&output_size, &output, &input_size, &input);
cnc_mcerr err = cnc_c32ntoc8n(&output_size, &output, &input_size, &input);
if (err != cnc_mcerr_ok) {
throw std::runtime_error("bad idea");
}
Expand All @@ -80,7 +80,7 @@ static auto init_u16_unicode_data() {
const ztd_char32_t* input = &c;
size_t input_size = 1;
size_t output_size = ztdc_c_array_size(output_buffer);
cnc_mcerr err = cnc_c32ntoc16n(&output_size, &output, &input_size, &input);
cnc_mcerr err = cnc_c32ntoc16n(&output_size, &output, &input_size, &input);
if (err != cnc_mcerr_ok) {
throw std::runtime_error("bad idea");
}
Expand Down Expand Up @@ -121,17 +121,20 @@ ZTD_TEXT_BENCHMARKS_BARRIER_API_LINKAGE_I_ c_span_char32_t u32_unicode_data
= make_c_span_char32_t(u32_unicode_vec.data(), u32_unicode_vec.data() + u32_unicode_vec.size());

static auto init_u8_basic_source_data() {
std::vector<ztd_char8_t> data(ztd::tests::u8_basic_source_character_set.cbegin(), ztd::tests::u8_basic_source_character_set.cend());
std::vector<ztd_char8_t> data(
ztd::tests::u8_basic_source_character_set.cbegin(), ztd::tests::u8_basic_source_character_set.cend());
return data;
}

static auto init_u16_basic_source_data() {
std::vector<ztd_char16_t> data(ztd::tests::u16_basic_source_character_set.cbegin(), ztd::tests::u16_basic_source_character_set.cend());
std::vector<ztd_char16_t> data(
ztd::tests::u16_basic_source_character_set.cbegin(), ztd::tests::u16_basic_source_character_set.cend());
return data;
}

static auto init_u32_basic_source_data() {
std::vector<ztd_char32_t> data(ztd::tests::u32_basic_source_character_set.cbegin(), ztd::tests::u32_basic_source_character_set.cend());
std::vector<ztd_char32_t> data(
ztd::tests::u32_basic_source_character_set.cbegin(), ztd::tests::u32_basic_source_character_set.cend());
return data;
}

Expand Down
15 changes: 12 additions & 3 deletions benchmarks/conversion_speed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: [email protected]
#
# Commercial License Usage
Expand Down Expand Up @@ -33,6 +33,8 @@ file(GLOB_RECURSE ztd.text.benchmarks.conversion_speed.sources
CONFIGURE_DEPENDS
LIST_DIRECTORIES NO
source/**)
set(ztd.text.benchmarks.conversion_speed.sources.no_warnings ${ztd.text.benchmarks.conversion_speed.sources})
list(FILTER ztd.text.benchmarks.conversion_speed.sources.no_warnings INCLUDE REGEX ".*\.no_warnings\..*")

function (generate_converion_speed_benchmark_targets name data_name title)
add_executable(ztd.text.benchmarks.conversion_speed.${name} ${ztd.text.benchmarks.conversion_speed.sources})
Expand All @@ -49,11 +51,18 @@ function (generate_converion_speed_benchmark_targets name data_name title)
ztd::cuneicode::shared::simdutf
ztd::text
ctre::ctre
utf8::cpp
utf8cpp
$<$<BOOL:${ZTD_TEXT_BOOST.TEXT}>:Boost::text>
benchmark::benchmark
${CMAKE_DL_LIBS}
)
# boost.text is a landmine of bad warning-vomiting code
if (ztd.text.benchmarks.conversion_speed.sources.no_warnings)
set_source_files_properties(${ztd.text.benchmarks.conversion_speed.sources.no_warnings}
PROPERTIES
COMPILE_OPTIONS ${--warn-none}
)
endif()
target_compile_options(ztd.text.benchmarks.conversion_speed.${name}
PRIVATE
${--utf8-literal-encoding}
Expand All @@ -67,7 +76,7 @@ function (generate_converion_speed_benchmark_targets name data_name title)
${--allow-alignas-extra-padding}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
)
target_compile_definitions(ztd.text.benchmarks.conversion_speed.${name}
PRIVATE
u8_data=u8_${data_name}_data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// =============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down Expand Up @@ -52,7 +52,7 @@
using UToErrorHandler = ztd::remove_cvref_t<ToErrorHandler>; \
using UPivot = ztd::remove_cvref_t<Pivot>; \
using TranscodeResult \
= ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>; \
= ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>; \
if constexpr (ztd::text::is_ignorable_error_handler_v<UFromErrorHandler> /* cf */ \
&& ztd::text::is_ignorable_error_handler_v<UToErrorHandler>) { \
const std::size_t written_chars = (ztd::endian::native == ztd::endian::big \
Expand Down Expand Up @@ -96,7 +96,7 @@
using UToErrorHandler = ztd::remove_cvref_t<ToErrorHandler>; \
using UPivot = ztd::remove_cvref_t<Pivot>; \
using TranscodeResult \
= ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>; \
= ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>; \
if constexpr (!ztd::text::is_ignorable_error_handler_v<UFromErrorHandler> /* cf */ \
|| !ztd::text::is_ignorable_error_handler_v<UToErrorHandler>) { \
const simdutf::result validate_res = (ztd::endian::native == ztd::endian::big \
Expand Down Expand Up @@ -153,8 +153,7 @@ auto text_transcode(::ztd::tag<ztd::text::utf8_t, ztd::text::utf32_t>, ztd::span
using UFromErrorHandler = ztd::remove_cvref_t<FromErrorHandler>;
using UToErrorHandler = ztd::remove_cvref_t<ToErrorHandler>;
using UPivot = ztd::remove_cvref_t<Pivot>;
using TranscodeResult
= ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>;
using TranscodeResult = ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>;
constexpr bool no_error_handling = ztd::text::is_ignorable_error_handler_v<UFromErrorHandler> // cf
&& ztd::text::is_ignorable_error_handler_v<UToErrorHandler>;
if constexpr (no_error_handling) {
Expand Down Expand Up @@ -203,8 +202,7 @@ auto text_transcode(::ztd::tag<ztd::text::utf8_t, ztd::text::utf32_t>, ztd::span
using UFromErrorHandler = ztd::remove_cvref_t<FromErrorHandler>;
using UToErrorHandler = ztd::remove_cvref_t<ToErrorHandler>;
using UPivot = ztd::remove_cvref_t<Pivot>;
using TranscodeResult
= ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>;
using TranscodeResult = ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState, UPivot>;
constexpr bool no_error_handling = ztd::text::is_ignorable_error_handler_v<UFromErrorHandler> // cf
&& ztd::text::is_ignorable_error_handler_v<UToErrorHandler>;
if constexpr (!no_error_handling) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// =============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/conversion_speed/source/ctre.unchecked.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright Β© 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright Β© JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: [email protected]
//
// Commercial License Usage
Expand Down
Loading

0 comments on commit 9996554

Please sign in to comment.