QNX: code cleanup, use '0' instead of 'NULL'
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>
Sat, 13 Oct 2012 19:12:28 +0000 (16:12 -0300)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 13 Oct 2012 21:24:01 +0000 (23:24 +0200)
Qt coding style uses always 0. NULL is wrong.

Change-Id: I163677b512214f853677d21d75f13142fe2ca88d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
src/plugins/platforms/qnx/qqnxbuffer.cpp
src/plugins/platforms/qnx/qqnxbuffer.h
src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
src/plugins/platforms/qnx/qqnxscreen.cpp
src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp

index ed3ea49..9007af7 100644 (file)
@@ -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);
     }
 
index 7788778..d5adeb8 100644 (file)
@@ -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(); }
 
index 72a967d..30ca8a5 100644 (file)
@@ -571,7 +571,7 @@ spannable_string_t *toSpannableString(const QString &text)
     spannable_string_t *pString = reinterpret_cast<spannable_string_t *>(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;
index 6a092f0..593bec8 100644 (file)
@@ -524,7 +524,7 @@ void QQnxScreen::newWindowCreated(void *window)
 {
     Q_ASSERT(thread() == QThread::currentThread());
     const screen_window_t windowHandle = reinterpret_cast<screen_window_t>(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;
index 621440e..d8712bf 100644 (file)
@@ -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;
index 4618b90..ab91292 100644 (file)
@@ -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