Repository navigation
refactor(sdk)!: replace legacy utility macros with standard calls - #112
Merged
Merged
Conversation
Use std::to_string for existing data and endpoint conversions and std::size for bounded lookup arrays, with direct standard-library includes. Preserve argument types, numeric formatting, lookup storage types, enum mappings and range checks. Remove the unused static-assert and byte-clearing aliases, and document source migration in English and Chinese without changing the remaining macro contracts. BREAKING CHANGE: ARK_TO_STRING, ARRAY_LENTGH, ARK_SRATIC_ASSERT, ARRAY_CLEAR, MEMORY_CLEAR and MEMORY_CLEAR_POINTER are no longer defined. Use std::to_string, std::size or the appropriate type-extent query, and static_assert directly. Downstream uses of the clearing helpers must select a reset operation suitable for their storage contract; MEMORY_CLEAR_POINTER contained an invalid 0xx token.
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.
Existing numeric and endpoint conversions now call
std::to_stringdirectly, and the three bounded-array lookup counts usestd::sizewith direct<string>/<iterator>includes. The conversion argument types, C++20 formatting and precision,intcount variables, enum lookup order and range handling are preserved.Remove the six public macro names
ARK_TO_STRING,ARRAY_LENTGH,ARK_SRATIC_ASSERT,ARRAY_CLEAR,MEMORY_CLEARandMEMORY_CLEAR_POINTER. The last four have no in-repository call sites; the pointer-clearing definition contained the invalid0xxtoken. English and Chinese guides explain the source migration. Allocation, ownership, runtime assertions, platform behavior, plugin registration and byte order are unchanged. No test source, build configuration or dependency pin changes are included.Validation on macOS arm64 / Apple Clang 21 / Debug / Boost.Asio:
check-network(including itscheck-coredependency) passed: core 50 cases / 2728 assertions; network and endpoint 37 cases / 955 assertions; existing subordinate module and launcher regressions passed.argsandnlohmann_jsondiscovery disabled.The local profile explicitly disables etcd because JSON is unavailable; it does not establish local etcd validation. Linux, Windows, AddressSanitizer, ThreadSanitizer and hosted merge-candidate acceptance remain for CI.
BREAKING CHANGE: The six public utility macros are removed. Use
std::to_stringfrom<string>,std::sizefrom<iterator>for bounded arrays (orstd::extent_v<T>for a type query), andstatic_assertdirectly. Downstream users of the clearing helpers must choose a reset operation appropriate to their storage contract; no universal replacement alias is supplied.Tested commit:
109da0a80973132a931031f866400166d1ec423d; tree:52f43e59ac394b8f89f40d803597b2566695bff7.