Skip to content

Commit 0fbef1a

Browse files
committed
gpl: clang-tidy
Signed-off-by: Augusto Berndt <[email protected]>
1 parent 003cdb2 commit 0fbef1a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/gpl/src/graphicsImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
#include <algorithm>
99
#include <cmath>
10+
#include <cstddef>
1011
#include <cstdint>
1112
#include <cstdio>
12-
#include <cstddef>
1313
#include <limits>
1414
#include <memory>
1515
#include <optional>

src/gpl/src/nesterovBase.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ void GCell::updateLocations()
134134
const double aspect_ratio = core_area.dx() / (double) core_area.dy();
135135
const double height = std::sqrt(inst_area / aspect_ratio);
136136
const double width = height * aspect_ratio;
137-
bbox.init(center_x - width / 2,
138-
center_y - height / 2,
139-
center_x + width / 2,
140-
center_y + height / 2);
137+
bbox.init(center_x - (width / 2),
138+
center_y - (height / 2),
139+
center_x + (width / 2),
140+
center_y + (height / 2));
141141
}
142142
// density coordi has the same center points.
143143
dLx_ = lx_ = bbox.xMin();
@@ -727,9 +727,7 @@ void BinGrid::initBins()
727727
if (idealBinArea != 0) {
728728
idealBinCnt = totalBinArea / idealBinArea;
729729
}
730-
if (idealBinCnt < 4) { // the smallest we allow is 2x2 bins
731-
idealBinCnt = 4;
732-
}
730+
idealBinCnt = std::max(idealBinCnt, 4);
733731

734732
dbBlock* block = pb_->db()->getChip()->getBlock();
735733
log_->info(
@@ -801,7 +799,7 @@ void BinGrid::initBins()
801799
const int bin_ly = ly_ + std::lround(idxY * binSizeY_);
802800
const int bin_ux = lx_ + std::lround((idxX + 1) * binSizeX_);
803801
const int bin_uy = ly_ + std::lround((idxY + 1) * binSizeY_);
804-
const int bin_index = idxY * binCntX_ + idxX;
802+
const int bin_index = (idxY * binCntX_) + idxX;
805803
bins_[bin_index]
806804
= Bin(idxX, idxY, bin_lx, bin_ly, bin_ux, bin_uy, targetDensity_);
807805
auto& bin = bins_[bin_index];

0 commit comments

Comments
 (0)