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

Dart API merge IntegerFitsInto... and IntegerTo... #2748

Closed
whesse opened this issue Apr 26, 2012 · 2 comments
Closed

Dart API merge IntegerFitsInto... and IntegerTo... #2748

whesse opened this issue Apr 26, 2012 · 2 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug

Comments

@whesse
Copy link
Contributor

whesse commented Apr 26, 2012

When using the API to get an integer from a Dart integer object, we need to call two api functions, and check two error conditions and a boolean return, to get the integer value.

It seems quite unlikely to me that one would want to check whether a Dart integer fits into int64_t, but not also get that value if the answer is yes.
So I think that a combined
Dart_IntegerToInt64(Dart_Handle integer, int64_t* value, bool* fits)
returning both the value, if it fits, and a boolean saying if the value fits
would be easier to use.

@iposva-google
Copy link
Contributor

Set owner to @turnidge.
Added Accepted label.

@iposva-google
Copy link
Contributor

Fixed. Just call the function below and verify that you did not get an error:

Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, int64_t* value);


Added Fixed label.

@whesse whesse added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. labels May 29, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
dart-bot pushed a commit that referenced this issue Nov 12, 2020
New in this revision:

> git log --format="%C(auto) %h %s" b10966c6a8ad7d95c2023b7842fa2697001d2fdf..c00d4b4abf5b4ff265a7ce6282b748551f1b5b1f
 c00d4b4a Improve message in `pub outdated` when incompatible versions are found (#2746)
 2a177623 outdated --mode=null-safety, resolvable constrained to null-safe vers… (#2739)
 3ea2b832 Default language version (#2748)
 78865460 Don't allow both --json and --transitive (#2742)

Fixes #44013

Change-Id: I0dc876c5e57777a4724d90662408f91910e2517c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171720
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
dart-bot pushed a commit that referenced this issue Nov 13, 2020
New in this revision:

> git log --format="%C(auto) %h %s" b10966c6a8ad7d95c2023b7842fa2697001d2fdf..c00d4b4abf5b4ff265a7ce6282b748551f1b5b1f
 c00d4b4a Improve message in `pub outdated` when incompatible versions are found (#2746)
 2a177623 outdated --mode=null-safety, resolvable constrained to null-safe vers… (#2739)
 3ea2b832 Default language version (#2748)
 78865460 Don't allow both --json and --transitive (#2742)

Fixes #44013

Change-Id: I0dc876c5e57777a4724d90662408f91910e2517c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171720
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants