Conversation
* Refactor: Simplify range type constraints in pipelines * Add contract validation utility with corresponding tests Introduce a `daw::contract` class for validating preconditions at runtime. Includes a failure handler * Refactor contract tests to handle exceptions conditionally. * Add support for counting leading zeros in uint128_t Introduce a constexpr function to handle leading zero count for uint128_t, ensuring compatibility with larger integers. Additionally, adjust `ToIota` initialization for consistency with type defaults. * Refactor `count_leading_zeroes` handling for better builtin usage Introduced support for `__builtin_clzg` where available, improving compatibility and performance. Removed redundant overloads and reorganized function definitions to streamline the implementation. This cleanup simplifies the logic while maintaining backward compatibility. * Fix count_leading_zeroes for zero input handling Previously, calling count_leading_zeroes with a zero input could lead to undefined behavior. This update adds a check for zero inputs and returns the bit count for the type in such cases, ensuring correct results and improved safety. * Update LLVM repo URLs in CI for Ubuntu 24.04 workflows Replaced 'jammy' with 'noble' in LLVM repository URLs to match the correct distribution for Ubuntu 24.04. * Added missing conditional for `daw::uint128` with `DAW_HAS_INT128`. * Streamline CI by removing outdated compiler toolsets * Fix incorrect handling of zero in count_leading_zeroes. * Update macro check for built-in function in count_leading_zeroes. Replaced `__has_builtin` with `DAW_HAS_BUILTIN` to ensure correct macro usage. This improves compatibility * Add ASCII utilities and corresponding tests Introduce utility functions for ASCII character checks and transformations, such as detecting digits, letters, alphanumerics, printable characters, and case conversion. Included a test file to verify the correctness of these utilities. * Fix ASCII printable check to include space character The previous logic excluded the space character (ASCII code 32) from being considered printable. This change modifies the comparison to include space, ensuring correct behavior for determining ASCII printable characters. * Add utility to convert enums to their underlying type Introduce `to_underlying_type` in `daw_to_underlying_type.h`, allowing seamless conversion of enums to their underlying integer type. This simplifies operations requiring direct manipulation of enum values. * Rename `to_underlying_type` to `to_underlying` * Refactor `function_ref` to handle null-thunk pointers as it isn't needed for fp's passed. * Fix type handling and formatting in `count_digits` and `count_leading_zeroes`. * Fix formatting in `basic_string_view` and adjust logic for conditional compilation. * Update CI for Windows to use Visual Studio 2022 toolset * Refactor Windows CI workflows: merge `ci_windows_clangcl.yml` into `ci_windows.yml`, add improved matrix configuration, and update build/test steps for better toolset coverage. * Update Windows CI workflow to build `daw-header-libraries_full` target instead of `ci_tests` * Simplify `append_hash` logic in `daw_fnv1a_hash.h` by extracting `current_char` computation. * Undid change to string_view * Ensuring msvc::no_unique_address is used for clang-cl * Add `-Wno-missing-braces` compiler option to suppress warnings * Remove unnecessary `constexpr` in `formatter::parse` signature * Refactor `append_hash` to use `array_t` for byte extraction, simplifying logic. * Change `operator""` return type from `size_t` to `unsigned long long` in `daw_size_literals` for consistency with input type. * Refine aggregate initialization in `daw_uninitialized_storage` by checking for class types. * - Move `daw_contract_test.cpp` to `CPP20_NOT_MSVC_TEST_SOURCES` in CMakeLists. - Add MSVC-friendly file handling in `daw_read_file.h` with `fopen_s` and `_wfopen_s`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor: Simplify range type constraints in pipelines
Add contract validation utility with corresponding tests
Introduce a
daw::contractclass for validating preconditions at runtime. Includes a failure handlerRefactor contract tests to handle exceptions conditionally.
Add support for counting leading zeros in uint128_t
Introduce a constexpr function to handle leading zero count for uint128_t, ensuring compatibility with larger integers. Additionally, adjust
ToIotainitialization for consistency with type defaults.count_leading_zeroeshandling for better builtin usageIntroduced support for
__builtin_clzgwhere available, improving compatibility and performance. Removed redundant overloads and reorganized function definitions to streamline the implementation. This cleanup simplifies the logic while maintaining backward compatibility.Previously, calling count_leading_zeroes with a zero input could lead to undefined behavior. This update adds a check for zero inputs and returns the bit count for the type in such cases, ensuring correct results and improved safety.
Replaced 'jammy' with 'noble' in LLVM repository URLs to match the correct distribution for Ubuntu 24.04.
Added missing conditional for
daw::uint128withDAW_HAS_INT128.Streamline CI by removing outdated compiler toolsets
Fix incorrect handling of zero in count_leading_zeroes.
Update macro check for built-in function in count_leading_zeroes.
Replaced
__has_builtinwithDAW_HAS_BUILTINto ensure correct macro usage. This improves compatibilityIntroduce utility functions for ASCII character checks and transformations, such as detecting digits, letters, alphanumerics, printable characters, and case conversion. Included a test file to verify the correctness of these utilities.
The previous logic excluded the space character (ASCII code 32) from being considered printable. This change modifies the comparison to include space, ensuring correct behavior for determining ASCII printable characters.
Introduce
to_underlying_typeindaw_to_underlying_type.h, allowing seamless conversion of enums to their underlying integer type. This simplifies operations requiring direct manipulation of enum values.Rename
to_underlying_typetoto_underlyingRefactor
function_refto handle null-thunk pointers as it isn't needed for fp's passed.Fix type handling and formatting in
count_digitsandcount_leading_zeroes.Fix formatting in
basic_string_viewand adjust logic for conditional compilation.Update CI for Windows to use Visual Studio 2022 toolset
Refactor Windows CI workflows: merge
ci_windows_clangcl.ymlintoci_windows.yml, add improved matrix configuration, and update build/test steps for better toolset coverage.Update Windows CI workflow to build
daw-header-libraries_fulltarget instead ofci_testsSimplify
append_hashlogic indaw_fnv1a_hash.hby extractingcurrent_charcomputation.Undid change to string_view
Ensuring msvc::no_unique_address is used for clang-cl
Add
-Wno-missing-bracescompiler option to suppress warningsRemove unnecessary
constexprinformatter::parsesignatureRefactor
append_hashto usearray_tfor byte extraction, simplifying logic.Change
operator""return type fromsize_ttounsigned long longindaw_size_literalsfor consistency with input type.Refine aggregate initialization in
daw_uninitialized_storageby checking for class types.daw_contract_test.cpptoCPP20_NOT_MSVC_TEST_SOURCESin CMakeLists.daw_read_file.hwithfopen_sand_wfopen_s.