Commit 5d55f0be authored by Michael Reeves's avatar Michael Reeves

Fix -wshadow warnings

*resolved on two collisions between unrelated variables, about 80
duplicate definitions for locals.
parent bd610ffe
......@@ -1002,7 +1002,7 @@ void SourceData::FileData::checkLineForComments(
;
if(!bWhite)
{
int size = i - commentStart;
size = i - commentStart;
m_unicodeBuf.replace(commentStart, size, QString(" ").repeated(size));
}
return;
......@@ -1024,7 +1024,7 @@ void SourceData::FileData::checkLineForComments(
checkLineForComments(p, i, size, bWhite, bCommentInLine, bStartsOpenComment);
if(!bWhite)
{
int size = i - commentStart;
size = i - commentStart;
m_unicodeBuf.replace(commentStart, size, QString(" ").repeated(size)); }
return;
}
......@@ -1074,7 +1074,7 @@ void SourceData::FileData::removeComments()
checkLineForComments(p, i, size, bWhite, bCommentInLine, bWithinComment);
if(!bWhite)
{
int size = i - commentStart;
size = i - commentStart;
m_unicodeBuf.replace(commentStart, size, QString(" ").repeated(size));
}
break;
......@@ -1331,7 +1331,6 @@ void calcDiff3LineListUsingBC(
if((*i3).lineB != -1 ||
(before_or_on_equal_line_in_A && i3->lineA != -1))
{
Diff3Line d3l;
d3l.lineB = (*i3).lineB;
(*i3).lineB = -1;
......@@ -1408,7 +1407,6 @@ void calcDiff3LineListUsingBC(
if((*i3).lineC != -1 ||
(before_or_on_equal_line_in_A && i3->lineA != -1))
{
Diff3Line d3l;
d3l.lineC = (*i3).lineC;
(*i3).lineC = -1;
......
......@@ -898,7 +898,7 @@ void DiffTextWindowData::writeLine(
for(i = wrapLineOffset; i < lineLength; ++i)
{
QColor c = m_pOptions->m_fgColor;
c = m_pOptions->m_fgColor;
int cchanged = charChanged[i] | whatChanged;
if(cchanged == 2) {
......@@ -1933,11 +1933,11 @@ bool DiffTextWindowFrame::eventFilter(QObject* o, QEvent* e)
}
if(o == d->m_pFileSelection && e->type() == QEvent::Drop)
{
QDropEvent* d = static_cast<QDropEvent*>(e);
QDropEvent* dropEvent = static_cast<QDropEvent*>(e);
if(d->mimeData()->hasUrls())
if(dropEvent->mimeData()->hasUrls())
{
QList<QUrl> lst = d->mimeData()->urls();
QList<QUrl> lst = dropEvent->mimeData()->urls();
if(lst.count() > 0)
{
......
......@@ -1140,7 +1140,7 @@ bool DirectoryMergeWindow::Data::init(
m_fileMergeMap.clear();
s_eCaseSensitivity = m_bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive;
t_DirectoryList::iterator i;
t_DirectoryList::iterator dirIterator;
// calc how many directories will be read:
double nofScans = (m_dirA.isValid() ? 1 : 0) + (m_dirB.isValid() ? 1 : 0) + (m_dirC.isValid() ? 1 : 0);
......@@ -1174,11 +1174,11 @@ bool DirectoryMergeWindow::Data::init(
m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks,
m_pOptions->m_bDmUseCvsIgnore);
for(i = m_dirListA.begin(); i != m_dirListA.end(); ++i)
for(dirIterator = m_dirListA.begin(); dirIterator != m_dirListA.end(); ++dirIterator)
{
MergeFileInfos& mfi = m_fileMergeMap[FileKey(*i)];
//std::cout <<i->filePath()<<std::endl;
mfi.m_pFileInfoA = &(*i);
MergeFileInfos& mfi = m_fileMergeMap[FileKey(*dirIterator)];
mfi.m_pFileInfoA = &(*dirIterator);
}
}
......@@ -1194,10 +1194,10 @@ bool DirectoryMergeWindow::Data::init(
m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks,
m_pOptions->m_bDmUseCvsIgnore);
for(i = m_dirListB.begin(); i != m_dirListB.end(); ++i)
for(dirIterator = m_dirListB.begin(); dirIterator != m_dirListB.end(); ++dirIterator)
{
MergeFileInfos& mfi = m_fileMergeMap[FileKey(*i)];
mfi.m_pFileInfoB = &(*i);
MergeFileInfos& mfi = m_fileMergeMap[FileKey(*dirIterator)];
mfi.m_pFileInfoB = &(*dirIterator);
if(mfi.m_pFileInfoA && mfi.m_pFileInfoA->fileName() == mfi.m_pFileInfoB->fileName())
mfi.m_pFileInfoB->setSharedName(mfi.m_pFileInfoA->fileName()); // Reduce memory by sharing the name.
}
......@@ -1216,10 +1216,10 @@ bool DirectoryMergeWindow::Data::init(
m_pOptions->m_DmDirAntiPattern, m_pOptions->m_bDmFollowDirLinks,
m_pOptions->m_bDmUseCvsIgnore);
for(i = m_dirListC.begin(); i != m_dirListC.end(); ++i)
for(dirIterator = m_dirListC.begin(); dirIterator != m_dirListC.end(); ++dirIterator)
{
MergeFileInfos& mfi = m_fileMergeMap[FileKey(*i)];
mfi.m_pFileInfoC = &(*i);
MergeFileInfos& mfi = m_fileMergeMap[FileKey(*dirIterator)];
mfi.m_pFileInfoC = &(*dirIterator);
}
eDefaultMergeOp = eMergeABCToDest;
......@@ -1254,8 +1254,8 @@ bool DirectoryMergeWindow::Data::init(
q->sortByColumn(0, Qt::AscendingOrder);
for(int i = 0; i < columnCount(QModelIndex()); ++i)
q->resizeColumnToContents(i);
for(int column = 0; column < columnCount(QModelIndex()); ++column)
q->resizeColumnToContents(column);
// Try to improve the view a little bit.
QWidget* pParent = q->parentWidget();
......@@ -1827,7 +1827,7 @@ QModelIndex DirectoryMergeWindow::Data::treeIterator(QModelIndex mi, bool bVisit
mi = mi.parent();
while(mi.isValid())
{
QModelIndex miNextSibling = nextSibling(mi);
miNextSibling = nextSibling(mi);
if(miNextSibling.isValid())
{
mi = miNextSibling;
......@@ -2921,7 +2921,7 @@ void DirectoryMergeWindow::Data::mergeContinue(bool bStart, bool bVerbose)
{
for(int childIdx = 0; childIdx < rowCount(miParent); ++childIdx)
{
MergeFileInfos* pMFI = getMFI(index(childIdx, 0, miParent));
pMFI = getMFI(index(childIdx, 0, miParent));
if((!bSim && !pMFI->m_bOperationComplete) || (bSim && pMFI->m_bSimOpComplete))
{
bDone = false;
......@@ -2930,7 +2930,7 @@ void DirectoryMergeWindow::Data::mergeContinue(bool bStart, bool bVerbose)
}
if(bDone)
{
MergeFileInfos* pMFI = getMFI(miParent);
pMFI = getMFI(miParent);
if(bSim)
pMFI->m_bSimOpComplete = bDone;
else
......
......@@ -1658,7 +1658,6 @@ bool FileAccessJobHandler::listDir(t_DirectoryList* pDirList, bool bRecursive, b
{
t_DirectoryList subDirsList;
t_DirectoryList::iterator i;
for(i = m_pDirList->begin(); i != m_pDirList->end(); ++i)
{
if(i->isDir() && (!i->isSymLink() || m_bFollowDirLinks))
......
......@@ -435,7 +435,7 @@ void KDiff3App::completeInit(const QString& fn1, const QString& fn2, const QStri
if(pSD != nullptr)
{
// Save this file directly, not via the merge result window.
bool bSuccess = false;
bSuccess = false;
FileAccess fa(m_outputFilename);
if(m_pOptions->m_bDmCreateBakFiles && fa.exists())
{
......@@ -452,7 +452,7 @@ void KDiff3App::completeInit(const QString& fn1, const QString& fn2, const QStri
}
else if(m_pMergeResultWindow->getNrOfUnsolvedConflicts() == 0)
{
bool bSuccess = m_pMergeResultWindow->saveDocument(m_pMergeResultWindowTitle->getFileName(), m_pMergeResultWindowTitle->getEncoding(), m_pMergeResultWindowTitle->getLineEndStyle());
bSuccess = m_pMergeResultWindow->saveDocument(m_pMergeResultWindowTitle->getFileName(), m_pMergeResultWindowTitle->getEncoding(), m_pMergeResultWindowTitle->getLineEndStyle());
if(bSuccess) ::exit(0);
}
}
......
......@@ -1183,7 +1183,7 @@ QString calcHistorySortKey(const QString& keyOrder, QRegExp& matchedRegExpr, con
QString groupRegExp = parenthesesGroupList[groupIdx - 1];
if(groupRegExp.indexOf('|') < 0 || groupRegExp.indexOf('(') >= 0)
{
bool bOk = false;
bOk = false;
int i = s.toInt(&bOk);
if(bOk && i >= 0 && i < 10000)
s.sprintf("%04d", i); // This should help for correct sorting of numbers.
......@@ -1979,8 +1979,6 @@ void MergeResultWindow::paintEvent(QPaintEvent*)
if(m_bCursorOn && hasFocus() && m_cursorYPos >= m_firstLine)
{
QPainter painter(this);
painter.setPen(m_pOptions->m_fgColor);
QString str = getString(m_cursorYPos);
......
......@@ -1072,9 +1072,9 @@ void OptionDialog::setupMergePage(void)
gbox->addWidget(pGroupBox, line, 0, 1, 2);
++line;
{
QGridLayout* gbox = new QGridLayout(pGroupBox);
gbox = new QGridLayout(pGroupBox);
gbox->setColumnStretch(1, 10);
int line = 0;
line = 0;
label = new QLabel(i18n("Auto merge regular expression:"), page);
gbox->addWidget(label, line, 0);
......@@ -1097,9 +1097,9 @@ void OptionDialog::setupMergePage(void)
gbox->addWidget(pGroupBox, line, 0, 1, 2);
++line;
{
QGridLayout* gbox = new QGridLayout(pGroupBox);
gbox = new QGridLayout(pGroupBox);
gbox->setColumnStretch(1, 10);
int line = 0;
line = 0;
label = new QLabel(i18n("History start regular expression:"), page);
gbox->addWidget(label, line, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment