mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Fix MSVC's C4267 warnings
This commit is contained in:
parent
a70f93a3cf
commit
f9d42ed396
24 changed files with 50 additions and 51 deletions
|
@ -39,14 +39,14 @@ namespace Compiler
|
|||
Codes block;
|
||||
|
||||
if (iter!=mIfCode.rbegin())
|
||||
Generator::jump (iter->second, codes.size()+1);
|
||||
Generator::jump (iter->second, static_cast<int>(codes.size()+1));
|
||||
|
||||
if (!iter->first.empty())
|
||||
{
|
||||
// if or elseif
|
||||
std::copy (iter->first.begin(), iter->first.end(),
|
||||
std::back_inserter (block));
|
||||
Generator::jumpOnZero (block, iter->second.size()+1);
|
||||
Generator::jumpOnZero (block, static_cast<int>(iter->second.size()+1));
|
||||
}
|
||||
|
||||
std::copy (iter->second.begin(), iter->second.end(),
|
||||
|
@ -113,7 +113,7 @@ namespace Compiler
|
|||
|
||||
Codes skip;
|
||||
|
||||
Generator::jumpOnZero (skip, mCodeBlock.size()+loop.size()+1);
|
||||
Generator::jumpOnZero (skip, static_cast<int> (mCodeBlock.size()+loop.size()+1));
|
||||
|
||||
std::copy (skip.begin(), skip.end(), std::back_inserter (mCode));
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ namespace Compiler
|
|||
{
|
||||
int Literals::getIntegerSize() const
|
||||
{
|
||||
return mIntegers.size() * sizeof (Interpreter::Type_Integer);
|
||||
return static_cast<int>(mIntegers.size() * sizeof (Interpreter::Type_Integer));
|
||||
}
|
||||
|
||||
int Literals::getFloatSize() const
|
||||
{
|
||||
return mFloats.size() * sizeof (Interpreter::Type_Float);
|
||||
return static_cast<int>(mFloats.size() * sizeof (Interpreter::Type_Float));
|
||||
}
|
||||
|
||||
int Literals::getStringSize() const
|
||||
|
@ -41,11 +41,11 @@ namespace Compiler
|
|||
|
||||
code.resize (size+stringBlockSize/4);
|
||||
|
||||
int offset = 0;
|
||||
size_t offset = 0;
|
||||
|
||||
for (const auto & mString : mStrings)
|
||||
{
|
||||
int stringSize = mString.size()+1;
|
||||
size_t stringSize = mString.size()+1;
|
||||
|
||||
std::copy (mString.c_str(), mString.c_str()+stringSize,
|
||||
reinterpret_cast<char *> (&code[size]) + offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue