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 <jmcdonnell@blackberry.com>
This commit is contained in:
parent
2edc0025fa
commit
b680ae3442
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user