]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/windows/gamecontroller.cpp
Use nullptr in place of 0 or NULL
[libs/gui.git] / source / input / windows / gamecontroller.cpp
index 1d06bfea2fa3652474959682be793f987907b74e..46536b39d37acba729c300c02a748a7a825bd18f 100644 (file)
@@ -1,7 +1,7 @@
-#include <msp/core/application.h>
-#include <msp/strings/format.h>
 #include "gamecontroller.h"
 #include "gamecontroller_platform.h"
+#include <msp/core/application.h>
+#include <msp/strings/format.h>
 
 using namespace std;
 
@@ -34,7 +34,7 @@ GameController::GameController(unsigned index):
 
 GameController::~GameController()
 {
-       use_event_dispatcher(0);
+       use_event_dispatcher(nullptr);
 
        delete priv;
 }
@@ -75,9 +75,9 @@ void GameController::use_event_dispatcher(IO::EventDispatcher *ed)
        else if(priv->event_pipe)
        {
                GameControllerTimerThread::remove_slot(*priv->timer_slot);
-               priv->timer_slot = 0;
+               priv->timer_slot = nullptr;
                delete priv->event_pipe;
-               priv->event_pipe = 0;
+               priv->event_pipe = nullptr;
        }
 }
 
@@ -101,13 +101,6 @@ void GameController::tick(const Time::TimeDelta &)
 }
 
 
-GameController::Private::Private():
-       index(0),
-       last_packet_number(0),
-       event_pipe(0),
-       timer_slot(0)
-{ }
-
 bool GameController::Private::generate_event()
 {
        event_pipe->put(1);
@@ -141,11 +134,10 @@ void GameController::Private::update_state(GameController &ctrl, const XINPUT_ST
 }
 
 
-GameControllerTimerThread *GameControllerTimerThread::thread = 0;
+GameControllerTimerThread *GameControllerTimerThread::thread = nullptr;
 
 GameControllerTimerThread::GameControllerTimerThread():
-       Thread("GameController"),
-       n_users(0)
+       Thread("GameController")
 {
        launch();
 }
@@ -171,7 +163,7 @@ void GameControllerTimerThread::remove_slot(Time::Timer::Slot &slot)
        {
                thread->timer.add(Time::zero);
                delete thread;
-               thread = 0;
+               thread = nullptr;
        }
 }