summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Giles <giles@thaumas.net>2012-08-17 10:16:24 -0700
committerRalph Giles <giles@thaumas.net>2012-08-17 10:16:24 -0700
commit3a9b35453c1bef1293c6faf73f95b8697ad4232c (patch)
tree78330d1a028d2579c64179a0b07556f983023850
parent2b14ac23f18f0d18f8df6af8e7892981b9cbd784 (diff)
downloadopus-3a9b35453c1bef1293c6faf73f95b8697ad4232c.tar.gz
Fix an MSVC warning.
Microsoft Visual Studio 2010 warns about 'C4146: unary minus operator applied to unsigned type, result still unsigned' because of the '&-sizeof(void*)' in align(). This commit works around the warning by casting the size_t to int before negation. Patch by Hauke, who reported the issue on the opus mailing list. Reviewed by derf.
-rw-r--r--src/opus_private.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opus_private.h b/src/opus_private.h
index 6534a5ed..52482bc1 100644
--- a/src/opus_private.h
+++ b/src/opus_private.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 Xiph.Org Foundation
+/* Copyright (c) 2012 Xiph.Org Foundation
Written by Jean-Marc Valin */
/*
Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 le
/* Make sure everything's aligned to sizeof(void *) bytes */
static inline int align(int i)
{
- return (i+sizeof(void *)-1)&-sizeof(void *);
+ return (i+sizeof(void *)-1)&-((int)sizeof(void *));
}
opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen, int self_delimited);