shithub: opus

Download patch

ref: 512e6270ea316b5a07656b060419a38c1e5a818f
parent: b75bd48d82281193681c49c00fca9773a45fb0d8
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Tue Feb 20 09:11:57 EST 2024

Silences gcc warning

warning: expression does not compute the number of elements in this array
Seems like gcc thinks we're trying to get the number of elements in our
array or something like that. It then suggests adding parentheses to
silence the warning.

--- a/celt/stack_alloc.h
+++ b/celt/stack_alloc.h
@@ -141,7 +141,7 @@
 #else
 
 #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
-#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char))))
+#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/(sizeof(char))),(stack)+=(size)*(sizeof(type)/(sizeof(char))),(type*)((stack)-(size)*(sizeof(type)/(sizeof(char)))))
 #if 0 /* Set this to 1 to instrument pseudostack usage */
 #define RESTORE_STACK (printf("%ld %s:%d\n", global_stack-scratch_ptr, __FILE__, __LINE__),global_stack = _saved_stack)
 #else
--