From 2bdfda33be23482da4b4d8f5a8c7c97afb91f053 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 2 Nov 2023 13:30:38 +1300 Subject: [PATCH] Daco's comments --- test/native_objc_test/static_func_test.m | 47 ++++++++++++------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/test/native_objc_test/static_func_test.m b/test/native_objc_test/static_func_test.m index a297053a..5fc3a14d 100644 --- a/test/native_objc_test/static_func_test.m +++ b/test/native_objc_test/static_func_test.m @@ -1,4 +1,3 @@ - // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. @@ -14,29 +13,6 @@ + (instancetype)newWithCounter:(int32_t*) _counter; - (instancetype)initWithCounter:(int32_t*) _counter; - (void)setCounter:(int32_t*) _counter; - (void)dealloc; -@end -@implementation StaticFuncTestObj - -+ (instancetype)newWithCounter:(int32_t*) _counter { - return [[StaticFuncTestObj alloc] initWithCounter: _counter]; -} - -- (instancetype)initWithCounter:(int32_t*) _counter { - counter = _counter; - ++*counter; - return [super init]; -} - -- (void)setCounter:(int32_t*) _counter { - counter = _counter; - ++*counter; -} - -- (void)dealloc { - if (counter != nil) --*counter; - [super dealloc]; -} - @end StaticFuncTestObj* staticFuncOfObject(StaticFuncTestObj* a) { @@ -62,3 +38,26 @@ IntBlock staticFuncOfBlock(IntBlock a) { StaticFuncTestObj* a) { return [a retain]; } + + +@implementation StaticFuncTestObj ++ (instancetype)newWithCounter:(int32_t*) _counter { + return [[StaticFuncTestObj alloc] initWithCounter: _counter]; +} + +- (instancetype)initWithCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; + return [super init]; +} + +- (void)setCounter:(int32_t*) _counter { + counter = _counter; + ++*counter; +} + +- (void)dealloc { + if (counter != nil) --*counter; + [super dealloc]; +} +@end