mirror of
https://github.com/taglib/taglib.git
synced 2026-04-12 17:09:50 -04:00
Fix conversion compiler warnings
Using a release build with GCC 14.2.0 and -Wextra -Wconversion -Wall. The generated binaries are not changed by this commit.
This commit is contained in:
@ -176,7 +176,7 @@ void ID3v1::Tag::setComment(const String &s)
|
||||
|
||||
void ID3v1::Tag::setGenre(const String &s)
|
||||
{
|
||||
d->genre = ID3v1::genreIndex(s);
|
||||
d->genre = static_cast<unsigned char>(ID3v1::genreIndex(s));
|
||||
}
|
||||
|
||||
void ID3v1::Tag::setYear(unsigned int i)
|
||||
@ -186,7 +186,7 @@ void ID3v1::Tag::setYear(unsigned int i)
|
||||
|
||||
void ID3v1::Tag::setTrack(unsigned int i)
|
||||
{
|
||||
d->track = i < 256 ? i : 0;
|
||||
d->track = static_cast<unsigned char>(i < 256 ? i : 0);
|
||||
}
|
||||
|
||||
unsigned int ID3v1::Tag::genreNumber() const
|
||||
@ -196,7 +196,7 @@ unsigned int ID3v1::Tag::genreNumber() const
|
||||
|
||||
void ID3v1::Tag::setGenreNumber(unsigned int i)
|
||||
{
|
||||
d->genre = i < 256 ? i : 255;
|
||||
d->genre = static_cast<unsigned char>(i < 256 ? i : 255);
|
||||
}
|
||||
|
||||
void ID3v1::Tag::setStringHandler(const StringHandler *handler)
|
||||
|
||||
@ -240,7 +240,7 @@ void MPEG::Properties::read(File *file, ReadStyle readStyle)
|
||||
const Header lastHeader(file, lastFrameOffset, false);
|
||||
if(const offset_t streamLength = lastFrameOffset - firstFrameOffset + lastHeader.frameLength();
|
||||
streamLength > 0)
|
||||
d->length = static_cast<int>(streamLength * 8.0 / d->bitrate + 0.5);
|
||||
d->length = static_cast<int>(static_cast<double>(streamLength) * 8.0 / d->bitrate + 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user