Skip to content
Snippets Groups Projects
Commit 21dfdcdb authored by Keisuke Kuroynagi's avatar Keisuke Kuroynagi Committed by Android (Google) Code Review
Browse files

Merge "Add ByteArrayUtils::readSignedInt24andAdvancePosition to read dynamic dictionaries."

parents e105fdfa 8a914a66
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,17 @@ class ByteArrayUtils {
return value;
}
static AK_FORCE_INLINE int readSint24andAdvancePosition(
const uint8_t *const buffer, int *const pos) {
const uint8_t value = readUint8(buffer, *pos);
if (value < 0x80) {
return readUint24andAdvancePosition(buffer, pos);
} else {
(*pos)++;
return -(((value & 0x7F) << 16) ^ readUint16andAdvancePosition(buffer, pos));
}
}
static AK_FORCE_INLINE uint32_t readUint24andAdvancePosition(
const uint8_t *const buffer, int *const pos) {
const uint32_t value = readUint24(buffer, *pos);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment