From e3348699eb601782f47cc382cf19140a5cc97a31 Mon Sep 17 00:00:00 2001 From: Daniel Hood Date: Sun, 7 Oct 2018 15:20:15 -0700 Subject: [PATCH 1/2] Fix build error caused by -Werror=class-memaccess on gcc 8.2.1 and clang tags/RELEASE_601/final --- yoga/Yoga.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 6d146c3098..fecbac0e13 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1851,7 +1851,7 @@ static bool YGNodeFixedSizeSetMeasuredDimensions( } static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { - memset(&(node->getLayout()), 0, sizeof(YGLayout)); + memset(static_cast(&(node->getLayout())), 0, sizeof(YGLayout)); node->setHasNewLayout(true); node->cloneChildrenIfNeeded(); const uint32_t childCount = YGNodeGetChildCount(node); From 3b2dee86838b27221fa384ed63e7357e82279d21 Mon Sep 17 00:00:00 2001 From: Daniel Hood Date: Thu, 25 Oct 2018 23:29:51 -0700 Subject: [PATCH 2/2] Use YGLayout default constructor instead of memset for YGZeroOutLayoutRecursivly --- yoga/Yoga.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index fecbac0e13..7ce02cd6fe 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1851,7 +1851,9 @@ static bool YGNodeFixedSizeSetMeasuredDimensions( } static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { - memset(static_cast(&(node->getLayout())), 0, sizeof(YGLayout)); + node->getLayout() = {}; + node->setLayoutDimension(0, 0); + node->setLayoutDimension(0, 1); node->setHasNewLayout(true); node->cloneChildrenIfNeeded(); const uint32_t childCount = YGNodeGetChildCount(node);