summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-03-03 22:25:13 +0000
committerMichael Lutz <michi@icosahedron.de>2019-03-24 16:10:04 +0100
commitaf7d9020a15c1b1a14b3981ac73c70d2e58cc877 (patch)
tree1dcff3e01382ea3a0a4733a4637659dbbfd4bad5 /src/network
parent31260e66252fb4d0dda6f992520faeeb96929cfe (diff)
downloadopenttd-af7d9020a15c1b1a14b3981ac73c70d2e58cc877.tar.xz
Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual member declaration overrides a base-class member with the same signature. Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked as virtual despite being a template.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_client.cpp4
-rw-r--r--src/network/network_content_gui.cpp2
-rw-r--r--src/network/network_gui.cpp8
-rw-r--r--src/network/network_server.cpp4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 0bb42c86f..a99a5069a 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -84,7 +84,7 @@ struct PacketReader : LoadFilter {
this->buf += to_write;
}
- /* virtual */ size_t Read(byte *rbuf, size_t size)
+ size_t Read(byte *rbuf, size_t size) override
{
/* Limit the amount to read to whatever we still have. */
size_t ret_size = size = min(this->written_bytes - this->read_bytes, size);
@@ -106,7 +106,7 @@ struct PacketReader : LoadFilter {
return ret_size;
}
- /* virtual */ void Reset()
+ void Reset() override
{
this->read_bytes = 0;
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 230a62134..321a53bc7 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -64,7 +64,7 @@ struct ContentTextfileWindow : public TextfileWindow {
}
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, this->GetTypeString());
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index cb6426142..f90370312 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -117,7 +117,7 @@ public:
*lastof(this->visible) = true;
}
- void SetupSmallestSize(Window *w, bool init_array)
+ void SetupSmallestSize(Window *w, bool init_array) override
{
/* Oh yeah, we ought to be findable! */
w->nested_array[WID_NG_HEADER] = this;
@@ -143,7 +143,7 @@ public:
this->smallest_x = this->head->smallest_x + this->tail->smallest_x; // First and last are always shown, rest not
}
- void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl)
+ void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override
{
assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
@@ -183,7 +183,7 @@ public:
}
}
- /* virtual */ void Draw(const Window *w)
+ void Draw(const Window *w) override
{
int i = 0;
for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
@@ -193,7 +193,7 @@ public:
}
}
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y)
+ NWidgetCore *GetWidgetFromPos(int x, int y) override
{
if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL;
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index bd78acf92..67f4c6fd9 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -163,7 +163,7 @@ struct PacketWriter : SaveFilter {
this->current = NULL;
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
/* We want to abort the saving when the socket is closed. */
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
@@ -190,7 +190,7 @@ struct PacketWriter : SaveFilter {
this->total_size += size;
}
- /* virtual */ void Finish()
+ void Finish() override
{
/* We want to abort the saving when the socket is closed. */
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);