Replace use of C style casts

This commit is contained in:
Jonas Kvinge
2020-06-15 17:59:02 +02:00
parent a68c249d4e
commit 72ede666d4
35 changed files with 105 additions and 111 deletions

View File

@@ -123,7 +123,7 @@ void AttachedPictureFrame::parseFields(const ByteVector &data) {
return;
}
d->type = (Strawberry_TagLib::TagLib::ID3v2::AttachedPictureFrame::Type)data[pos++];
d->type = static_cast<ID3v2::AttachedPictureFrame::Type>(data[pos++]);
d->description = readStringField(data, d->textEncoding, &pos);
d->data = data.mid(pos);
@@ -185,7 +185,7 @@ void AttachedPictureFrameV22::parseFields(const ByteVector &data) {
d->mimeType = "image/" + fixedString;
}
d->type = (Strawberry_TagLib::TagLib::ID3v2::AttachedPictureFrame::Type)data[pos++];
d->type = static_cast<ID3v2::AttachedPictureFrame::Type>(data[pos++]);
d->description = readStringField(data, d->textEncoding, &pos);
d->data = data.mid(pos);

View File

@@ -93,7 +93,7 @@ void PopularimeterFrame::parseFields(const ByteVector &data) {
d->rating = 0;
d->counter = 0;
if (pos < size) {
d->rating = (unsigned char)(data[pos++]);
d->rating = static_cast<unsigned char>(data[pos++]);
if (pos < size) {
d->counter = data.toUInt(static_cast<unsigned int>(pos));
}

View File

@@ -142,7 +142,7 @@ void RelativeVolumeFrame::parseFields(const ByteVector &data) {
// Each channel is at least 4 bytes.
while (pos <= (int)data.size() - 4) {
while (pos <= static_cast<int>(data.size()) - 4) {
ChannelType type = ChannelType(data[pos]);
pos += 1;

View File

@@ -309,7 +309,7 @@ ByteVector TableOfContentsFrame::renderFields() const {
if (d->isOrdered)
flags += 1;
data.append(flags);
data.append((char)(entryCount()));
data.append(static_cast<char>(entryCount()));
ByteVectorList::ConstIterator it = d->childElements.begin();
while (it != d->childElements.end()) {
data.append(*it);