Skip to content
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

Use consistent data type #100

Merged
merged 2 commits into from
Oct 8, 2018

Conversation

martin308
Copy link
Contributor

On iOS we need to run on both 32bit and 64 bit architectures, NSUInteger
differs depending on the architecture the device is running which causes issues when
interoping with the c# code.

On iOS we need to run on both 32bit and 64 bit architectures, NSUInteger
differs depending on the architecture which causes issues when
interoping with the c# code.
@martin308 martin308 requested a review from a team October 5, 2018 23:43
NSArray *releaseStages = ((__bridge BugsnagConfiguration *)configuration).notifyReleaseStages;
NSUInteger count = [releaseStages count];
int count = [NSNumber numberWithUnsignedInteger: [releaseStages count]].intValue;
Copy link
Contributor

Choose a reason for hiding this comment

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

I may be missing a step here, but is there a reason we can't convert using:

int count = (int)[releaseStages count];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the recommendation from @kattrali. @kattrali are you able to give a quick comment here on why this is a better approach?

Copy link
Contributor

Choose a reason for hiding this comment

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

In our quick chat, I wasn't quite sure what "layer" the number was coming from - but knew that would cover your bases. A cast should be fine as presumably there aren't that many release stages?

@@ -83,7 +83,7 @@ public Breadcrumb[] Retrieve()
}

[MonoPInvokeCallback(typeof(NativeCode.BreadcrumbInformation))]
static void PopulateBreadcrumb(IntPtr instance, string name, string timestamp, string type, string[] keys, long keysSize, string[] values, long valuesSize)
static void PopulateBreadcrumb(IntPtr instance, string name, string timestamp, string type, string[] keys, int keysSize, string[] values, int valuesSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is switching from long to int going to be causing issues or impacts elsewhere? Do we know why it was initially a long?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should not, there will probably be bigger issues if we have more keys in our breadcrumb metadata than int max. It was initially long as I only had 64 bit devices available to test on and NSUInteger changes depending on the architecture of the device

@kattrali kattrali merged commit 19bc474 into martin308/unification Oct 8, 2018
@kattrali kattrali deleted the martin308/inconsistent-parameters branch October 8, 2018 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants