Skip to content

Commit a61d33b

Browse files
committed
Fix progresbar display issues on Win/Lin
1 parent 8722e11 commit a61d33b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/analyze/audio.nim

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import ../util/bar
1010
import ../resampler
1111

1212
# Enable project wide
13-
{.passC: "-fno-signaling-nans -fno-math-errno -fno-trapping-math -freciprocal-math".}
13+
when defined(macosx):
14+
# Apply fast-math for clang: see https://simonbyrne.github.io/notes/fastmath/
15+
{.passC: "-ffast-math".}
16+
else:
17+
{.passC: "-fno-signaling-nans -fno-math-errno -fno-trapping-math -freciprocal-math".}
1418
{.passL: "-flto".}
1519

1620
type
@@ -116,10 +120,6 @@ proc readChunk(iter: AudioIterator): float32 =
116120

117121
var maxAbs: float32 = 0.0
118122

119-
# Apply fast-math locally: see https://simonbyrne.github.io/notes/fastmath/
120-
{.push optimization: speed.}
121-
{.passC: "-ffast-math".}
122-
123123
# SIMD-style loop (unrolled)
124124
for i in countup(0, simdSamples - 1, simdWidth):
125125
let v0 = abs(samples[i])
@@ -133,8 +133,6 @@ proc readChunk(iter: AudioIterator): float32 =
133133
for i in simdSamples ..< totalSamples:
134134
maxAbs = max(maxAbs, abs(samples[i]))
135135

136-
{.pop.}
137-
138136
return maxAbs
139137

140138
proc flushResampler(iter: AudioIterator) =

0 commit comments

Comments
 (0)