Skip to content

Commit b632f9f

Browse files
authored
Merge pull request #2741 from antonblanchard/compiler-warnings
Fix a number of compiler warnings
2 parents 2e7a949 + 0320e3f commit b632f9f

File tree

13 files changed

+11
-44
lines changed

13 files changed

+11
-44
lines changed

src/drt/src/TritonRoute.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ void TritonRoute::readParams(const string& fileName)
980980
{
981981
logger_->warn(utl::DRT, 252, "params file is deprecated. Use tcl arguments.");
982982

983-
int readParamCnt = 0;
984983
ifstream fin(fileName.c_str());
985984
string line;
986985
if (fin.is_open()) {
@@ -1014,51 +1013,37 @@ void TritonRoute::readParams(const string& fileName)
10141013
"write_guide instead.");
10151014
} else if (field == "save_guide_updates") {
10161015
SAVE_GUIDE_UPDATES = true;
1017-
++readParamCnt;
10181016
} else if (field == "outputMaze") {
10191017
OUT_MAZE_FILE = value;
1020-
++readParamCnt;
10211018
} else if (field == "outputDRC") {
10221019
DRC_RPT_FILE = value;
1023-
++readParamCnt;
10241020
} else if (field == "outputCMap") {
10251021
CMAP_FILE = value;
1026-
++readParamCnt;
10271022
} else if (field == "threads") {
10281023
logger_->warn(utl::DRT,
10291024
274,
10301025
"Deprecated threads param in params file."
10311026
" Use 'set_thread_count'.");
1032-
++readParamCnt;
10331027
} else if (field == "verbose")
10341028
VERBOSE = atoi(value.c_str());
10351029
else if (field == "dbProcessNode") {
10361030
DBPROCESSNODE = value;
1037-
++readParamCnt;
10381031
} else if (field == "viaInPinBottomLayer") {
10391032
VIAINPIN_BOTTOMLAYER_NAME = value;
1040-
++readParamCnt;
10411033
} else if (field == "viaInPinTopLayer") {
10421034
VIAINPIN_TOPLAYER_NAME = value;
1043-
++readParamCnt;
10441035
} else if (field == "drouteEndIterNum") {
10451036
END_ITERATION = atoi(value.c_str());
1046-
++readParamCnt;
10471037
} else if (field == "OR_SEED") {
10481038
OR_SEED = atoi(value.c_str());
1049-
++readParamCnt;
10501039
} else if (field == "OR_K") {
10511040
OR_K = atof(value.c_str());
1052-
++readParamCnt;
10531041
} else if (field == "bottomRoutingLayer") {
10541042
BOTTOM_ROUTING_LAYER_NAME = value;
1055-
++readParamCnt;
10561043
} else if (field == "topRoutingLayer") {
10571044
TOP_ROUTING_LAYER_NAME = value;
1058-
++readParamCnt;
10591045
} else if (field == "initRouteShapeCost") {
10601046
ROUTESHAPECOST = atoi(value.c_str());
1061-
++readParamCnt;
10621047
} else if (field == "clean_patches")
10631048
CLEAN_PATCHES = true;
10641049
}

src/drt/src/dr/FlexDR_init.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,30 +188,25 @@ void FlexDRWorker::initNetObjs(
188188
{
189189
vector<frBlockObject*> result;
190190
design->getRegionQuery()->queryDRObj(getExtBox(), result);
191-
int cnt1 = 0;
192-
int cnt2 = 0;
193191
for (auto rptr : result) {
194192
if (rptr->typeId() == frcPathSeg) {
195193
auto cptr = static_cast<frPathSeg*>(rptr);
196194
if (cptr->hasNet()) {
197195
initNetObjs_pathSeg(cptr, nets, netRouteObjs, netExtObjs);
198-
cnt1++;
199196
} else {
200197
cout << "Error: initNetObjs hasNet() empty" << endl;
201198
}
202199
} else if (rptr->typeId() == frcVia) {
203200
auto cptr = static_cast<frVia*>(rptr);
204201
if (cptr->hasNet()) {
205202
initNetObjs_via(cptr, nets, netRouteObjs, netExtObjs);
206-
cnt2++;
207203
} else {
208204
cout << "Error: initNetObjs hasNet() empty" << endl;
209205
}
210206
} else if (rptr->typeId() == frcPatchWire) {
211207
auto cptr = static_cast<frPatchWire*>(rptr);
212208
if (cptr->hasNet()) {
213209
initNetObjs_patchWire(cptr, nets, netRouteObjs, netExtObjs);
214-
cnt1++;
215210
} else {
216211
cout << "Error: initNetObjs hasNet() empty" << endl;
217212
}

src/drt/src/dr/FlexDR_maze.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ void FlexDRWorker::modMinSpacingCostPlanar(const Rect& box,
319319
}
320320
Point pt, pt1, pt2, pt3, pt4;
321321
frSquaredDistance distSquare = 0;
322-
int cnt = 0;
323322
for (int i = mIdx1.x(); i <= mIdx2.x(); i++) {
324323
for (int j = mIdx1.y(); j <= mIdx2.y(); j++) {
325324
gridGraph_.getPoint(pt, i, j);
@@ -381,7 +380,6 @@ void FlexDRWorker::modMinSpacingCostPlanar(const Rect& box,
381380
break;
382381
default:;
383382
}
384-
cnt++;
385383
}
386384
}
387385
}

src/drt/src/gc/FlexGC_init.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ void FlexGCWorker::Impl::initDesign(const frDesign* design, bool skipDR)
183183
point_t(extBox.xMax(), extBox.yMax()));
184184
auto regionQuery = design->getRegionQuery();
185185
frRegionQuery::Objects<frBlockObject> queryResult;
186-
int cnt = 0;
187186
// init all non-dr objs from design
188187
for (auto i = 0; i <= getTech()->getTopLayerNum(); i++) {
189188
queryResult.clear();
@@ -193,14 +192,12 @@ void FlexGCWorker::Impl::initDesign(const frDesign* design, bool skipDR)
193192
continue;
194193
}
195194
initObj(box, i, obj, true);
196-
cnt++;
197195
}
198196
}
199197
// init all dr objs from design
200198
if (getDRWorker() || skipDR) {
201199
return;
202200
}
203-
cnt = 0;
204201
for (auto i = getTech()->getBottomLayerNum();
205202
i <= getTech()->getTopLayerNum();
206203
i++) {
@@ -211,7 +208,6 @@ void FlexGCWorker::Impl::initDesign(const frDesign* design, bool skipDR)
211208
continue;
212209
}
213210
initObj(box, i, obj, false);
214-
cnt++;
215211
}
216212
}
217213
}

src/drt/src/io/io_guide.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,11 @@ void io::Parser::checkPinForGuideEnclosure(frBlockObject* pin,
272272
DRT, 1008, "checkPinForGuideEnclosure invoked with non-term object.");
273273
}
274274
for (auto& pinRect : pinShapes) {
275-
int i = 0;
276275
for (auto& guide : guides) {
277276
if (pinRect.getLayerNum() == guide.getLayerNum()
278277
&& guide.getBBox().overlaps(pinRect.getBBox())) {
279278
return;
280279
}
281-
i++;
282280
}
283281
}
284282
patchGuides(net, pin, guides);

src/drt/src/io/io_parser_helper.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ void io::Parser::initRPin_rpin()
661661
}
662662
// term
663663
for (auto& term : net->getBTerms()) {
664-
int pinIdx = 0;
665664
auto trueTerm = term;
666665
for (auto& pin : trueTerm->getPins()) {
667666
auto rpin = make_unique<frRPin>();
@@ -672,8 +671,6 @@ void io::Parser::initRPin_rpin()
672671
rpin->setAccessPoint(prefAp);
673672

674673
net->addRPin(rpin);
675-
676-
pinIdx++;
677674
}
678675
}
679676
}
@@ -893,7 +890,6 @@ void io::Parser::buildGCellPatterns(odb::dbDatabase* db)
893890
== dbTechLayerDir::HORIZONTAL);
894891
frCoord gcLow = isH ? gcellBox.yMin() : gcellBox.xMax();
895892
frCoord gcHigh = isH ? gcellBox.yMax() : gcellBox.xMin();
896-
int trackCnt = 0;
897893
for (auto& tp : design_->getTopBlock()->getTrackPatterns(layerNum)) {
898894
if ((tech_->getLayer(layerNum)->getDir() == dbTechLayerDir::HORIZONTAL
899895
&& tp->isHorizontal() == false)
@@ -914,7 +910,6 @@ void io::Parser::buildGCellPatterns(odb::dbDatabase* db)
914910
&& trackNum * (int) tp->getTrackSpacing() + tp->getStartCoord()
915911
< gcHigh;
916912
trackNum++) {
917-
trackCnt++;
918913
}
919914
}
920915
}

src/drt/src/ta/FlexTA_graphics.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ void FlexTAGraphics::drawIrouteGuide(frNet* net,
7373
if (connFig->typeId() == frcPathSeg) {
7474
auto seg = static_cast<frPathSeg*>(connFig);
7575
if (seg->getLayerNum() == layerNum) {
76-
auto bbox = seg->getBBox();
7776
painter.drawRect(seg->getBBox());
7877
}
7978
}

src/gui/src/clockWidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,9 +923,9 @@ void ClockTreeView::wheelEvent(QWheelEvent* event)
923923
const auto anchor = transformationAnchor();
924924
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
925925

926-
if (event->delta() > 0) {
926+
if (event->angleDelta().y() > 0) {
927927
scale(factor, factor);
928-
} else if (event->delta() < 0) {
928+
} else if (event->angleDelta().y() < 0) {
929929
scale(1.0 / factor, 1.0 / factor);
930930
}
931931

src/gui/src/layoutViewer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ class GuiPainter : public Painter
187187
void drawRect(const odb::Rect& rect, int roundX = 0, int roundY = 0) override
188188
{
189189
if (roundX > 0 || roundY > 0)
190-
painter_->drawRoundRect(
190+
painter_->drawRoundedRect(
191191
QRect(rect.xMin(), rect.yMin(), rect.dx(), rect.dy()),
192192
roundX,
193-
roundY);
193+
roundY,
194+
Qt::RelativeSize);
194195
else
195196
painter_->drawRect(QRect(rect.xMin(), rect.yMin(), rect.dx(), rect.dy()));
196197
}

src/gui/src/scriptWidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace odb {
4343
class dbDatabase;
4444
} // namespace odb
4545

46-
class Tcl_Interp;
46+
struct Tcl_Interp;
4747

4848
namespace gui {
4949
class TclCmdInputWidget;

0 commit comments

Comments
 (0)