Fix: MSVC warnings (#7423)

This commit is contained in:
glx22
2019-03-28 00:09:33 +01:00
committed by GitHub
parent e817951bfd
commit 66dd7c3879
39 changed files with 88 additions and 88 deletions

View File

@@ -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();

View File

@@ -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. */

View File

@@ -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:

View File

@@ -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;