Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang-tidy fix clp::ffi namespace top level folder files and related test cases #509

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix std::cout printing char instead of int
Bill-hbrhbr committed Aug 10, 2024
commit 51bb3ccdd3ba11e1638bb8adfbd2e95f1516f8b5
4 changes: 3 additions & 1 deletion components/core/src/clp/ffi/utils.cpp
Original file line number Diff line number Diff line change
@@ -61,7 +61,9 @@ auto validate_and_append_escaped_utf8_string(string_view src, string& dst) -> bo
auto const byte{static_cast<uint8_t>(*it)};
if (cLargestControlCharacter >= byte) {
std::stringstream ss;
ss << "\\u00" << std::hex << std::setw(2) << std::setfill('0') << byte;
// Add `+` in front of byte so that stringstream treat it as a char instead of
// a character (uint8_t is equivalent to unsigned char).
ss << "\\u00" << std::hex << std::setw(2) << std::setfill('0') << +byte;
escaped_char = {ss.str().substr(0, cControlCharacterMaxSize)};
} else {
escape_required = false;