-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add mappings for CoreFoundation, IOKit, DiskArbitration #1131
Add mappings for CoreFoundation, IOKit, DiskArbitration #1131
Conversation
53c2d80
to
11dcc4c
Compare
11dcc4c
to
e8e3e59
Compare
Part 2 of 3 mappings: IOKit. Kept as a separate commit to ease review, but may be merged. |
b75135c
to
461c891
Compare
Part 3 of 3 mappings: DiskArbitration. Ready for review/merge. |
a36bf47
to
e445464
Compare
e445464
to
6940d75
Compare
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 took a quick look, but I'm totally unfamiliar with Mac OS X and I don't yet foresee a future where that will change. I just did some googling and throw in some pain points from the past.
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundationUtil.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundationUtil.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundationUtil.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundationUtil.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundationUtil.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
I've addressed most of the comments. Questions still outstanding:
|
be82280
to
cd00036
Compare
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundationUtil.java
Outdated
Show resolved
Hide resolved
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 left some more comments inline. Sorry for the trickle of comments.
No problem at all, this is an amazingly useful and educational conversation. Stuck on a Windows machine during the day so expect another commit while you sleep.
|
be63808
to
7c3db24
Compare
OK, I think I've addressed all the comments. Bring on the next phase of the review! (There's a reason I wrote this in 2016 and have delayed submitting it....) |
0806012
to
52ec379
Compare
One note. I re-read the comments and I ended up putting
If I put the ports in the "proper" order ( |
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.
Sorry I still have some comments left inline. I hope you find them helpful.
contrib/platform/src/com/sun/jna/platform/mac/SystemBFunctionMapper.java
Outdated
Show resolved
Hide resolved
114fca1
to
06c3257
Compare
OK. I think this is finally ready. :) |
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.
Looks mostly complete to me. I added some minor comments inline.
contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/mac/CoreFoundationTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/mac/DiskArbitrationTest.java
Outdated
Show resolved
Hide resolved
contrib/platform/test/com/sun/jna/platform/mac/DiskArbitrationTest.java
Outdated
Show resolved
Hide resolved
1771a36
to
1ab47ac
Compare
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.
A few final thoughts on convenient return types. I tried to image what I would like from convenience methods. Feel free to disagree with me I just wanted to get the suggestions into the open.
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
Good suggestions on the return types for convenience methods. There's only one other outstanding question I've got. I tried to put in some typecasting protection using the TypeID, and used the pointer-constructor as the most likely point of failure, as this idiom is common:
I actually found a
I'm trying to think of the best way to handle this or whether to allow this bypass. Not sure I want to override |
59c90b7
to
3528421
Compare
Thank you for the updates - looks sane to me. For the |
I did something with WMI type checking in the Util when getting the values, but in that case a plain Object was stored so that was the moment of the actual typecasting. I think I’m ok with it as is. |
Thank you very much for your work and taking the time to work through this. |
Part one of three framework mappings. Will submit DiskArbitration and IOKit mappings later, but as they depend on this one, I want to submit them separately and get any needed reviews on this PR completed.