Codechange: Address some MSVC compiler warnings

This commit is contained in:
Niels Martin Hansen 2018-06-10 15:36:55 +02:00 committed by Michael Lutz
parent f5f2125238
commit 836d25e738
3 changed files with 7 additions and 7 deletions

View File

@ -115,7 +115,7 @@ void SQVM::Raise_ParamTypeError(SQInteger nparam,SQInteger typemask,SQInteger ty
SQInteger found = 0;
for(SQInteger i=0; i<16; i++)
{
SQInteger mask = 0x00000001 << i;
SQInteger mask = 0x00000001LL << i;
if(typemask & (mask)) {
if(found>0) StringCat(exptypes,SQString::Create(_ss(this), "|", -1), exptypes);
found ++;

View File

@ -288,7 +288,7 @@ static DropDownList *BuildMapsizeDropDown()
for (uint i = MIN_MAP_SIZE_BITS; i <= MAX_MAP_SIZE_BITS; i++) {
DropDownListParamStringItem *item = new DropDownListParamStringItem(STR_JUST_INT, i, false);
item->SetParam(0, 1 << i);
item->SetParam(0, 1LL << i);
*list->Append() = item;
}
@ -336,8 +336,8 @@ struct GenerateLandscapeWindow : public Window {
{
switch (widget) {
case WID_GL_START_DATE_TEXT: SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); break;
case WID_GL_MAPSIZE_X_PULLDOWN: SetDParam(0, 1 << _settings_newgame.game_creation.map_x); break;
case WID_GL_MAPSIZE_Y_PULLDOWN: SetDParam(0, 1 << _settings_newgame.game_creation.map_y); break;
case WID_GL_MAPSIZE_X_PULLDOWN: SetDParam(0, 1LL << _settings_newgame.game_creation.map_x); break;
case WID_GL_MAPSIZE_Y_PULLDOWN: SetDParam(0, 1LL << _settings_newgame.game_creation.map_y); break;
case WID_GL_MAX_HEIGHTLEVEL_TEXT: SetDParam(0, _settings_newgame.construction.max_heightlevel); break;
case WID_GL_SNOW_LEVEL_TEXT: SetDParam(0, _settings_newgame.game_creation.snow_line_height); break;
@ -896,11 +896,11 @@ struct CreateScenarioWindow : public Window
break;
case WID_CS_MAPSIZE_X_PULLDOWN:
SetDParam(0, 1 << _settings_newgame.game_creation.map_x);
SetDParam(0, 1LL << _settings_newgame.game_creation.map_x);
break;
case WID_CS_MAPSIZE_Y_PULLDOWN:
SetDParam(0, 1 << _settings_newgame.game_creation.map_y);
SetDParam(0, 1LL << _settings_newgame.game_creation.map_y);
break;
case WID_CS_FLAT_LAND_HEIGHT_TEXT:

View File

@ -4741,7 +4741,7 @@ static void NewSpriteGroup(ByteReader *buf)
}
}
group->num_ranges = optimised.size();
group->num_ranges = (uint)optimised.size(); // cast is safe, there should never be 2**31 elements here
if (group->num_ranges > 0) {
group->ranges = MallocT<DeterministicSpriteGroupRange>(group->num_ranges);
MemCpyT(group->ranges, &optimised.front(), group->num_ranges);