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

Migrate from UnsafePointer<Void> to UnsafeRawPointer. #3724

Merged
merged 10 commits into from
Jul 26, 2016
Merged

Migrate from UnsafePointer<Void> to UnsafeRawPointer. #3724

merged 10 commits into from
Jul 26, 2016

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jul 24, 2016

No description provided.

@gribozavr
Copy link
Contributor

LGTM.

@atrick
Copy link
Contributor Author

atrick commented Jul 24, 2016

There are a few test case failures that I still need to investigate. Such as:
func takeDSOHandle(_ handle: UnsafeMutableRawPointer = #dsohandle) { }
^~~~~~~~~~
These contextual type purposes cannot fail with a conversion type specified!
UNREACHABLE executed at /s/sptr/swift/lib/Sema/CSDiag.cpp:3525!

atrick added 9 commits July 26, 2016 01:18
As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.
This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.
This is unfortunately necessary for assignment between types imported from C.
// FIXME: Why is this necessary?
@_transparent
public init(_ other: Unsafe${Mutable}RawPointer) {
self._rawValue = other._rawValue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self = other

?

@atrick atrick changed the title [WIP] Migrate from UnsafePointer<Void> to UnsafeRawPointer. Migrate from UnsafePointer<Void> to UnsafeRawPointer. Jul 26, 2016
@atrick
Copy link
Contributor Author

atrick commented Jul 26, 2016

@swift-ci Please smoke test OS X.

@atrick
Copy link
Contributor Author

atrick commented Jul 26, 2016

Depends on corelibs-libdispatch PR:
swiftlang/swift-corelibs-libdispatch#120

Depends on corelibs-foundation PR:
swiftlang/swift-corelibs-foundation#472

@atrick
Copy link
Contributor Author

atrick commented Jul 26, 2016

build-toolchain passes on both darwin and linux.

@atrick atrick merged commit ece0951 into swiftlang:master Jul 26, 2016
atrick added a commit that referenced this pull request Jul 26, 2016
This reverts commit ece0951.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants