Skip to content

Commit 04f317b

Browse files
committed
Use SDL_FALLTHROUGH in various switch cases.
1 parent 4fc501c commit 04f317b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mojoal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,22 +1869,22 @@ static ALfloat calculate_distance_attenuation(const ALCcontext *ctx, const ALsou
18691869
switch (ctx->distance_model) {
18701870
case AL_INVERSE_DISTANCE_CLAMPED:
18711871
distance = SDL_min(SDL_max(distance, src->reference_distance), src->max_distance);
1872-
/* fallthrough */
1872+
SDL_FALLTHROUGH;
18731873
case AL_INVERSE_DISTANCE:
18741874
/* AL SPEC: "gain = AL_REFERENCE_DISTANCE / (AL_REFERENCE_DISTANCE + AL_ROLLOFF_FACTOR * (distance - AL_REFERENCE_DISTANCE))" */
18751875
return src->reference_distance / (src->reference_distance + src->rolloff_factor * (distance - src->reference_distance));
18761876

18771877
case AL_LINEAR_DISTANCE_CLAMPED:
18781878
distance = SDL_max(distance, src->reference_distance);
1879-
/* fallthrough */
1879+
SDL_FALLTHROUGH;
18801880
case AL_LINEAR_DISTANCE:
18811881
/* AL SPEC: "distance = min(distance, AL_MAX_DISTANCE) // avoid negative gain
18821882
gain = (1 - AL_ROLLOFF_FACTOR * (distance - AL_REFERENCE_DISTANCE) / (AL_MAX_DISTANCE - AL_REFERENCE_DISTANCE))" */
18831883
return 1.0f - src->rolloff_factor * (SDL_min(distance, src->max_distance) - src->reference_distance) / (src->max_distance - src->reference_distance);
18841884

18851885
case AL_EXPONENT_DISTANCE_CLAMPED:
18861886
distance = SDL_min(SDL_max(distance, src->reference_distance), src->max_distance);
1887-
/* fallthrough */
1887+
SDL_FALLTHROUGH;
18881888
case AL_EXPONENT_DISTANCE:
18891889
/* AL SPEC: "gain = (distance / AL_REFERENCE_DISTANCE) ^ (- AL_ROLLOFF_FACTOR)" */
18901890
return SDL_powf(distance / src->reference_distance, -src->rolloff_factor);

0 commit comments

Comments
 (0)