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>
This commit is contained in:
parent
386eb2a5c0
commit
7edaf253d5
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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(); }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user