summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-03-04 11:05:14 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-10 08:23:48 +0000
commit6e313942ab7ccee65f413d924e02360687ef7b14 (patch)
tree9f49daa62ecbc28a50e8e09c20c79b02d6c71c2e
parent1a933c8dcb34aafd5470de8eb0b8c27a0db4eb06 (diff)
QNX: Fix compiler warnings by using correct format specifiers
Also change qt_safe_read to use correct return value. warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'ssize_t' {aka 'long int'} [-Wformat=] Task-number: QTBUG-101382 Change-Id: I1ee42b84a477451a98838c8cea3cca7c73f7cbaa Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> (cherry picked from commit b680ae34423243a69ca48b2db399079080189e79) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
index 0d7bf09599..08119b9c06 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
@@ -134,7 +134,7 @@ bool QQnxVirtualKeyboardPps::connect()
m_buffer = new char[ms_bufferSize];
if (Q_UNLIKELY(!m_buffer)) {
- qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. "
+ qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %zu bytes. "
"Size is unavailable.", ms_bufferSize);
return false;
}
@@ -162,9 +162,9 @@ bool QQnxVirtualKeyboardPps::queryPPSInfo()
void QQnxVirtualKeyboardPps::ppsDataReady()
{
- ssize_t nread = qt_safe_read(m_fd, m_buffer, ms_bufferSize - 1);
+ qint64 nread = qt_safe_read(m_fd, m_buffer, ms_bufferSize - 1);
- qVirtualKeyboardDebug("keyboardMessage size: %zd", nread);
+ qVirtualKeyboardDebug("keyboardMessage size: %lld", nread);
if (nread < 0){
connect(); // reconnect
return;
@@ -177,7 +177,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
// nread is the real space necessary, not the amount read.
if (Q_UNLIKELY(static_cast<size_t>(nread) > ms_bufferSize - 1)) {
- qCritical("QQnxVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);
+ qCritical("QQnxVirtualKeyboard: Keyboard buffer size too short; need %lld.", nread + 1);
connect(); // reconnect
return;
}