[opus] [PATCH] Eliminate signed division overhead in align()

Mark Harris mark.hsj at gmail.com
Tue Aug 4 17:53:07 PDT 2015


---
 src/opus_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/opus_private.h b/src/opus_private.h
index 5bbd7dc..3b62eed 100644
--- a/src/opus_private.h
+++ b/src/opus_private.h
@@ -114,7 +114,7 @@ static OPUS_INLINE int align(int i)
 {
     struct foo {char c; union { void* p; opus_int32 i; opus_val32 v; } u;};
 
-    int alignment = offsetof(struct foo, u);
+    unsigned int alignment = offsetof(struct foo, u);
 
     /* Optimizing compilers should optimize div and multiply into and
        for all sensible alignment values. */
-- 
2.4.5



More information about the opus mailing list