Merge pull request #1103 from Allofich/warnings

Fix shadowing warnings
This commit is contained in:
scrawl 2016-10-14 21:18:12 +02:00 committed by GitHub
commit 9e63c3ce63
8 changed files with 36 additions and 37 deletions

View file

@ -313,7 +313,7 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseNAry (const Token& ke
nodes.push_back (node); nodes.push_back (node);
Token token = getNextToken(); token = getNextToken();
if (!token || (token.mType!=Token::Type_Close && token.mType!=Token::Type_Comma)) if (!token || (token.mType!=Token::Type_Close && token.mType!=Token::Type_Comma))
{ {

View file

@ -219,12 +219,12 @@ bool CSVRender::Cell::referenceDataChanged (const QModelIndex& topLeft,
} }
// add new objects // add new objects
for (std::map<std::string, bool>::iterator iter (ids.begin()); iter!=ids.end(); ++iter) for (std::map<std::string, bool>::iterator mapIter (ids.begin()); mapIter!=ids.end(); ++mapIter)
{ {
if (!iter->second) if (!mapIter->second)
{ {
mObjects.insert (std::make_pair ( mObjects.insert (std::make_pair (
iter->first, new Object (mData, mCellNode, iter->first, false))); mapIter->first, new Object (mData, mCellNode, mapIter->first, false)));
modified = true; modified = true;
} }

View file

@ -658,8 +658,7 @@ void CSVWorld::EditWidget::remake(int row)
int displayRole = tree->nestedHeaderData (i, col, int displayRole = tree->nestedHeaderData (i, col,
Qt::Horizontal, CSMWorld::ColumnBase::Role_Display).toInt(); Qt::Horizontal, CSMWorld::ColumnBase::Role_Display).toInt();
CSMWorld::ColumnBase::Display display = display = static_cast<CSMWorld::ColumnBase::Display> (displayRole);
static_cast<CSMWorld::ColumnBase::Display> (displayRole);
mNestedTableDispatcher->makeDelegate (display); mNestedTableDispatcher->makeDelegate (display);

View file

@ -67,8 +67,8 @@ void CSVWorld::DragRecordTable::dropEvent(QDropEvent *event)
CSMWorld::ColumnBase::Display display = getIndexDisplayType(index); CSMWorld::ColumnBase::Display display = getIndexDisplayType(index);
if (CSVWorld::DragDropUtils::canAcceptData(*event, display)) if (CSVWorld::DragDropUtils::canAcceptData(*event, display))
{ {
const CSMWorld::TableMimeData *data = CSVWorld::DragDropUtils::getTableMimeData(*event); const CSMWorld::TableMimeData *tableMimeData = CSVWorld::DragDropUtils::getTableMimeData(*event);
if (data->fromDocument(mDocument)) if (tableMimeData->fromDocument(mDocument))
{ {
CSMWorld::UniversalId id = CSVWorld::DragDropUtils::getAcceptedData(*event, display); CSMWorld::UniversalId id = CSVWorld::DragDropUtils::getAcceptedData(*event, display);
QVariant newIndexData = QString::fromUtf8(id.getId().c_str()); QVariant newIndexData = QString::fromUtf8(id.getId().c_str());

View file

@ -187,12 +187,12 @@ namespace MWDialogue
state.save (writer); state.save (writer);
writer.endRecord (ESM::REC_QUES); writer.endRecord (ESM::REC_QUES);
for (Topic::TEntryIter iter (quest.begin()); iter!=quest.end(); ++iter) for (Topic::TEntryIter entryIter (quest.begin()); entryIter!=quest.end(); ++entryIter)
{ {
ESM::JournalEntry entry; ESM::JournalEntry entry;
entry.mType = ESM::JournalEntry::Type_Quest; entry.mType = ESM::JournalEntry::Type_Quest;
entry.mTopic = quest.getTopic(); entry.mTopic = quest.getTopic();
iter->write (entry); entryIter->write (entry);
writer.startRecord (ESM::REC_JOUR); writer.startRecord (ESM::REC_JOUR);
entry.save (writer); entry.save (writer);
writer.endRecord (ESM::REC_JOUR); writer.endRecord (ESM::REC_JOUR);
@ -213,12 +213,12 @@ namespace MWDialogue
{ {
const Topic& topic = iter->second; const Topic& topic = iter->second;
for (Topic::TEntryIter iter (topic.begin()); iter!=topic.end(); ++iter) for (Topic::TEntryIter entryIter (topic.begin()); entryIter!=topic.end(); ++entryIter)
{ {
ESM::JournalEntry entry; ESM::JournalEntry entry;
entry.mType = ESM::JournalEntry::Type_Topic; entry.mType = ESM::JournalEntry::Type_Topic;
entry.mTopic = topic.getTopic(); entry.mTopic = topic.getTopic();
iter->write (entry); entryIter->write (entry);
writer.startRecord (ESM::REC_JOUR); writer.startRecord (ESM::REC_JOUR);
entry.save (writer); entry.save (writer);
writer.endRecord (ESM::REC_JOUR); writer.endRecord (ESM::REC_JOUR);

View file

@ -978,8 +978,8 @@ namespace MWRender
{ {
const NifOsg::TextKeyMap &keys = (*animiter)->getTextKeys(); const NifOsg::TextKeyMap &keys = (*animiter)->getTextKeys();
const AnimSource::ControllerMap& ctrls = (*animiter)->mControllerMap[0]; const AnimSource::ControllerMap& ctrls2 = (*animiter)->mControllerMap[0];
for (AnimSource::ControllerMap::const_iterator it = ctrls.begin(); it != ctrls.end(); ++it) for (AnimSource::ControllerMap::const_iterator it = ctrls2.begin(); it != ctrls2.end(); ++it)
{ {
if (Misc::StringUtils::ciEqual(it->first, mAccumRoot->getName())) if (Misc::StringUtils::ciEqual(it->first, mAccumRoot->getName()))
{ {

View file

@ -172,37 +172,37 @@ namespace MWRender
unsigned char r,g,b; unsigned char r,g,b;
float y = 0; float y2 = 0;
if (landData) if (landData)
y = (landData->mWnam[vertexY * 9 + vertexX] << 4) / 2048.f; y2 = (landData->mWnam[vertexY * 9 + vertexX] << 4) / 2048.f;
else else
y = (SCHAR_MIN << 4) / 2048.f; y2 = (SCHAR_MIN << 4) / 2048.f;
if (y < 0) if (y2 < 0)
{ {
r = static_cast<unsigned char>(14 * y + 38); r = static_cast<unsigned char>(14 * y2 + 38);
g = static_cast<unsigned char>(20 * y + 56); g = static_cast<unsigned char>(20 * y2 + 56);
b = static_cast<unsigned char>(18 * y + 51); b = static_cast<unsigned char>(18 * y2 + 51);
} }
else if (y < 0.3f) else if (y2 < 0.3f)
{ {
if (y < 0.1f) if (y2 < 0.1f)
y *= 8.f; y2 *= 8.f;
else else
{ {
y -= 0.1f; y2 -= 0.1f;
y += 0.8f; y2 += 0.8f;
} }
r = static_cast<unsigned char>(66 - 32 * y); r = static_cast<unsigned char>(66 - 32 * y2);
g = static_cast<unsigned char>(48 - 23 * y); g = static_cast<unsigned char>(48 - 23 * y2);
b = static_cast<unsigned char>(33 - 16 * y); b = static_cast<unsigned char>(33 - 16 * y2);
} }
else else
{ {
y -= 0.3f; y2 -= 0.3f;
y *= 1.428f; y2 *= 1.428f;
r = static_cast<unsigned char>(34 - 29 * y); r = static_cast<unsigned char>(34 - 29 * y2);
g = static_cast<unsigned char>(25 - 20 * y); g = static_cast<unsigned char>(25 - 20 * y2);
b = static_cast<unsigned char>(17 - 12 * y); b = static_cast<unsigned char>(17 - 12 * y2);
} }
data[texelY * mWidth * 3 + texelX * 3] = r; data[texelY * mWidth * 3 + texelX * 3] = r;

View file

@ -450,10 +450,10 @@ void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::
} }
else else
{ {
std::string id = MWMechanics::getLevelledItem(ref.getPtr().get<ESM::ItemLevList>()->mBase, false); std::string itemId = MWMechanics::getLevelledItem(ref.getPtr().get<ESM::ItemLevList>()->mBase, false);
if (id.empty()) if (itemId.empty())
return; return;
addInitialItem(id, owner, count, false, levItemList->mId); addInitialItem(itemId, owner, count, false, levItemList->mId);
} }
} }
else else