From b680ae34423243a69ca48b2db399079080189e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Fri, 4 Mar 2022 11:05:14 +0200 Subject: 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=] Pick-to: 6.2 6.3 Task-number: QTBUG-101382 Change-Id: I1ee42b84a477451a98838c8cea3cca7c73f7cbaa Reviewed-by: James McDonnell --- src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/qnx') 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(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; } -- cgit v1.2.3