From a643b02bdf9f41555c6ccb124bd46ec2a5485f53 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Mon, 4 Dec 2023 21:56:35 -0800 Subject: Fix C++20 build Bug: 311052584 Test: build Trusty Change-Id: Ie52a4e2d4a5ad5d53acf72b8925c2341a13a3cd6 --- src/cppbor.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cppbor.cpp b/src/cppbor.cpp index 9236d15..d916ce4 100644 --- a/src/cppbor.cpp +++ b/src/cppbor.cpp @@ -273,17 +273,17 @@ uint8_t* encodeHeader(MajorType type, uint64_t addlInfo, uint8_t* pos, const uin *pos++ = type | static_cast(addlInfo); return pos; case 2: - *pos++ = type | ONE_BYTE_LENGTH; + *pos++ = type | static_cast(ONE_BYTE_LENGTH); *pos++ = static_cast(addlInfo); return pos; case 3: - *pos++ = type | TWO_BYTE_LENGTH; + *pos++ = type | static_cast(TWO_BYTE_LENGTH); return writeBigEndian(static_cast(addlInfo), pos); case 5: - *pos++ = type | FOUR_BYTE_LENGTH; + *pos++ = type | static_cast(FOUR_BYTE_LENGTH); return writeBigEndian(static_cast(addlInfo), pos); case 9: - *pos++ = type | EIGHT_BYTE_LENGTH; + *pos++ = type | static_cast(EIGHT_BYTE_LENGTH); return writeBigEndian(addlInfo, pos); default: CHECK(false); // Impossible to get here. @@ -298,19 +298,19 @@ void encodeHeader(MajorType type, uint64_t addlInfo, EncodeCallback encodeCallba encodeCallback(type | static_cast(addlInfo)); break; case 2: - encodeCallback(type | ONE_BYTE_LENGTH); + encodeCallback(type | static_cast(ONE_BYTE_LENGTH)); encodeCallback(static_cast(addlInfo)); break; case 3: - encodeCallback(type | TWO_BYTE_LENGTH); + encodeCallback(type | static_cast(TWO_BYTE_LENGTH)); writeBigEndian(static_cast(addlInfo), encodeCallback); break; case 5: - encodeCallback(type | FOUR_BYTE_LENGTH); + encodeCallback(type | static_cast(FOUR_BYTE_LENGTH)); writeBigEndian(static_cast(addlInfo), encodeCallback); break; case 9: - encodeCallback(type | EIGHT_BYTE_LENGTH); + encodeCallback(type | static_cast(EIGHT_BYTE_LENGTH)); writeBigEndian(addlInfo, encodeCallback); break; default: -- cgit v1.2.3