mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-25 15:55:38 -04:00
Fix some pedantic compiler warnings.
This commit is contained in:
parent
e4bc302d3d
commit
7865f5eee9
2 changed files with 9 additions and 10 deletions
|
@ -67,17 +67,17 @@ qint64 bytesToInt64(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
||||||
|
|
||||||
quint16 bytesToUInt16(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
quint16 bytesToUInt16(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
||||||
{
|
{
|
||||||
return bytesToInt16(ba, byteOrder);
|
return static_cast<quint16>(bytesToInt16(ba, byteOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 bytesToUInt32(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
quint32 bytesToUInt32(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
||||||
{
|
{
|
||||||
return bytesToInt32(ba, byteOrder);
|
return static_cast<quint32>(bytesToInt32(ba, byteOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 bytesToUInt64(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
quint64 bytesToUInt64(const QByteArray& ba, QSysInfo::Endian byteOrder)
|
||||||
{
|
{
|
||||||
return bytesToInt64(ba, byteOrder);
|
return static_cast<quint64>(bytesToInt64(ba, byteOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint16 readInt16(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
qint16 readInt16(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
|
@ -90,7 +90,7 @@ qint16 readInt16(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*ok = true;
|
*ok = true;
|
||||||
return bytesToUInt16(ba, byteOrder);
|
return bytesToInt16(ba, byteOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ qint32 readInt32(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*ok = true;
|
*ok = true;
|
||||||
return bytesToUInt32(ba, byteOrder);
|
return bytesToInt32(ba, byteOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,23 +118,23 @@ qint64 readInt64(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*ok = true;
|
*ok = true;
|
||||||
return bytesToUInt64(ba, byteOrder);
|
return bytesToInt64(ba, byteOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 readUInt16(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
quint16 readUInt16(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
{
|
{
|
||||||
return readInt16(device, byteOrder, ok);
|
return static_cast<quint16>(readInt16(device, byteOrder, ok));
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 readUInt32(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
quint32 readUInt32(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
{
|
{
|
||||||
return readInt32(device, byteOrder, ok);
|
return static_cast<quint32>(readInt32(device, byteOrder, ok));
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 readUInt64(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
quint64 readUInt64(QIODevice* device, QSysInfo::Endian byteOrder, bool* ok)
|
||||||
{
|
{
|
||||||
return readInt64(device, byteOrder, ok);
|
return static_cast<quint64>(readInt64(device, byteOrder, ok));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray int16ToBytes(qint16 num, QSysInfo::Endian byteOrder)
|
QByteArray int16ToBytes(qint16 num, QSysInfo::Endian byteOrder)
|
||||||
|
|
|
@ -553,7 +553,6 @@ qint64 QtIOCompressor::readData(char *data, qint64 maxSize)
|
||||||
return -1;
|
return -1;
|
||||||
case Z_BUF_ERROR: // No more input and zlib can not privide more output - Not an error, we can try to read again when we have more input.
|
case Z_BUF_ERROR: // No more input and zlib can not privide more output - Not an error, we can try to read again when we have more input.
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
// Loop util data buffer is full or we reach the end of the input stream.
|
// Loop util data buffer is full or we reach the end of the input stream.
|
||||||
} while (d->zlibStream.avail_out != 0 && status != Z_STREAM_END);
|
} while (d->zlibStream.avail_out != 0 && status != Z_STREAM_END);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue