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

Implicit conversion loses integer precision warnings #24

Closed
BenjaminConant opened this issue Jun 13, 2016 · 2 comments
Closed

Implicit conversion loses integer precision warnings #24

BenjaminConant opened this issue Jun 13, 2016 · 2 comments
Labels

Comments

@BenjaminConant
Copy link

Getting two warnings from NativeStorage.m on build... build succeeds but would like to know whats going on ..
screen shot 2016-06-13 at 3 05 16 pm
screen shot 2016-06-13 at 3 05 29 pm

@BenjaminConant BenjaminConant changed the title Implicit conversion looses integer precision warnings Implicit conversion loses integer precision warnings Jun 13, 2016
@alokrajiv
Copy link
Collaborator

@BenjaminConant Hi, I'm assuming the issue shot because of 64-bit unsigned long being 64bit but the int is 32-bit. so there is precision loss, I'm assuming for very large number with representations above said limits. But, I'll let @GillesC comment as well because I'm not very familiar with the objective-c implementation at that particular point.

@GillesC
Copy link
Collaborator

GillesC commented Jun 15, 2016

@BenjaminConant alokrajiv is correct. In Android the number is also stored as an integer and not as a long (which is a NSInteger in iOS). Because of this reason I've opted to store it as an int. So the same functionality is provided by Android and iOS. But now I've changed the code so an NSInteger is stored, which resolves your 'problem', i.e. the generated warning.

This change is only made in the experimental repo through Github. To install this version please uninstall the current plugin:
cordova plugin remove cordova-plugin-nativestorage
And add the plugin via Github:
cordova plugin add https://github.com/TheCocoaProject/cordova-plugin-nativestorage

FYI the warning is generated in a method (putInt) which is only invoked when using the API prior to version 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants