Skip to content

Commit 5e1d915

Browse files
committed
semgrep bugs
1 parent 8954009 commit 5e1d915

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Editor/Minimap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void renderDensity(SetPixelData& spd, const int* colx)
239239
if(it->isMine || it->isWarped) continue;
240240
double pre = (it > first) ? (it - 1)->time : (it->time - 1.0);
241241
double post = (it < last) ? (it + 1)->time : (it->time + 1.0);
242-
if(post > pre) density = std::max(density, 2.0 / (post - pre);
242+
if(post > pre) density = std::max(density, 2.0 / (post - pre));
243243
}
244244
if(density > 0.0) SetDensityRow(spd.pixels, y, density);
245245
row += rowPerPix;

src/Editor/Notefield.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ void drawReceptorGlow()
565565
if(note->isMine | note->isWarped | (note->type == NOTE_FAKE)) continue;
566566

567567
double lum = 1.5 - (time - note->endtime) * 6.0;
568-
uint8_t alpha = (uint8_t)std::clamp((int)(lum * 255.0, 0, 255);
568+
uint8_t alpha = (uint8_t)std::clamp((int)(lum * 255.0), 0, 255);
569569
if(alpha > 0)
570570
{
571571
noteskin->recepGlow[c].draw(&batch, myColX[c], myY, alpha);

src/Editor/TextOverlay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void drawHud()
444444
x = 4, y = 4;
445445
for(auto& m : hudEntries_)
446446
{
447-
int a = std::clamp((int)(m.timeLeft * 512.0f + 256.0f, 0, 255);
447+
int a = std::clamp((int)(m.timeLeft * 512.0f + 256.0f), 0, 255);
448448

449449
textStyle.textColor = Color32a(textStyle.textColor, a);
450450
textStyle.shadowColor = Color32a(textStyle.shadowColor, a);

src/Editor/Waveform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void sampleEdges(WaveEdge* edges, int w, int h, int channel, int blockId, bool f
443443
double samplesPerBlock = (double)TEX_H * samplesPerPixel;
444444

445445
int64_t srcFrames = filtered ? waveformFilter_->samplesL.size() : music.getNumFrames();
446-
int64_t samplePos = std::max((int64_t)0, (int64_t)(samplesPerBlock * (double)blockId);
446+
int64_t samplePos = std::max((int64_t)0, (int64_t)(samplesPerBlock * (double)blockId));
447447
double sampleCount = std::min((double) srcFrames - samplePos, samplesPerBlock);
448448

449449
if (samplePos >= srcFrames || sampleCount <= 0)

0 commit comments

Comments
 (0)