From 08eb9ff8f7ed2e90e1667a08d72a95416f76efc8 Mon Sep 17 00:00:00 2001 From: Lukas Woehrl Date: Mon, 19 Dec 2016 23:47:56 +0100 Subject: [PATCH] fix access violation on vprintf --- csharp/tests/Facebook.Yoga/YogaNodeTest.cs | 2 +- yoga/Yoga.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/csharp/tests/Facebook.Yoga/YogaNodeTest.cs b/csharp/tests/Facebook.Yoga/YogaNodeTest.cs index baacb1dc..acf33f4b 100644 --- a/csharp/tests/Facebook.Yoga/YogaNodeTest.cs +++ b/csharp/tests/Facebook.Yoga/YogaNodeTest.cs @@ -212,7 +212,7 @@ namespace Facebook.Yoga parent.Insert(0, child0); parent.Insert(0, child1); parent.CalculateLayout(); - Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100, height: 120, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35, height: 45, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30, height: 40, },\n]},\n"); + Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100px, height: 120px, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35px, height: 45px, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30px, height: 40px, },\n]},\n"); } [Test] diff --git a/yoga/Yoga.c b/yoga/Yoga.c index f38cb035..b2bfb79c 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -592,7 +592,7 @@ static void YGIndent(const uint32_t n) { static void YGPrintNumberIfNotZero(const char *str, const YGValue number) { if (!YGFloatsEqual(number.value, 0)) { - YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number, number.unit == YGUnitPixel ? "px" : "%"); + YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number.value, number.unit == YGUnitPixel ? "px" : "%"); } } @@ -604,7 +604,7 @@ static void YGPrintNumberIfNotUndefinedf(const char *str, const float number) { static void YGPrintNumberIfNotUndefined(const char *str, const YGValue number) { if (number.isDefined) { - YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number, number.unit == YGUnitPixel ? "px" : "%"); + YGLog(YGLogLevelDebug, "%s: %g%s, ", str, number.value, number.unit == YGUnitPixel ? "px" : "%"); } }