mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-05-19 11:45:31 +01:00
update CSpot
This commit is contained in:
@@ -24,7 +24,8 @@ void bell::BinaryReader::skip(size_t pos) {
|
||||
|
||||
int32_t bell::BinaryReader::readInt() {
|
||||
uint8_t b[4];
|
||||
stream->read((uint8_t *) b,4);
|
||||
if (stream->read((uint8_t *) b,4) != 4)
|
||||
return 0;
|
||||
|
||||
return static_cast<int32_t>(
|
||||
(b[3]) |
|
||||
@@ -35,11 +36,12 @@ int32_t bell::BinaryReader::readInt() {
|
||||
|
||||
int16_t bell::BinaryReader::readShort() {
|
||||
uint8_t b[2];
|
||||
stream->read((uint8_t *) b,2);
|
||||
if (stream->read((uint8_t *) b,2) != 2)
|
||||
return 0;
|
||||
|
||||
return static_cast<int16_t>(
|
||||
(b[1]) |
|
||||
(b[1] << 8));
|
||||
(b[0] << 8));
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +51,8 @@ uint32_t bell::BinaryReader::readUInt() {
|
||||
|
||||
uint8_t bell::BinaryReader::readByte() {
|
||||
uint8_t b[1];
|
||||
stream->read((uint8_t *) b,1);
|
||||
if (stream->read((uint8_t *) b,1) != 1)
|
||||
return 0;
|
||||
return b[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user