From d9be2dac9640ff4d9c1a9432a3d9a1265a3c2153 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 19 May 2021 17:37:03 -0700 Subject: [PATCH 1/2] [video_player] Fix pointer value to boolean conversion analyzer warnings --- .../video_player/video_player/CHANGELOG.md | 4 ++++ .../video_player/ios/Classes/messages.m | 20 +++++++++---------- .../video_player/video_player/pubspec.yaml | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index 918a3615feb0..c40faab2e1c6 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.3 + +* Fix pointer value to boolean conversion analyzer warnings. + ## 2.1.2 * Migrate maven repository from jcenter to mavenCentral. diff --git a/packages/video_player/video_player/ios/Classes/messages.m b/packages/video_player/video_player/ios/Classes/messages.m index 14e375b33378..fc7c41b1dc46 100644 --- a/packages/video_player/video_player/ios/Classes/messages.m +++ b/packages/video_player/video_player/ios/Classes/messages.m @@ -66,7 +66,7 @@ + (FLTTextureMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return - [NSDictionary dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), + [NSDictionary dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", nil]; } @end @@ -124,8 +124,8 @@ + (FLTLoopingMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId", - (self.isLooping ? self.isLooping : [NSNull null]), @"isLooping", + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", + (self.isLooping != nil ? self.isLooping : [NSNull null]), @"isLooping", nil]; } @end @@ -145,8 +145,8 @@ + (FLTVolumeMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId", - (self.volume ? self.volume : [NSNull null]), @"volume", nil]; + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", + (self.volume != nil ? self.volume : [NSNull null]), @"volume", nil]; } @end @@ -165,8 +165,8 @@ + (FLTPlaybackSpeedMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId", - (self.speed ? self.speed : [NSNull null]), @"speed", nil]; + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", + (self.speed != nil ? self.speed : [NSNull null]), @"speed", nil]; } @end @@ -185,8 +185,8 @@ + (FLTPositionMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId", - (self.position ? self.position : [NSNull null]), @"position", + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", + (self.position != nil ? self.position : [NSNull null]), @"position", nil]; } @end @@ -202,7 +202,7 @@ + (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.mixWithOthers ? self.mixWithOthers : [NSNull null]), + dictionaryWithObjectsAndKeys:(self.mixWithOthers != nil ? self.mixWithOthers : [NSNull null]), @"mixWithOthers", nil]; } @end diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 6261a1dea6e1..c716e54927fa 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -1,7 +1,7 @@ name: video_player description: Flutter plugin for displaying inline video with other Flutter widgets on Android, iOS, and web. -version: 2.1.2 +version: 2.1.3 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player flutter: From effff0d2b91fd9bc1b2e237257f0fa9c6b032e7a Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 19 May 2021 18:12:55 -0700 Subject: [PATCH 2/2] Format --- .../video_player/ios/Classes/messages.m | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/video_player/video_player/ios/Classes/messages.m b/packages/video_player/video_player/ios/Classes/messages.m index fc7c41b1dc46..0936bbc7d995 100644 --- a/packages/video_player/video_player/ios/Classes/messages.m +++ b/packages/video_player/video_player/ios/Classes/messages.m @@ -65,9 +65,9 @@ + (FLTTextureMessage *)fromMap:(NSDictionary *)dict { return result; } - (NSDictionary *)toMap { - return - [NSDictionary dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), - @"textureId", nil]; + return [NSDictionary + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), + @"textureId", nil]; } @end @@ -124,9 +124,10 @@ + (FLTLoopingMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", - (self.isLooping != nil ? self.isLooping : [NSNull null]), @"isLooping", - nil]; + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), + @"textureId", + (self.isLooping != nil ? self.isLooping : [NSNull null]), + @"isLooping", nil]; } @end @@ -145,8 +146,9 @@ + (FLTVolumeMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", - (self.volume != nil ? self.volume : [NSNull null]), @"volume", nil]; + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), + @"textureId", (self.volume != nil ? self.volume : [NSNull null]), + @"volume", nil]; } @end @@ -165,8 +167,9 @@ + (FLTPlaybackSpeedMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", - (self.speed != nil ? self.speed : [NSNull null]), @"speed", nil]; + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), + @"textureId", (self.speed != nil ? self.speed : [NSNull null]), + @"speed", nil]; } @end @@ -185,9 +188,10 @@ + (FLTPositionMessage *)fromMap:(NSDictionary *)dict { } - (NSDictionary *)toMap { return [NSDictionary - dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), @"textureId", - (self.position != nil ? self.position : [NSNull null]), @"position", - nil]; + dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]), + @"textureId", + (self.position != nil ? self.position : [NSNull null]), + @"position", nil]; } @end