aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-09 04:23:17 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-09 04:23:17 +0000
commitefdbc402fb8a3d03ad5b73c9a80ccf1918ea8a46 (patch)
treef3b5e4a2a8837ef15994efd102e37c4bd507f535
parentd18966c80cae259f773488fbfd286d377d5a29b1 (diff)
parente5d47964958f415d251d8c998af574c7ae96e1d2 (diff)
downloadlibcppbor-android14-qpr2-s2-release.tar.gz
Change-Id: Ia721a21fa8113e8a76fcb12aa3f0cfe4e087869a
-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: