Skip to content

Commit 8768896

Browse files
committed
audiomixer: Supply constants in a way "-Og" optimization expects
These arguments are constrained to be compile-time constants, a fact that gcc complains about under "-Og" optimization, but not in normal builds. Declare them as enumerated types
1 parent bd7b03f commit 8768896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-module/audiomixer/Mixer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ static inline uint32_t mult16signed(uint32_t val, int32_t mul) {
262262
}
263263
#if (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) //Cortex-M4 w/FPU
264264
int32_t hi, lo;
265-
int32_t bits = 16; // saturate to 16 bits
266-
int32_t shift = 0; // shift is done automatically
265+
enum { bits = 16 }; // saturate to 16 bits
266+
enum { shift = 0 }; // shift is done automatically
267267
asm volatile("smulwb %0, %1, %2" : "=r" (lo) : "r" (mul), "r" (val));
268268
asm volatile("smulwt %0, %1, %2" : "=r" (hi) : "r" (mul), "r" (val));
269269
asm volatile("ssat %0, %1, %2, asr %3" : "=r" (lo) : "I" (bits), "r" (lo), "I" (shift));

0 commit comments

Comments
 (0)