Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong pointer type of
static _dispatch_main_q
binding
While looking at a copy of this code (in another project that uses `objc2`, which does not yet define `dispatch` integration) this strange cast immediately stands out. `_dispatch_main_q` is defined here as a `dispatch_queue_t`, the `queue` argument in `dispatch_data_create()` is also defined as a `dispatch_queue_t`, yet there is a "borrow" (get *pointer to*) operation before passing it into the function. Instead, this `static` field is supposed to be defined as the `Object` itself, so that any user could take a _pointer to it_ if they wish or need it so. The same is seen in [the `dispatch` crate]: `_dispatch_main_q` is defined as a `dispatch_object_s`, and `dispatch_queue_t` is a _typedef_ to a `*mut dispatch_object_s` to match the above convention. Note that this is not a bugfix, but merely a readability improvement. Use of `mut` here is debatable. [the `dispatch` crate]: https://github.com/SSheldon/rust-dispatch/blob/f540a2d8ccaebf0e87f5805033b9e287e8d01ba5/src/ffi.rs#L33
- Loading branch information