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

Fix compilation error on RedHat when compiling with -Werror=sign-conversion #508

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions src/ddscxx/tests/QosProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ static uint32_t b64_encode (const unsigned char *text, const uint32_t sz, unsign
unsigned char chunk[4] = {0x00, 0x00, 0x00, 0x00};
size_t cp_sz = (sz - j);
unsigned char tmp[3] = {text[j], static_cast<unsigned char>(((cp_sz > 1)? text[j+1]: 0x00)), static_cast<unsigned char>((cp_sz > 2)? text[j+2]: 0x00)};
chunk[3] = base64_etable[tmp[2] & 0x3FU];
chunk[2] = base64_etable[((tmp[1] & 0x0FU) << 0x02U) | (tmp[2] & 0xC0U) >> 0x06U];
chunk[1] = base64_etable[((tmp[0] & 0x03U) << 0x04U) | (tmp[1] >> 0x04U)];
chunk[0] = base64_etable[(tmp[0] >> 0x02U)];
chunk[3] = base64_etable[tmp[2] & 0x3F];
chunk[2] = base64_etable[((tmp[1] & 0x0F) << 0x02) | (tmp[2] & 0xC0) >> 0x06];
chunk[1] = base64_etable[((tmp[0] & 0x03) << 0x04) | (tmp[1] >> 0x04)];
chunk[0] = base64_etable[(tmp[0] >> 0x02)];
(void) memcpy(*(buff)+i, chunk, cp_sz < 3? cp_sz + 1: 4U);
}

Expand Down
Loading