Skip to content

Commit 017644f

Browse files
committed
semgrep bugs
1 parent 272d0f7 commit 017644f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Editor/Minimap.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ struct SetPixelData
6868

6969
static void SetPixels(const SetPixelData& spd, int x, double tor, uint32_t color)
7070
{
71-
int y = std::clamp((int)((tor - spd.startOfs) * spd.pixPerOfs, 0, MAP_HEIGHT - 1);
71+
int y = std::clamp((int)((tor - spd.startOfs) * spd.pixPerOfs), 0, MAP_HEIGHT - 1);
7272
uint32_t* dst = spd.pixels + y * MAP_WIDTH + x;
7373
for(int i = 0; i < spd.noteW; ++i, ++dst) *dst = color;
7474
}
7575

7676
static void SetPixels(const SetPixelData& spd, int x, double tor, double end, uint32_t color)
7777
{
78-
int yt = std::clamp((int)((tor - spd.startOfs) * spd.pixPerOfs, 0, MAP_HEIGHT - 1);
79-
int yb = std::clamp((int)((end - spd.startOfs) * spd.pixPerOfs, 0, MAP_HEIGHT - 1);
78+
int yt = std::clamp((int)((tor - spd.startOfs) * spd.pixPerOfs), 0, MAP_HEIGHT - 1);
79+
int yb = std::clamp((int)((end - spd.startOfs) * spd.pixPerOfs), 0, MAP_HEIGHT - 1);
8080
for(int y = yt; y <= yb; ++y)
8181
{
8282
uint32_t* dst = spd.pixels + y * MAP_WIDTH + x;
@@ -198,7 +198,7 @@ static void SetDensityRow(uint32_t* pixels, int y, double density)
198198
int b = BlendI32(colors[ci + 2], colors[ci + 5], bf);
199199
uint32_t col = Color32(r, g, b);
200200

201-
int w = std::clamp((int)(density * 0.05, 4, MAP_WIDTH) / 2;
201+
int w = std::clamp((int)(density * 0.05), 4, MAP_WIDTH) / 2;
202202
uint32_t* dst = pixels + y * MAP_WIDTH + MAP_WIDTH / 2 - w;
203203
for(int i = -w; i < w; ++i, ++dst) *dst = col;
204204
}
@@ -283,7 +283,7 @@ double myGetMapOffset(int y)
283283
topY = chartRect.y;
284284
bottomY = chartRect.y + chartRect.h;
285285

286-
double t = std::clamp((double)(y - topY) / (double)(bottomY - topY, 0.0, 1.0);
286+
double t = std::clamp((double)(y - topY) / (double)(bottomY - topY), 0.0, 1.0);
287287
if(gView->hasReverseScroll()) t = 1.0 - t;
288288

289289
tor = myChartBeginOfs + (myChartEndOfs - myChartBeginOfs) * t;

0 commit comments

Comments
 (0)