From 51b379502fc7ad2e122504ca3e304929c5b9f5c3 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 23 Aug 2020 21:55:34 +0200 Subject: [PATCH] Always use qint32 for QDBusArgument --- src/osd/osddbus.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/osd/osddbus.cpp b/src/osd/osddbus.cpp index ef6394b8..36d0f01d 100644 --- a/src/osd/osddbus.cpp +++ b/src/osd/osddbus.cpp @@ -78,19 +78,21 @@ QDBusArgument &operator<<(QDBusArgument &arg, const QImage &image) { #endif arg.beginStructure(); - arg << i.width(); - arg << i.height(); + arg << static_cast(i.width()); + arg << static_cast(i.height()); arg << static_cast(i.bytesPerLine()); arg << i.hasAlphaChannel(); - int channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3); - arg << i.depth() / channels; + qint32 channels = i.isGrayscale() ? 1 : (i.hasAlphaChannel() ? 4 : 3); + qint32 bitspersample = i.depth() / channels; + arg << bitspersample; arg << channels; #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) - arg << QByteArray(reinterpret_cast(i.bits()), i.sizeInBytes()); + arg << QByteArray(reinterpret_cast(i.constBits()), static_cast(i.sizeInBytes())); #else - arg << QByteArray(reinterpret_cast(i.bits()), i.byteCount()); + arg << QByteArray(reinterpret_cast(i.constBits()), i.byteCount()); #endif arg.endStructure(); + return arg; }