Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions devlib/devlib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ TARGET = devlib
TEMPLATE = lib
CONFIG += c++14 staticlib

# Qt 6.10.2 bug: qyieldcpu.h calls __yield() on ARM64 without including <arm_acle.h>
macx: QMAKE_CXXFLAGS += "-include arm_acle.h"

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
Expand Down
2 changes: 1 addition & 1 deletion devlib/native/linux_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace linutil {
if (::close(fd) == -1) {
auto errnoCache = errno;
linutil::errnoWarning(__PRETTY_FUNCTION__,
QString("can not close handle ").append(fd),
QString("can not close handle ").append(QString::number(fd)),
errnoCache);
}
}
Expand Down
2 changes: 1 addition & 1 deletion devlib/native/macos_utils/macos_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace macos_utils {
{
auto usbPortsInHex = QString{locationID}.remove(0,2) // remove leading bus number
.remove("0") // remove trailing zeros
.split("", QString::SkipEmptyParts);
.split("", Qt::SkipEmptyParts);
auto usbPorts = QStringList{};
std::transform(usbPortsInHex.cbegin(),
usbPortsInHex.cend(),
Expand Down
4 changes: 2 additions & 2 deletions devlib/native/macosx_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ auto devlib::native::devicePartitions(QString const& devicePath)
qCDebug(macos_utils::macxlog()) << "Run 'diskutil list -plist'";

QProcess diskutil;
diskutil.start("diskutil list -plist", QIODevice::ReadOnly);
diskutil.start("diskutil", {"list", "-plist"}, QIODevice::ReadOnly);
diskutil.waitForFinished();

if (diskutil.error() != QProcess::ProcessError::UnknownError) {
Expand Down Expand Up @@ -173,7 +173,7 @@ bool devlib::native::umountDisk(QString const & devicePath)
bool devlib::native::mount(const QString &dev, const QString &path)
{
QProcess mount;
mount.start(QString("mount -t msdos %1 %2").arg(dev).arg(path));
mount.start("mount", {"-t", "msdos", dev, path});
mount.waitForFinished();
return mount.exitCode() == 0;
}
Expand Down
11 changes: 6 additions & 5 deletions devlib/native/win_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <QMap>
#include <QSet>
#include <QRegularExpression>

namespace winutil {
Q_LOGGING_CATEGORY(winlog, "windows_native");
Expand Down Expand Up @@ -161,11 +162,11 @@ namespace winutil {

static auto extractUSBPorts(QString const& locationPath) {
QString ports = "";
QRegExp usbPort("USB\\((\\d+)");
int pos = 0;
while ((pos = usbPort.indexIn(locationPath, pos)) != -1) {
ports += QString(".") + usbPort.cap(1);
pos += usbPort.matchedLength();
QRegularExpression usbPort("USB\\((\\d+)");
auto it = usbPort.globalMatch(locationPath);
while (it.hasNext()) {
auto match = it.next();
ports += QString(".") + match.captured(1);
}
return ports;
}
Expand Down