-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use consistent data type #100
Conversation
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.
src/BugsnagUnity.mm
Outdated
NSArray *releaseStages = ((__bridge BugsnagConfiguration *)configuration).notifyReleaseStages; | ||
NSUInteger count = [releaseStages count]; | ||
int count = [NSNumber numberWithUnsignedInteger: [releaseStages count]].intValue; |
There was a problem hiding this comment.
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];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
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.