From 41eb1917e4f64bc92a16717d9e04c55fbab2d0c5 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Tue, 5 Apr 2016 14:21:36 -0700 Subject: [PATCH] Fix setting ASEnvironmentStateExtensions values --- AsyncDisplayKit/Details/ASEnvironment.h | 2 +- .../Private/ASEnvironmentInternal.mm | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/AsyncDisplayKit/Details/ASEnvironment.h b/AsyncDisplayKit/Details/ASEnvironment.h index 20837d4a..6a42f18c 100644 --- a/AsyncDisplayKit/Details/ASEnvironment.h +++ b/AsyncDisplayKit/Details/ASEnvironment.h @@ -46,7 +46,7 @@ typedef struct ASEnvironmentLayoutOptionsState { ASRelativeSizeRange sizeRange;// = ASRelativeSizeRangeMake(ASRelativeSizeMakeWithCGSize(CGSizeZero), ASRelativeSizeMakeWithCGSize(CGSizeZero));; CGPoint layoutPosition;// = CGPointZero; - ASEnvironmentStateExtensions _extensions; + struct ASEnvironmentStateExtensions _extensions; } ASEnvironmentLayoutOptionsState; diff --git a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm index 7685203e..b49fbd0e 100644 --- a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm +++ b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm @@ -52,9 +52,9 @@ void _ASEnvironmentLayoutOptionsExtensionSetBoolAtIndex(id object { NSCAssert(idx < kMaxEnvironmentStateBoolExtensions, @"Setting index outside of max bool extensions space"); - ASEnvironmentStateExtensions extension = object.environmentState.layoutOptionsState._extensions; - extension.boolExtensions[idx] = value; - object.environmentState.layoutOptionsState._extensions = extension; + ASEnvironmentState state = object.environmentState; + state.layoutOptionsState._extensions.boolExtensions[idx] = value; + object.environmentState = state; } BOOL _ASEnvironmentLayoutOptionsExtensionGetBoolAtIndex(id object, int idx) @@ -67,9 +67,9 @@ void _ASEnvironmentLayoutOptionsExtensionSetIntegerAtIndex(id obj { NSCAssert(idx < kMaxEnvironmentStateIntegerExtensions, @"Setting index outside of max integer extensions space"); - ASEnvironmentStateExtensions extension = object.environmentState.layoutOptionsState._extensions; - extension.integerExtensions[idx] = value; - object.environmentState.layoutOptionsState._extensions = extension; + ASEnvironmentState state = object.environmentState; + state.layoutOptionsState._extensions.integerExtensions[idx] = value; + object.environmentState = state; } NSInteger _ASEnvironmentLayoutOptionsExtensionGetIntegerAtIndex(id object, int idx) @@ -82,9 +82,9 @@ void _ASEnvironmentLayoutOptionsExtensionSetEdgeInsetsAtIndex(id { NSCAssert(idx < kMaxEnvironmentStateEdgeInsetExtensions, @"Setting index outside of max edge insets extensions space"); - ASEnvironmentStateExtensions extension = object.environmentState.layoutOptionsState._extensions; - extension.edgeInsetsExtensions[idx] = value; - object.environmentState.layoutOptionsState._extensions = extension; + ASEnvironmentState state = object.environmentState; + state.layoutOptionsState._extensions.edgeInsetsExtensions[idx] = value; + object.environmentState = state; } UIEdgeInsets _ASEnvironmentLayoutOptionsExtensionGetEdgeInsetsAtIndex(id object, int idx)