Replace use of C style casts
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user