Skip to content

Added math, ascii, enum help and bigfixes (#549)#550

Merged
beached merged 1 commit intov2from
master
Jul 4, 2025
Merged

Added math, ascii, enum help and bigfixes (#549)#550
beached merged 1 commit intov2from
master

Conversation

@beached
Copy link
Copy Markdown
Owner

@beached beached commented Jul 4, 2025

  • 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.

* 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`.
@beached beached merged commit ced571d into v2 Jul 4, 2025
31 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant