summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2012-10-13 16:12:28 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-13 23:24:01 +0200
commit7edaf253d5e5baa0368e08d2cec82ad9fb507f21 (patch)
tree91e288a2fb44c4b2630afeb168b0b205a6cbf297 /src/plugins
parent386eb2a5c0ebbdf101a3c2e3d094402223669d6a (diff)
QNX: code cleanup, use '0' instead of 'NULL'
Qt coding style uses always 0. NULL is wrong. Change-Id: I163677b512214f853677d21d75f13142fe2ca88d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp10
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp4
6 files changed, 12 insertions, 12 deletions
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<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;
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<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;
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