Skip to content

Cast error.code to long to avoid using NSInteger as %ld format warnings. #1291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2019
Merged

Conversation

mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Oct 21, 2019

No description provided.

@mehmetf
Copy link
Contributor Author

mehmetf commented Oct 22, 2019

@collinjackson could you LGTM this when you get the chance? We are being blocked from rolling this plugin.

@mehmetf mehmetf requested a review from mklim October 22, 2019 20:54
@mklim mklim requested review from cyanglaz and removed request for mklim October 22, 2019 20:59
@@ -10,7 +10,7 @@
static FlutterError *getFlutterError(NSError *error) {
if (error == nil) return nil;

return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", error.code]
return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", (long)error.code]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Another way instead of force casting would be always use NSObjects
such as

Suggested change
return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", (long)error.code]
return [FlutterError errorWithCode:[NSString stringWithFormat:@"Error %@", @(error.code)]

But I'm ok with whichever you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Good to know!

@mehmetf mehmetf merged commit e105147 into firebase:master Oct 22, 2019
@mehmetf mehmetf deleted the 01 branch October 22, 2019 21:04
kroikie pushed a commit to collinjackson/flutterfire that referenced this pull request Nov 15, 2019
@firebase firebase locked and limited conversation to collaborators Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants