summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2019-03-28 00:09:33 +0100
committerGitHub <noreply@github.com>2019-03-28 00:09:33 +0100
commit66dd7c3879123bb99b712375b66b577f81d53a96 (patch)
tree6231635658dab5ba63b776e9350884c083617cb1 /src/network
parente817951bfdc229b404d5fec188c67f5202a0e774 (diff)
downloadopenttd-66dd7c3879123bb99b712375b66b577f81d53a96.tar.xz
Fix: MSVC warnings (#7423)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_content.cpp8
-rw-r--r--src/network/network_content.h2
-rw-r--r--src/network/network_content_gui.cpp6
-rw-r--r--src/network/network_gui.cpp8
4 files changed, 12 insertions, 12 deletions
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index 003ffdb8b..19235c8c7 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -250,7 +250,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo
(sizeof(uint8) + sizeof(uint32) + (send_md5sum ? /*sizeof(ContentInfo::md5sum)*/16 : 0)));
Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID);
- p->Send_uint8(cv->size());
+ p->Send_uint8((uint8)cv->size());
for (const ContentInfo *ci : *cv) {
p->Send_uint8((byte)ci->type);
@@ -299,7 +299,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin
bytes += ci->filesize;
}
- files = content.size();
+ files = (uint)content.size();
/* If there's nothing to download, do nothing. */
if (files == 0) return;
@@ -317,7 +317,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContent(uint &files, uin
*/
void ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP(const ContentIDList &content)
{
- uint count = content.size();
+ uint count = (uint)content.size();
/* Allocate memory for the whole request.
* Requests are "id\nid\n..." (as strings), so assume the maximum ID,
@@ -345,7 +345,7 @@ void ClientNetworkContentSocketHandler::DownloadSelectedContentHTTP(const Conten
*/
void ClientNetworkContentSocketHandler::DownloadSelectedContentFallback(const ContentIDList &content)
{
- uint count = content.size();
+ uint count = (uint)content.size();
const ContentID *content_ids = content.data();
this->Connect();
diff --git a/src/network/network_content.h b/src/network/network_content.h
index 29a25f259..fb81925d2 100644
--- a/src/network/network_content.h
+++ b/src/network/network_content.h
@@ -129,7 +129,7 @@ public:
void CheckDependencyState(ContentInfo *ci);
/** Get the number of content items we know locally. */
- uint Length() const { return this->infos.size(); }
+ uint Length() const { return (uint)this->infos.size(); }
/** Get the begin of the content inf iterator. */
ConstContentIterator Begin() const { return this->infos.data(); }
/** Get the nth position of the content inf iterator. */
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 09168185a..40f1966e4 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -400,7 +400,7 @@ class NetworkContentListWindow : public Window, ContentCallback {
this->content.RebuildDone();
this->SortContentList();
- this->vscroll->SetCount(this->content.size()); // Update the scrollbar
+ this->vscroll->SetCount((int)this->content.size()); // Update the scrollbar
this->ScrollToSelected();
}
@@ -813,7 +813,7 @@ public:
case WID_NCL_NAME:
if (this->content.SortType() == widget - WID_NCL_CHECKBOX) {
this->content.ToggleSortOrder();
- if (this->content.size() > 0) this->list_pos = this->content.size() - this->list_pos - 1;
+ if (this->content.size() > 0) this->list_pos = (int)this->content.size() - this->list_pos - 1;
} else {
this->content.SetSortType(widget - WID_NCL_CHECKBOX);
this->content.ForceResort();
@@ -888,7 +888,7 @@ public:
break;
case WKC_END:
/* jump to end */
- this->list_pos = this->content.size() - 1;
+ this->list_pos = (int)this->content.size() - 1;
break;
case WKC_SPACE:
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index b35e91528..0fd707676 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -269,7 +269,7 @@ protected:
this->servers.shrink_to_fit();
this->servers.RebuildDone();
- this->vscroll->SetCount(this->servers.size());
+ this->vscroll->SetCount((int)this->servers.size());
/* Sort the list of network games as requested. */
this->servers.Sort();
@@ -710,7 +710,7 @@ public:
case WID_NG_INFO: // Connectivity (green dot)
if (this->servers.SortType() == widget - WID_NG_NAME) {
this->servers.ToggleSortOrder();
- if (this->list_pos != SLP_INVALID) this->list_pos = this->servers.size() - this->list_pos - 1;
+ if (this->list_pos != SLP_INVALID) this->list_pos = (ServerListPosition)this->servers.size() - this->list_pos - 1;
} else {
this->servers.SetSortType(widget - WID_NG_NAME);
this->servers.ForceResort();
@@ -847,7 +847,7 @@ public:
break;
case WKC_END:
/* jump to end */
- this->list_pos = this->servers.size() - 1;
+ this->list_pos = (ServerListPosition)this->servers.size() - 1;
break;
default: NOT_REACHED();
}
@@ -1787,7 +1787,7 @@ struct NetworkClientListPopupWindow : Window {
d = maxdim(GetStringBoundingBox(action.name), d);
}
- d.height *= this->actions.size();
+ d.height *= (uint)this->actions.size();
d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
*size = d;