We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In branch: https://github.com/woodemi/twaindsm.dart/tree/repro/nullsafety-pointer-failure
Dart-beta: Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
class pTW_IDENTITY extends ffi.Struct {} var identityPtr = ffi.allocate<pTW_IDENTITY>(); var connect = twainDsm.DSM_Entry(identityPtr, nullptr, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, parentPtr.cast<Void>());
... var identityPtr = ffi.allocate<Uint8>(count: 156); var connect = twainDsm.DSM_Entry(identityPtr.cast(), ...
This doesn't compile: Opaque cannot...
Opaque
class pTW_IDENTITY extends ffi.Opaque {} var identityPtr = ffi.calloc<pTW_IDENTITY>();
class pTW_IDENTITY extends ffi.Struct {} var identityPtr = ffi.calloc<pTW_IDENTITY>(); ...
Dart SDK version: 2.13.0-97.0.dev (dev) (Tue Mar 2 19:57:46 2021 -0800) on "windows_x64"
class TW_VERSION extends ffi.Struct { @ffi.Uint16() external int MajorNum; @ffi.Uint16() external int MinorNum; @ffi.Uint16() external int Language; @ffi.Uint16() external int Country; @ffi.Array(34) external ffi.Array<ffi.Int8> Info; } class pTW_IDENTITY extends ffi.Struct { @ffi.Uint32() external int Id; external TW_VERSION Version; @ffi.Uint16() external int ProtocolMajor; @ffi.Uint16() external int ProtocolMinor; @ffi.Uint32() external int SupportedGroups; @ffi.Array(34) external ffi.Array<ffi.Int8> Manufacturer; @ffi.Array(34) external ffi.Array<ffi.Int8> ProductFamily; @ffi.Array(34) external ffi.Array<ffi.Int8> ProductName; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In branch: https://github.com/woodemi/twaindsm.dart/tree/repro/nullsafety-pointer-failure
Before null-safety
✅ allocate with empty struct: 0f8504b
Dart-beta:
Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
✅ allocate with Uint8 pointer: ed97d5e
Dart-beta:
Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
After upgrading to null-safety
❌ calloc with opaque: 0ba8788
Dart-beta:
Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
This doesn't compile:
Opaque
cannot...❌ calloc with Uint8 pointer again: 84e0b7b
Dart-beta:
Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
✅ use empty struct instead of opaque: 1f8168c
Dart-beta:
Dart SDK version: 2.12.0-259.16.beta (beta) (Tue Feb 23 00:10:18 2021 +0100) on "windows_x64"
❌ use inline-array & nested-struct: 4a151b8
Dart-dev:
Dart SDK version: 2.13.0-97.0.dev (dev) (Tue Mar 2 19:57:46 2021 -0800) on "windows_x64"
The text was updated successfully, but these errors were encountered: