RagePhoto: Improve casting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
05ccdc6689
commit
2cf9119c54
2 changed files with 9 additions and 8 deletions
|
@ -466,7 +466,7 @@ bool RagePhoto::setPhotoData(const QByteArray &data)
|
|||
|
||||
bool RagePhoto::setPhotoData(const char *data, int size)
|
||||
{
|
||||
if ((quint32)size > p_photoBuffer)
|
||||
if (static_cast<quint32>(size) > p_photoBuffer)
|
||||
return false;
|
||||
p_photoData = QByteArray(data, size);
|
||||
return true;
|
||||
|
@ -721,12 +721,18 @@ RagePhoto* RagePhoto::loadFile(const QString &filePath)
|
|||
|
||||
quint32 RagePhoto::charToUInt32BE(char *x)
|
||||
{
|
||||
return (((unsigned char)x[0] << 24) | ((unsigned char)x[1] << 16) | ((unsigned char)x[2] << 8) | ((unsigned char)x[3]));
|
||||
return (static_cast<unsigned char>(x[0]) << 24 |
|
||||
static_cast<unsigned char>(x[1]) << 16 |
|
||||
static_cast<unsigned char>(x[2]) << 8 |
|
||||
static_cast<unsigned char>(x[3]));
|
||||
}
|
||||
|
||||
quint32 RagePhoto::charToUInt32LE(char *x)
|
||||
{
|
||||
return (((unsigned char)x[3] << 24) | ((unsigned char)x[2] << 16) | ((unsigned char)x[1] << 8) | ((unsigned char)x[0]));
|
||||
return (static_cast<unsigned char>(x[3]) << 24 |
|
||||
static_cast<unsigned char>(x[2]) << 16 |
|
||||
static_cast<unsigned char>(x[1]) << 8 |
|
||||
static_cast<unsigned char>(x[0]));
|
||||
}
|
||||
|
||||
void RagePhoto::uInt32ToCharBE(quint32 *x, char *y)
|
||||
|
|
|
@ -82,7 +82,6 @@ bool SnapmaticPicture::preloadFile()
|
|||
QFile *picFile = new QFile(picFilePath);
|
||||
picFileName = QFileInfo(picFilePath).fileName();
|
||||
|
||||
bool g5eMode = false;
|
||||
isFormatSwitch = false;
|
||||
|
||||
if (!picFile->open(QFile::ReadOnly))
|
||||
|
@ -104,10 +103,6 @@ bool SnapmaticPicture::preloadFile()
|
|||
if (ragePhoto.photoFormat() == RagePhoto::PhotoFormat::G5EX)
|
||||
isFormatSwitch = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
g5eMode = true;
|
||||
}
|
||||
emit preloaded();
|
||||
return ok;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue