diff --git a/RagePhoto.cpp b/RagePhoto.cpp index 8d69fce..6561d8b 100644 --- a/RagePhoto.cpp +++ b/RagePhoto.cpp @@ -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(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(x[0]) << 24 | + static_cast(x[1]) << 16 | + static_cast(x[2]) << 8 | + static_cast(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(x[3]) << 24 | + static_cast(x[2]) << 16 | + static_cast(x[1]) << 8 | + static_cast(x[0])); } void RagePhoto::uInt32ToCharBE(quint32 *x, char *y) diff --git a/SnapmaticPicture.cpp b/SnapmaticPicture.cpp index 53908d0..d10022d 100644 --- a/SnapmaticPicture.cpp +++ b/SnapmaticPicture.cpp @@ -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; }