summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-14 05:36:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-14 05:36:22 +0100
commit58f30175e1ed30aa8a3521d5b3a1ae700e5c5d23 (patch)
tree689bda9d26a6df781c691cdd619330bd193a9014 /libavutil
parentd18706244f0c4459183cb58b198ed911e535eb3b (diff)
downloadffmpeg-58f30175e1ed30aa8a3521d5b3a1ae700e5c5d23.tar.gz
mem: minor simplification of the alignment hack code
Idea-by: wanzhang Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 4253740a10..250b5f745e 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -84,7 +84,7 @@ void *av_malloc(size_t size)
ptr = malloc(size + ALIGN);
if (!ptr)
return ptr;
- diff = ((-(long)ptr - 1)&(ALIGN - 1)) + 1;
+ diff = ((~(long)ptr)&(ALIGN - 1)) + 1;
ptr = (char *)ptr + diff;
((char *)ptr)[-1] = diff;
#elif HAVE_POSIX_MEMALIGN