Commit 43112fc8 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use more nullptr

GIT_SILENT
parent eb6cf300
......@@ -583,17 +583,17 @@ void Ai::shotScores()
void Ai::chooseAction()
{
double bestScore=1e10;
Shot *bestShot=NULL,*s;
Shot *bestShot = nullptr,*s;
AiSprite actualpos;
double posangle,movephi,phiright,phileft,torotate=0,velangle;
int framesleft,framesright;
bool rotateAndAccelerate=false;
Hit *nextHit=0;
Hit *nextHit = nullptr;
int shotHitTime;
int i;
shotHitTime=1000000;
nextHit=0;
nextHit = nullptr;
/* for(h=objectsHitByShip.first();h;h=objectsHitByShip.next())
if(h->object==HSHOT)
if(h->hitTime<shotHitTime)
......@@ -704,7 +704,7 @@ void Ai::chooseAction()
else
{
int listsize; // used for caching QtList::size()
bestShot=0;
bestShot = nullptr;
listsize = myShots.size();
for (i=0; i<listsize; ++i)
{
......
......@@ -30,7 +30,7 @@
class General : public QWidget, public Ui::General
{
public:
General(QWidget* parent=0)
General(QWidget* parent = nullptr)
: QWidget(parent)
{
setupUi(this);
......
......@@ -33,7 +33,7 @@ class ConfigSetup:public QWidget
{
Q_OBJECT
public:
explicit ConfigSetup(SConfig *custom,QWidget *parent=0);
explicit ConfigSetup(SConfig *custom,QWidget *parent = nullptr);
bool hasChanged();
bool isDefault();
......@@ -94,7 +94,7 @@ class SettingsDialog : public KConfigDialog
{
Q_OBJECT
public:
explicit SettingsDialog(SConfig *customConfig, QWidget *parent=0, const char *name=0);
explicit SettingsDialog(SConfig *customConfig, QWidget *parent = nullptr, const char *name = nullptr);
~SettingsDialog();
signals:
......
......@@ -40,7 +40,7 @@
#include <math.h>
KToggleAction *MyMainView::pauseAction = 0;
KToggleAction *MyMainView::pauseAction = nullptr;
static struct
{
......@@ -53,7 +53,7 @@ static struct
{ ID_MINE1, "mine_red%1"},
{ ID_MINE2, "mine_blue%1"},
{ ID_MINEEXPLO, "mineex%1"},
{ 0, 0}
{ 0, nullptr}
};
MyMainView::MyMainView(QWidget *parent)
......@@ -113,7 +113,7 @@ MyMainView::MyMainView(QWidget *parent)
}
waitForStart=false;
textSprite=0;
textSprite = nullptr;
readConfig();
}
......@@ -516,7 +516,7 @@ void MyMainView::newRound()
{
textSprite->hide();
delete textSprite;
textSprite=0;
textSprite = nullptr;
}
//field.update();
......@@ -557,9 +557,9 @@ void MyMainView::timerEvent(QTimerEvent *event)
{
textSprite->hide();
delete textSprite;
textSprite=0;
textSprite = nullptr;
}
textSprite=new QGraphicsSimpleTextItem(0);
textSprite = new QGraphicsSimpleTextItem(nullptr);
field.addItem(textSprite);
// FIXME
// textSprite->setTextFlags(Qt::AlignCenter);
......
......@@ -42,7 +42,7 @@ class MyMainView:public QWidget
{
Q_OBJECT
public:
explicit MyMainView(QWidget *parent=0);
explicit MyMainView(QWidget *parent = nullptr);
~MyMainView();
static KToggleAction *pauseAction;
......
......@@ -27,7 +27,7 @@ class PlayerInfo:public QFrame
{
Q_OBJECT
public:
explicit PlayerInfo(int pnr,QWidget *parent=0);
explicit PlayerInfo(int pnr,QWidget *parent = nullptr);
static void loadPixmaps();
public slots:
void setHitpoints(int h);
......
......@@ -24,7 +24,7 @@
SimpleSprite::SimpleSprite(QSvgRenderer* svg, const QString& element)
:QGraphicsSvgItem(0)
:QGraphicsSvgItem(nullptr)
{
setSharedRenderer(svg);
setElementId(element);
......
......@@ -120,7 +120,7 @@ private:
class ExplosionSprite:public AnimatedSprite
{
public:
explicit ExplosionSprite(QSvgRenderer* svg, const QList<QString> &animation, MobileSprite *sp = 0);
explicit ExplosionSprite(QSvgRenderer* svg, const QList<QString> &animation, MobileSprite *sp = nullptr);
int type() const Q_DECL_OVERRIDE {return S_EXPLOSION;}
bool isOver() {return over;}
void forward(double mult) Q_DECL_OVERRIDE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment