Avoid giant C4267 warning in 64-bit Visual C++ build (#2569)
This commit is contained in:
parent
c123b9fcdd
commit
ab5835d359
|
@ -3776,6 +3776,15 @@ AccessControl Scope::defaultAccess() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scope::addVariable(const Token *token_, const Token *start_, const Token *end_,
|
||||||
|
AccessControl access_, const Type *type_, const Scope *scope_, const Settings* settings)
|
||||||
|
{
|
||||||
|
// keep possible size_t -> int truncation outside emplace_back() to have a single line
|
||||||
|
// C4267 VC++ warning instead of several dozens lines
|
||||||
|
const int varIndex = varlist.size();
|
||||||
|
varlist.emplace_back(token_, start_, end_, varIndex, access_, type_, scope_, settings);
|
||||||
|
}
|
||||||
|
|
||||||
// Get variable list..
|
// Get variable list..
|
||||||
void Scope::getVariableList(const Settings* settings)
|
void Scope::getVariableList(const Settings* settings)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1081,11 +1081,7 @@ public:
|
||||||
|
|
||||||
void addVariable(const Token *token_, const Token *start_,
|
void addVariable(const Token *token_, const Token *start_,
|
||||||
const Token *end_, AccessControl access_, const Type *type_,
|
const Token *end_, AccessControl access_, const Type *type_,
|
||||||
const Scope *scope_, const Settings* settings) {
|
const Scope *scope_, const Settings* settings);
|
||||||
varlist.emplace_back(token_, start_, end_, varlist.size(),
|
|
||||||
access_,
|
|
||||||
type_, scope_, settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief initialize varlist */
|
/** @brief initialize varlist */
|
||||||
void getVariableList(const Settings* settings);
|
void getVariableList(const Settings* settings);
|
||||||
|
|
Loading…
Reference in New Issue