diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /intern/guardedalloc/intern/mallocn_inline.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'intern/guardedalloc/intern/mallocn_inline.h')
-rw-r--r-- | intern/guardedalloc/intern/mallocn_inline.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/intern/guardedalloc/intern/mallocn_inline.h b/intern/guardedalloc/intern/mallocn_inline.h index 064cc063668..f8bb7861fc9 100644 --- a/intern/guardedalloc/intern/mallocn_inline.h +++ b/intern/guardedalloc/intern/mallocn_inline.h @@ -35,21 +35,21 @@ MEM_INLINE bool MEM_size_safe_multiply(size_t a, size_t b, size_t *result) { - /* A size_t with its high-half bits all set to 1. */ - const size_t high_bits = SIZE_MAX << (sizeof(size_t) * 8 / 2); - *result = a * b; + /* A size_t with its high-half bits all set to 1. */ + const size_t high_bits = SIZE_MAX << (sizeof(size_t) * 8 / 2); + *result = a * b; - if (UNLIKELY(*result == 0)) { - return (a == 0 || b == 0); - } + if (UNLIKELY(*result == 0)) { + return (a == 0 || b == 0); + } - /* - * We got a non-zero size, but we don't know if we overflowed to get - * there. To avoid having to do a divide, we'll be clever and note that - * if both A and B can be represented in N/2 bits, then their product - * can be represented in N bits (without the possibility of overflow). - */ - return ((high_bits & (a | b)) == 0 || (*result / b == a)); + /* + * We got a non-zero size, but we don't know if we overflowed to get + * there. To avoid having to do a divide, we'll be clever and note that + * if both A and B can be represented in N/2 bits, then their product + * can be represented in N bits (without the possibility of overflow). + */ + return ((high_bits & (a | b)) == 0 || (*result / b == a)); } -#endif /* __MALLOCN_INLINE_H__ */ +#endif /* __MALLOCN_INLINE_H__ */ |