summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-30 15:11:07 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-30 15:11:07 +0300
commitc3bb4f8f2eff05ccdb8a3f9ef58fc741eedfaa79 (patch)
treedc164a33a3732de36fcca452cc19841ed3663ff1 /src
parent9c6f59308ebf8d488e0949c76e7c452876fe753f (diff)
downloadmv-c3bb4f8f2eff05ccdb8a3f9ef58fc741eedfaa79.tar.gz
mv-c3bb4f8f2eff05ccdb8a3f9ef58fc741eedfaa79.tar.bz2
mv-c3bb4f8f2eff05ccdb8a3f9ef58fc741eedfaa79.tar.xz
mv-c3bb4f8f2eff05ccdb8a3f9ef58fc741eedfaa79.zip
Fix issies found by gcc 6 in paranoid mode.
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp7
-rw-r--r--src/gui/models/playertablemodel.cpp2
-rw-r--r--src/gui/windows/buydialog.cpp6
-rw-r--r--src/gui/windows/setupwindow.cpp2
-rw-r--r--src/listeners/tooltiplistener.cpp4
5 files changed, 13 insertions, 8 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 644a6f645..5a461f522 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -1322,14 +1322,13 @@ impHandler0(serverUnIgnoreAll)
PRAGMA6(GCC diagnostic push)
PRAGMA6(GCC diagnostic ignored "-Wnull-dereference")
-
impHandler0(error)
{
- const int *const ptr = nullptr;
- logger->log("test %d", *ptr);
+ int *const ptr = nullptr;
+ *(ptr + 1) = 20;
+// logger->log("test %d", *ptr);
exit(1);
}
-
PRAGMA6(GCC diagnostic pop)
impHandler(dumpGraphics)
diff --git a/src/gui/models/playertablemodel.cpp b/src/gui/models/playertablemodel.cpp
index e3458abc3..744c56c57 100644
--- a/src/gui/models/playertablemodel.cpp
+++ b/src/gui/models/playertablemodel.cpp
@@ -120,6 +120,8 @@ void PlayerTableModel::updateModelInRow(const int row) const
{
const DropDown *const choicebox = static_cast<DropDown *>(
getElementAt(row, RELATION_CHOICE_COLUMN));
+ if (!choicebox)
+ return;
player_relations.setRelation(getPlayerAt(row),
static_cast<RelationT>(
choicebox->getSelected()));
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index fa7297bdd..9dd083d61 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -617,7 +617,11 @@ void BuyDialog::updateSlider(const int selectedItem)
// Update money and adjust the max number of items
// that can be bought
mMaxItems -= mAmountItems;
- setMoney(mMoney - mAmountItems * mShopItems->at(selectedItem)->getPrice());
+ const ShopItem *const item = mShopItems->at(selectedItem);
+ if (item)
+ setMoney(mMoney - mAmountItems * item->getPrice());
+ else
+ setMoney(mMoney);
// Reset selection
mAmountItems = 1;
diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp
index 29f9cf126..19c1e6c52 100644
--- a/src/gui/windows/setupwindow.cpp
+++ b/src/gui/windows/setupwindow.cpp
@@ -26,6 +26,7 @@
#include "game.h"
#include "gui/windows/chatwindow.h"
+#include "gui/windows/statuswindow.h"
#include "gui/widgets/createwidget.h"
@@ -57,7 +58,6 @@
#include "debug.h"
-extern Window *statusWindow;
SetupWindow *setupWindow = nullptr;
SetupWindow::SetupWindow() :
diff --git a/src/listeners/tooltiplistener.cpp b/src/listeners/tooltiplistener.cpp
index 0080230d3..0281be969 100644
--- a/src/listeners/tooltiplistener.cpp
+++ b/src/listeners/tooltiplistener.cpp
@@ -35,7 +35,7 @@ ToolTipListener::ToolTipListener() :
void ToolTipListener::mouseMoved(MouseEvent &event)
{
- if (mToolTip.empty())
+ if (mToolTip.empty() || !textBoxPopup)
return;
int x = 0;
@@ -56,7 +56,7 @@ void ToolTipListener::mouseMoved(MouseEvent &event)
void ToolTipListener::mouseExited(MouseEvent &event A_UNUSED)
{
- if (mToolTip.empty())
+ if (mToolTip.empty() || !textBoxPopup)
return;
textBoxPopup->hide();
}