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:
mean = Mp4TagExtendedMeanIds::iTunes;
name = Mp4TagExtendedNameIds::cdec;
updateOnly = false;
break;
case KnownField::RecordLabel:
mean = Mp4TagExtendedMeanIds::iTunes;
@ -37,6 +38,8 @@ Mp4ExtendedFieldId::Mp4ExtendedFieldId(KnownField field)
break;
default:
mean = nullptr;
name = nullptr;
updateOnly = false;
}
}

View File

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