Improve coding style (after running clang-tidy)

This commit is contained in:
Martchus 2018-08-12 22:14:21 +02:00
parent 6f2dcdc2d9
commit 8642cd67e9
2 changed files with 8 additions and 6 deletions

View File

@ -29,6 +29,7 @@ Mp4ExtendedFieldId::Mp4ExtendedFieldId(KnownField field)
case KnownField::EncoderSettings: case KnownField::EncoderSettings:
mean = Mp4TagExtendedMeanIds::iTunes; mean = Mp4TagExtendedMeanIds::iTunes;
name = Mp4TagExtendedNameIds::cdec; name = Mp4TagExtendedNameIds::cdec;
updateOnly = false;
break; break;
case KnownField::RecordLabel: case KnownField::RecordLabel:
mean = Mp4TagExtendedMeanIds::iTunes; mean = Mp4TagExtendedMeanIds::iTunes;
@ -37,6 +38,8 @@ Mp4ExtendedFieldId::Mp4ExtendedFieldId(KnownField field)
break; break;
default: default:
mean = nullptr; mean = nullptr;
name = nullptr;
updateOnly = false;
} }
} }

View File

@ -135,18 +135,17 @@ void OggIterator::read(char *buffer, size_t count)
{ {
size_t bytesRead = 0; size_t bytesRead = 0;
while (*this && count) { while (*this && count) {
const uint32 available = currentSegmentSize() - m_bytesRead; const auto available = currentSegmentSize() - m_bytesRead;
stream().seekg(static_cast<streamoff>(currentCharacterOffset())); stream().seekg(static_cast<streamoff>(currentCharacterOffset()));
if (count <= available) { if (count <= available) {
stream().read(buffer + bytesRead, static_cast<streamoff>(count)); stream().read(buffer + bytesRead, static_cast<streamoff>(count));
m_bytesRead += count; m_bytesRead += count;
return; return;
} else {
stream().read(buffer + bytesRead, available);
nextSegment();
bytesRead += available;
count -= available;
} }
stream().read(buffer + bytesRead, available);
nextSegment();
bytesRead += available;
count -= available;
} }
if (count) { if (count) {
// still bytes to read but no more available // still bytes to read but no more available