diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-05-03 11:16:32 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-05-03 11:16:32 +0300 |
commit | 12db6dad9f8a0d8e76f00fe88e135da012d08bc4 (patch) | |
tree | a5b50516cc4357d892295f9107e429441b7a57c1 /mallocx.c | |
parent | 2b75998376e24e5ca3967bab2d109cb00e0eb2f5 (diff) | |
download | bdwgc-12db6dad9f8a0d8e76f00fe88e135da012d08bc4.tar.gz |
Workaround 'opposite expression on both sides of &' cppcheck style warning
* mallocx.c (GC_posix_memalign): Replace (align-1)&align with
align_minus_one&align where align_minus_one local variable is set to
align-1.
Diffstat (limited to 'mallocx.c')
-rw-r--r-- | mallocx.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -533,7 +533,8 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_memalign(size_t align, size_t lb) GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb) { /* Check alignment properly. */ - if (((align - 1) & align) != 0 || align < sizeof(void *)) { + size_t align_minus_one = align - 1; /* to workaround a cppcheck warning */ + if (align < sizeof(void *) || (align_minus_one & align) != 0) { # ifdef MSWINCE return ERROR_INVALID_PARAMETER; # else |