chore: use nullptr where possible in place of NULL
This commit is contained in:
@ -48,23 +48,23 @@ static void interrupt(Arch::ESignal, void *data)
|
||||
EventQueue::EventQueue()
|
||||
: m_systemTarget(0),
|
||||
m_nextType(Event::kLast),
|
||||
m_typesForClient(NULL),
|
||||
m_typesForIStream(NULL),
|
||||
m_typesForIDataSocket(NULL),
|
||||
m_typesForIListenSocket(NULL),
|
||||
m_typesForISocket(NULL),
|
||||
m_typesForOSXScreen(NULL),
|
||||
m_typesForClientListener(NULL),
|
||||
m_typesForClientProxy(NULL),
|
||||
m_typesForClientProxyUnknown(NULL),
|
||||
m_typesForServer(NULL),
|
||||
m_typesForServerApp(NULL),
|
||||
m_typesForIKeyState(NULL),
|
||||
m_typesForIPrimaryScreen(NULL),
|
||||
m_typesForIScreen(NULL),
|
||||
m_typesForClipboard(NULL),
|
||||
m_typesForFile(NULL),
|
||||
m_typesForEi(NULL),
|
||||
m_typesForClient(nullptr),
|
||||
m_typesForIStream(nullptr),
|
||||
m_typesForIDataSocket(nullptr),
|
||||
m_typesForIListenSocket(nullptr),
|
||||
m_typesForISocket(nullptr),
|
||||
m_typesForOSXScreen(nullptr),
|
||||
m_typesForClientListener(nullptr),
|
||||
m_typesForClientProxy(nullptr),
|
||||
m_typesForClientProxyUnknown(nullptr),
|
||||
m_typesForServer(nullptr),
|
||||
m_typesForServerApp(nullptr),
|
||||
m_typesForIKeyState(nullptr),
|
||||
m_typesForIPrimaryScreen(nullptr),
|
||||
m_typesForIScreen(nullptr),
|
||||
m_typesForClipboard(nullptr),
|
||||
m_typesForFile(nullptr),
|
||||
m_typesForEi(nullptr),
|
||||
m_readyMutex(new Mutex),
|
||||
m_readyCondVar(new CondVar<bool>(m_readyMutex, false))
|
||||
{
|
||||
@ -80,8 +80,8 @@ EventQueue::~EventQueue()
|
||||
delete m_readyCondVar;
|
||||
delete m_readyMutex;
|
||||
|
||||
ARCH->setSignalHandler(Arch::kINTERRUPT, NULL, NULL);
|
||||
ARCH->setSignalHandler(Arch::kTERMINATE, NULL, NULL);
|
||||
ARCH->setSignalHandler(Arch::kINTERRUPT, nullptr, nullptr);
|
||||
ARCH->setSignalHandler(Arch::kTERMINATE, nullptr, nullptr);
|
||||
ARCH->closeMutex(m_mutex);
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ void EventQueue::adoptBuffer(IEventQueueBuffer *buffer)
|
||||
|
||||
// use new buffer
|
||||
m_buffer = buffer;
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
m_buffer = new SimpleEventQueueBuffer;
|
||||
}
|
||||
}
|
||||
@ -235,10 +235,10 @@ bool EventQueue::dispatchEvent(const Event &event)
|
||||
{
|
||||
void *target = event.getTarget();
|
||||
IEventJob *job = getHandler(event.getType(), target);
|
||||
if (job == NULL) {
|
||||
if (job == nullptr) {
|
||||
job = getHandler(Event::kUnknown, target);
|
||||
}
|
||||
if (job != NULL) {
|
||||
if (job != nullptr) {
|
||||
job->run(event);
|
||||
return true;
|
||||
}
|
||||
@ -288,7 +288,7 @@ EventQueueTimer *EventQueue::newTimer(double duration, void *target)
|
||||
assert(duration > 0.0);
|
||||
|
||||
EventQueueTimer *timer = m_buffer->newTimer(duration, false);
|
||||
if (target == NULL) {
|
||||
if (target == nullptr) {
|
||||
target = timer;
|
||||
}
|
||||
ArchMutexLock lock(m_mutex);
|
||||
@ -305,7 +305,7 @@ EventQueueTimer *EventQueue::newOneShotTimer(double duration, void *target)
|
||||
assert(duration > 0.0);
|
||||
|
||||
EventQueueTimer *timer = m_buffer->newTimer(duration, true);
|
||||
if (target == NULL) {
|
||||
if (target == nullptr) {
|
||||
target = timer;
|
||||
}
|
||||
ArchMutexLock lock(m_mutex);
|
||||
@ -343,7 +343,7 @@ void EventQueue::adoptHandler(Event::Type type, void *target, IEventJob *handler
|
||||
|
||||
void EventQueue::removeHandler(Event::Type type, void *target)
|
||||
{
|
||||
IEventJob *handler = NULL;
|
||||
IEventJob *handler = nullptr;
|
||||
{
|
||||
ArchMutexLock lock(m_mutex);
|
||||
HandlerTable::iterator index = m_handlers.find(target);
|
||||
@ -397,7 +397,7 @@ IEventJob *EventQueue::getHandler(Event::Type type, void *target) const
|
||||
return index2->second;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t EventQueue::saveEvent(const Event &event)
|
||||
|
||||
Reference in New Issue
Block a user