summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_common.h
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2019-03-19 17:16:41 -0700
committerJerome Jiang <jianj@google.com>2019-03-19 17:49:41 -0700
commitaa04b6f9a7475e9d9457dfc5bf441faf15efc466 (patch)
tree10bb2ce356e613e4ba8c10c862c29a79323a5e58 /vp9/common/vp9_common.h
parent60f76593e344dcef468752b49cf79be19b5adb0d (diff)
downloadlibvpx-aa04b6f9a7475e9d9457dfc5bf441faf15efc466.tar
libvpx-aa04b6f9a7475e9d9457dfc5bf441faf15efc466.tar.gz
libvpx-aa04b6f9a7475e9d9457dfc5bf441faf15efc466.tar.bz2
libvpx-aa04b6f9a7475e9d9457dfc5bf441faf15efc466.zip
Wrap macro definition in do-while(0)
Change-Id: Id654a48d2fa40355552d7267e58461e6cc1c6998
Diffstat (limited to 'vp9/common/vp9_common.h')
-rw-r--r--vp9/common/vp9_common.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/vp9/common/vp9_common.h b/vp9/common/vp9_common.h
index e3c5535dd..9048b515b 100644
--- a/vp9/common/vp9_common.h
+++ b/vp9/common/vp9_common.h
@@ -27,17 +27,17 @@ extern "C" {
// Only need this for fixed-size arrays, for structs just assign.
#define vp9_copy(dest, src) \
- { \
+ do { \
assert(sizeof(dest) == sizeof(src)); \
memcpy(dest, src, sizeof(src)); \
- }
+ } while (0)
// Use this for variably-sized arrays.
#define vp9_copy_array(dest, src, n) \
- { \
+ do { \
assert(sizeof(*(dest)) == sizeof(*(src))); \
memcpy(dest, src, (n) * sizeof(*(src))); \
- }
+ } while (0)
#define vp9_zero(dest) memset(&(dest), 0, sizeof(dest))
#define vp9_zero_array(dest, n) memset(dest, 0, (n) * sizeof(*(dest)))