More fixes for the new clang-tidy roll on iOS targets (flutter/engine#43688)

See https://github.com/flutter/engine/pull/43661
This commit is contained in:
Jason Simmons
2023-07-14 10:44:52 -07:00
committed by GitHub
parent 27192d3743
commit 9196510ed8
4 changed files with 9 additions and 5 deletions

View File

@@ -153,7 +153,7 @@ static NSString* const kRestorationStateAppModificationKey = @"mod-date";
[flutterViewController.engine.navigationChannel
invokeMethod:@"pushRouteInformation"
arguments:@{
@"location" : url.absoluteString,
@"location" : url.absoluteString ?: [NSNull null],
}];
}
}];

View File

@@ -683,7 +683,7 @@ static constexpr int kNumProfilerSamplesPerSec = 5;
NSString* format = [NSString stringWithUTF8String:screenshot.format.c_str()];
NSNumber* width = @(screenshot.frame_size.fWidth);
NSNumber* height = @(screenshot.frame_size.fHeight);
return result(@[ width, height, format, data ]);
return result(@[ width, height, format ?: [NSNull null], data ]);
}];
}

View File

@@ -161,7 +161,8 @@ void AccessibilityBridge::UpdateSemantics(
if (root) {
if (!view_controller_.view.accessibilityElements) {
view_controller_.view.accessibilityElements = @[ [root accessibilityContainer] ];
view_controller_.view.accessibilityElements =
@[ [root accessibilityContainer] ?: [NSNull null] ];
}
NSMutableArray<SemanticsObject*>* newRoutes = [[[NSMutableArray alloc] init] autorelease];
[root collectRoutes:newRoutes];

View File

@@ -223,9 +223,12 @@ std::unique_ptr<std::vector<std::string>> PlatformViewIOS::ComputePlatformResolv
[NSMutableArray arrayWithCapacity:supported_locale_data.size() / localeDataLength];
for (size_t i = 0; i < supported_locale_data.size(); i += localeDataLength) {
NSDictionary<NSString*, NSString*>* dict = @{
NSLocaleLanguageCode : [NSString stringWithUTF8String:supported_locale_data[i].c_str()],
NSLocaleCountryCode : [NSString stringWithUTF8String:supported_locale_data[i + 1].c_str()],
NSLocaleLanguageCode : [NSString stringWithUTF8String:supported_locale_data[i].c_str()]
?: @"",
NSLocaleCountryCode : [NSString stringWithUTF8String:supported_locale_data[i + 1].c_str()]
?: @"",
NSLocaleScriptCode : [NSString stringWithUTF8String:supported_locale_data[i + 2].c_str()]
?: @""
};
[supported_locale_identifiers addObject:[NSLocale localeIdentifierFromComponents:dict]];
}