From 7edaf253d5e5baa0368e08d2cec82ad9fb507f21 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Sat, 13 Oct 2012 16:12:28 -0300 Subject: QNX: code cleanup, use '0' instead of 'NULL' Qt coding style uses always 0. NULL is wrong. Change-Id: I163677b512214f853677d21d75f13142fe2ca88d Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxbuffer.cpp | 2 +- src/plugins/platforms/qnx/qqnxbuffer.h | 4 ++-- src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp | 10 +++++----- src/plugins/platforms/qnx/qqnxscreen.cpp | 2 +- src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp | 2 +- src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxbuffer.cpp b/src/plugins/platforms/qnx/qqnxbuffer.cpp index ed3ea49d44..9007af7f70 100644 --- a/src/plugins/platforms/qnx/qqnxbuffer.cpp +++ b/src/plugins/platforms/qnx/qqnxbuffer.cpp @@ -88,7 +88,7 @@ QQnxBuffer::QQnxBuffer(screen_buffer_t buffer) if (result != 0) { qFatal("QQNX: failed to query buffer pointer, errno=%d", errno); } - if (dataPtr == NULL) { + if (dataPtr == 0) { qFatal("QQNX: buffer pointer is NULL, errno=%d", errno); } diff --git a/src/plugins/platforms/qnx/qqnxbuffer.h b/src/plugins/platforms/qnx/qqnxbuffer.h index 7788778a4a..d5adeb8d8b 100644 --- a/src/plugins/platforms/qnx/qqnxbuffer.h +++ b/src/plugins/platforms/qnx/qqnxbuffer.h @@ -57,8 +57,8 @@ public: virtual ~QQnxBuffer(); screen_buffer_t nativeBuffer() const { return m_buffer; } - const QImage *image() const { return (m_buffer != NULL) ? &m_image : NULL; } - QImage *image() { return (m_buffer != NULL) ? &m_image : NULL; } + const QImage *image() const { return (m_buffer != 0) ? &m_image : 0; } + QImage *image() { return (m_buffer != 0) ? &m_image : 0; } QRect rect() const { return m_image.rect(); } diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp index 72a967d5e5..30ca8a5c48 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp +++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp @@ -571,7 +571,7 @@ spannable_string_t *toSpannableString(const QString &text) spannable_string_t *pString = reinterpret_cast(malloc(sizeof(spannable_string_t))); pString->str = (wchar_t *)malloc(sizeof(wchar_t) * text.length() + 1); pString->length = text.length(); - pString->spans = NULL; + pString->spans = 0; pString->spans_count = 0; const QChar *pData = text.constData(); @@ -601,7 +601,7 @@ static bool s_imfInitFailed = false; static bool imfAvailable() { - static bool s_imfDisabled = getenv("DISABLE_IMF") != NULL; + static bool s_imfDisabled = getenv("DISABLE_IMF") != 0; static bool s_imfReady = false; if ( s_imfInitFailed || s_imfDisabled) { @@ -611,7 +611,7 @@ static bool imfAvailable() return true; } - if ( p_imf_client_init == NULL ) { + if ( p_imf_client_init == 0 ) { void *handle = dlopen("libinput_client.so.1", 0); if ( handle ) { p_imf_client_init = (int32_t (*)()) dlsym(handle, "imf_client_init"); @@ -632,8 +632,8 @@ static bool imfAvailable() s_imfReady = true; } else { - p_ictrl_open_session = NULL; - p_ictrl_dispatch_event = NULL; + p_ictrl_open_session = 0; + p_ictrl_dispatch_event = 0; s_imfDisabled = true; qCritical() << Q_FUNC_INFO << "libinput_client.so.1 did not contain the correct symbols, library mismatch? IMF services are disabled."; return false; diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 6a092f01a0..593bec8458 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -524,7 +524,7 @@ void QQnxScreen::newWindowCreated(void *window) { Q_ASSERT(thread() == QThread::currentThread()); const screen_window_t windowHandle = reinterpret_cast(window); - screen_display_t display = NULL; + screen_display_t display = 0; if (screen_get_window_property_pv(windowHandle, SCREEN_PROPERTY_DISPLAY, (void**)&display) != 0) { qWarning("QQnx: Failed to get screen for window, errno=%d", errno); return; diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index 621440ed53..d8712bf569 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -462,7 +462,7 @@ void QQnxScreenEventHandler::handleCreateEvent(screen_event_t event) void QQnxScreenEventHandler::handleDisplayEvent(screen_event_t event) { - screen_display_t nativeDisplay = NULL; + screen_display_t nativeDisplay = 0; if (screen_get_event_property_pv(event, SCREEN_PROPERTY_DISPLAY, (void **)&nativeDisplay) != 0) { qWarning("QQnx: failed to query display property, errno=%d", errno); return; diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp index 4618b90f81..ab912927bb 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp @@ -130,7 +130,7 @@ bool QQnxVirtualKeyboardPps::connect() m_decoder = new pps_decoder_t; pps_encoder_initialize(m_encoder, false); - pps_decoder_initialize(m_decoder, NULL); + pps_decoder_initialize(m_decoder, 0); errno = 0; m_fd = ::open(ms_PPSPath, O_RDWR); @@ -197,7 +197,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady() m_buffer[nread] = 0; pps_decoder_parse_pps_str(m_decoder, m_buffer); - pps_decoder_push(m_decoder, NULL); + pps_decoder_push(m_decoder, 0); #if defined(QQNXVIRTUALKEYBOARD_DEBUG) pps_decoder_dump_tree(m_decoder, stderr); #endif -- cgit v1.2.3