aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Wasilczyk <twasilczyk@google.com>2023-12-08 03:51:22 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-12-08 03:51:22 +0000
commite5d47964958f415d251d8c998af574c7ae96e1d2 (patch)
treef3b5e4a2a8837ef15994efd102e37c4bd507f535
parentd18966c80cae259f773488fbfd286d377d5a29b1 (diff)
parent6ff2702afa4d41f3c7790c13ff6943645ec20053 (diff)
downloadlibcppbor-e5d47964958f415d251d8c998af574c7ae96e1d2.tar.gz
Fix C++20 build am: a643b02bdf am: 6972573279 am: 6ff2702afa
Original change: https://android-review.googlesource.com/c/platform/system/libcppbor/+/2863810 Change-Id: I2fe10775ef7b9fc9762ebc888dab8afa3fc37d5e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--src/cppbor.cpp16
1 files 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<uint8_t>(addlInfo);
return pos;
case 2:
- *pos++ = type | ONE_BYTE_LENGTH;
+ *pos++ = type | static_cast<MajorType>(ONE_BYTE_LENGTH);
*pos++ = static_cast<uint8_t>(addlInfo);
return pos;
case 3:
- *pos++ = type | TWO_BYTE_LENGTH;
+ *pos++ = type | static_cast<MajorType>(TWO_BYTE_LENGTH);
return writeBigEndian(static_cast<uint16_t>(addlInfo), pos);
case 5:
- *pos++ = type | FOUR_BYTE_LENGTH;
+ *pos++ = type | static_cast<MajorType>(FOUR_BYTE_LENGTH);
return writeBigEndian(static_cast<uint32_t>(addlInfo), pos);
case 9:
- *pos++ = type | EIGHT_BYTE_LENGTH;
+ *pos++ = type | static_cast<MajorType>(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<uint8_t>(addlInfo));
break;
case 2:
- encodeCallback(type | ONE_BYTE_LENGTH);
+ encodeCallback(type | static_cast<MajorType>(ONE_BYTE_LENGTH));
encodeCallback(static_cast<uint8_t>(addlInfo));
break;
case 3:
- encodeCallback(type | TWO_BYTE_LENGTH);
+ encodeCallback(type | static_cast<MajorType>(TWO_BYTE_LENGTH));
writeBigEndian(static_cast<uint16_t>(addlInfo), encodeCallback);
break;
case 5:
- encodeCallback(type | FOUR_BYTE_LENGTH);
+ encodeCallback(type | static_cast<MajorType>(FOUR_BYTE_LENGTH));
writeBigEndian(static_cast<uint32_t>(addlInfo), encodeCallback);
break;
case 9:
- encodeCallback(type | EIGHT_BYTE_LENGTH);
+ encodeCallback(type | static_cast<MajorType>(EIGHT_BYTE_LENGTH));
writeBigEndian(addlInfo, encodeCallback);
break;
default: