Skip to content

refactor(sdk)!: replace legacy utility macros with standard calls - #112

Merged
nick2781 merged 1 commit into
mainfrom
refactor/standard-utility-calls
Oct 21, 2026
Merged

nick2781 merged 1 commit into
mainfrom
refactor/standard-utility-calls

Conversation

@nick2781

Copy link
Copy Markdown
Member

Existing numeric and endpoint conversions now call std::to_string directly, and the three bounded-array lookup counts use std::size with direct <string> / <iterator> includes. The conversion argument types, C++20 formatting and precision, int count 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_CLEAR and MEMORY_CLEAR_POINTER. The last four have no in-repository call sites; the pointer-clearing definition contained the invalid 0xx token. 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:

  • Full selected application, plugin, example and test build passed using installed package targets and installed toml++.
  • Existing check-network (including its check-core dependency) passed: core 50 cases / 2728 assertions; network and endpoint 37 cases / 955 assertions; existing subordinate module and launcher regressions passed.
  • Existing external SDK consumer passed with application-only args and nlohmann_json discovery disabled.
  • clang-format 18.1.8, 87 CI policy tests, local README file links, and bilingual Nimbus checks (127 pages / 233 internal references) passed.

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_string from <string>, std::size from <iterator> for bounded arrays (or std::extent_v<T> for a type query), and static_assert directly. 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.

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.
@nick2781
nick2781 enabled auto-merge October 21, 2026 01:44
@nick2781
nick2781 added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit cf5daed Oct 21, 2026
6 checks passed
@nick2781
nick2781 deleted the refactor/standard-utility-calls branch October 21, 2026 03:01
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