mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-31 18:02:57 +02:00
kdeconnect: update to 25.04.2.
This commit is contained in:
parent
ebf36b7e40
commit
af4fd29e3f
2 changed files with 3 additions and 71 deletions
|
@ -1,68 +0,0 @@
|
|||
From fe8dc6d3c8389e640dd9138e455c5c2cf335a0fa Mon Sep 17 00:00:00 2001
|
||||
From: Simon Redman <simon@ergotech.com>
|
||||
Date: Thu, 17 Apr 2025 14:39:30 +0000
|
||||
Subject: [PATCH] Fix build on platforms with sizeof(qsizetype) <
|
||||
sizeof(qint64)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
## Summary
|
||||
|
||||
`state->read_buffer.size()` returns `qsizetype` which is defined as `ssize_t`. On some platforms, this is less than the size of `qint64`.
|
||||
|
||||
This change casts the return of `state->read_buffer.size()` into `qint64` before comparing it to the `maxlen` parameter in `MultiplexChannel::readData`.
|
||||
|
||||
Includes defensive assert for the possible, likely distant, future in which `qint64` is not enough to contain a `ssize_t` value, in which case I cannot guarantee the rest of the code will perform correctly.
|
||||
|
||||
## Test Plan
|
||||
|
||||
### Before:
|
||||
Build fails on 32-bit Debian 13 and Ubuntu 25.04 armhf package infra.
|
||||
|
||||
```
|
||||
/core/backends/bluetooth/multiplexchannel.cpp:55:42: error: no matching function for call to ‘min(qint64&, qsizetype)’
|
||||
55 | const auto num_to_read = std::min(maxlen, state->read_buffer.size());
|
||||
|
|
||||
<snip>
|
||||
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
|
||||
233 | min(const _Tp& __a, const _Tp& __b)
|
||||
| ^~~
|
||||
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
|
||||
/<<PKGBUILDDIR>>/core/backends/bluetooth/multiplexchannel.cpp:55:42: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘qsizetype’ {aka ‘int’})
|
||||
55 | const auto num_to_read = std::min(maxlen, state->read_buffer.size());
|
||||
```
|
||||
|
||||
### After:
|
||||
Build passes on my local 32-bit Debian 13 and Ubuntu armhf.
|
||||
---
|
||||
core/backends/bluetooth/multiplexchannel.cpp | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/core/backends/bluetooth/multiplexchannel.cpp b/core/backends/bluetooth/multiplexchannel.cpp
|
||||
index 0accf0660..4887712bd 100644
|
||||
--- a/core/backends/bluetooth/multiplexchannel.cpp
|
||||
+++ b/core/backends/bluetooth/multiplexchannel.cpp
|
||||
@@ -51,8 +51,17 @@ qint64 MultiplexChannel::bytesToWrite() const
|
||||
|
||||
qint64 MultiplexChannel::readData(char *data, qint64 maxlen)
|
||||
{
|
||||
- if (maxlen <= state->read_buffer.size() || state->read_buffer.size() > 0) {
|
||||
- const auto num_to_read = std::min(maxlen, state->read_buffer.size());
|
||||
+ // QByteArray::size() returns qsizetype, which is defined to be the same
|
||||
+ // as ssize_t which might not be the same as qint64 on all platforms.
|
||||
+ const qint64 read_buffer_size = (qint64)state->read_buffer.size();
|
||||
+
|
||||
+ // Someone sharper than me with C++ can do better here. We need to ensure
|
||||
+ // that we have not accidentally truncated read_buffer_size with the cast
|
||||
+ // to qint64 above.
|
||||
+ static_assert(sizeof(qint64) >= sizeof(qsizetype), "This code has not been checked for safety when qsizetype exceeds the type of the maxlen parameter");
|
||||
+
|
||||
+ if (maxlen <= read_buffer_size || read_buffer_size > 0) {
|
||||
+ const qint64 num_to_read = std::min(maxlen, read_buffer_size);
|
||||
std::memcpy(data, state->read_buffer.data(), num_to_read);
|
||||
state->read_buffer.remove(0, num_to_read);
|
||||
Q_EMIT state->readAvailable();
|
||||
--
|
||||
GitLab
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'kdeconnect'
|
||||
pkgname=kdeconnect
|
||||
version=25.04.0
|
||||
version=25.04.2
|
||||
revision=1
|
||||
build_style=cmake
|
||||
configure_args="-DWaylandScanner_EXECUTABLE=/usr/bin/wayland-scanner
|
||||
|
@ -14,7 +14,7 @@ makedepends="kf6-kcmutils-devel kf6-kconfigwidgets-devel kf6-kdbusaddons-devel
|
|||
kf6-kdoctools-devel kf6-ki18n-devel kf6-kiconthemes-devel kf6-kio-devel
|
||||
kf6-kirigami-devel kf6-knotifications-devel kf6-kstatusnotifieritem-devel
|
||||
kf6-kservice-devel kf6-qqc2-desktop-style-devel kf6-modemmanager-qt-devel
|
||||
kf6-kpackage-devel kf6-kpeople-devel kf6-kwayland-devel
|
||||
kf6-kpackage-devel kf6-kpeople-devel kf6-kwayland-devel kf6-kitemmodels-devel
|
||||
libfakekey-devel qca-qt6-devel pulseaudio-qt-devel qt6-base-private-devel
|
||||
qt6-connectivity-devel qt6-multimedia-devel kirigami-addons-devel
|
||||
qt6-wayland-devel"
|
||||
|
@ -27,5 +27,5 @@ maintainer="John <me@johnnynator.dev>"
|
|||
license="GPL-2.0-or-later"
|
||||
homepage="https://kdeconnect.kde.org"
|
||||
distfiles="${KDE_SITE}/release-service/${version}/src/${pkgname}-kde-${version}.tar.xz"
|
||||
checksum=144a65ed741dd37bec4e30703c939f49b8becdb51075bd5702d7adede91d5ca8
|
||||
checksum=4c65e473a57e4e1ffc999838adb5b1aa01a85534b0e46997ab42abda17ccd1b5
|
||||
python_version=3
|
||||
|
|
Loading…
Add table
Reference in a new issue