Skip to content

Commit

Permalink
#116 Fix '-Wshadow' warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-ogre committed Jan 3, 2023
1 parent 2580b24 commit eda6497
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions CDT/include/CDT.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,22 +396,22 @@ unordered_map<Edge, std::vector<VertInd> > EdgeToSplitVertices(

unordered_map<Edge, std::vector<VertInd> > edgeToSplitVerts;
typedef unordered_map<Edge, EdgeVec>::const_iterator It;
for(It it = edgeToPieces.begin(); it != edgeToPieces.end(); ++it)
for(It e2pIt = edgeToPieces.begin(); e2pIt != edgeToPieces.end(); ++e2pIt)
{
const Edge& e = it->first;
const Edge& e = e2pIt->first;
const T dX = vertices[e.v2()].x - vertices[e.v1()].x;
const T dY = vertices[e.v2()].y - vertices[e.v1()].y;
const bool isX = std::abs(dX) >= std::abs(dY); // X-coord longer
const bool isAscending =
isX ? dX >= 0 : dY >= 0; // Longer coordinate ascends
const EdgeVec& pieces = it->second;
const EdgeVec& pieces = e2pIt->second;
std::vector<VertCoordPair> splitVerts;
// size is: 2[ends] + (pieces - 1)[split vertices] = pieces + 1
splitVerts.reserve(pieces.size() + 1);
typedef EdgeVec::const_iterator EIt;
for(EIt it = pieces.begin(); it != pieces.end(); ++it)
for(EIt pieceIt = pieces.begin(); pieceIt != pieces.end(); ++pieceIt)
{
const array<VertInd, 2> vv = {it->v1(), it->v2()};
const array<VertInd, 2> vv = {pieceIt->v1(), pieceIt->v2()};
typedef array<VertInd, 2>::const_iterator VIt;
for(VIt v = vv.begin(); v != vv.end(); ++v)
{
Expand Down
20 changes: 10 additions & 10 deletions CDT/include/KDTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,16 @@ class KDTree
NearestTask()
{}
NearestTask(
const node_index node,
const point_type& min,
const point_type& max,
const NodeSplitDirection::Enum dir,
const coord_type distSq)
: node(node)
, min(min)
, max(max)
, dir(dir)
, distSq(distSq)
const node_index node_,
const point_type& min_,
const point_type& max_,
const NodeSplitDirection::Enum dir_,
const coord_type distSq_)
: node(node_)
, min(min_)
, max(max_)
, dir(dir_)
, distSq(distSq_)
{}
};
// allocated in class (not in the 'nearest' method) for better performance
Expand Down
12 changes: 6 additions & 6 deletions visualizer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ public slots:
}

private:
void readData(const QString& file)
void readData(const QString& fileName)
{
QFile data(file);
if(!data.open(QFile::ReadOnly))
QFile file(fileName);
if(!file.open(QFile::ReadOnly))
{
QMessageBox::warning(
this, tr("CDT"), tr("Could not open file ") + file);
this, tr("CDT"), tr("Could not open file ") + fileName);
}
QTextStream inStream(&data);
QTextStream inStream(&file);
std::size_t nPts, nEdges;
inStream >> nPts >> nEdges;
m_points.clear();
Expand Down Expand Up @@ -345,7 +345,7 @@ public slots:
}
if(m_isDisplayIndices)
{
int iT = 0;
iT = 0;
for(TCit t = m_cdt.triangles.begin(); t != m_cdt.triangles.end();
++t, ++iT)
{
Expand Down

0 comments on commit eda6497

Please sign in to comment.