Re: Passing myself, a struct, as a C callback context

2015-03-30 Thread Paul O'Neil via Digitalmars-d-learn
On 03/30/2015 11:32 AM, Steven Schveighoffer wrote: > On 3/30/15 5:12 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= " > wrote: >> >> `this` is already a reference. You're taking the address of that >> reference. A simple cast should work: `cast(void*) this`. > > To build on this further, &this for a class i

Re: Passing myself, a struct, as a C callback context

2015-03-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/30/15 5:12 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= " wrote: On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote: I'm registering a callback with some C code. The simplified story is here, but the actual code is on GitHub [1] at the end if you care. The call looks something like this.

Re: Passing myself, a struct, as a C callback context

2015-03-30 Thread via Digitalmars-d-learn
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote: I'm registering a callback with some C code. The simplified story is here, but the actual code is on GitHub [1] at the end if you care. The call looks something like this. void register(void(*fp)(void*), void* context); I have a c

Re: Passing myself, a struct, as a C callback context

2015-03-29 Thread ketmar via Digitalmars-d-learn
On Sun, 29 Mar 2015 22:53:35 -0400, Paul O'Neil wrote: > I'm registering a callback with some C code. The simplified story is > here, but the actual code is on GitHub [1] at the end if you care. > > The call looks something like this. > > void register(void(*fp)(void*), void* context); > > I h

Re: Passing myself, a struct, as a C callback context

2015-03-29 Thread lobo via Digitalmars-d-learn
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote: I'm registering a callback with some C code. The simplified story is here, but the actual code is on GitHub [1] at the end if you care. The call looks something like this. void register(void(*fp)(void*), void* context); I have a c

Re: Passing myself, a struct, as a C callback context

2015-03-29 Thread weaselcat via Digitalmars-d-learn
On Monday, 30 March 2015 at 03:02:07 UTC, Paul O'Neil wrote: On 03/29/2015 10:57 PM, weaselcat wrote: On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote: As of dmd 2.067, doing "&this" is deprecated. where is this documented? I don't see it in the release notes. I don't see it in

Re: Passing myself, a struct, as a C callback context

2015-03-29 Thread Paul O'Neil via Digitalmars-d-learn
On 03/29/2015 10:57 PM, weaselcat wrote: > On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote: > >> As of dmd 2.067, doing "&this" is deprecated. > > where is this documented? I don't see it in the release notes. I don't see it in the release notes either, but it's happening. Maybe it'

Re: Passing myself, a struct, as a C callback context

2015-03-29 Thread weaselcat via Digitalmars-d-learn
On Monday, 30 March 2015 at 02:53:36 UTC, Paul O'Neil wrote: As of dmd 2.067, doing "&this" is deprecated. where is this documented? I don't see it in the release notes.

Passing myself, a struct, as a C callback context

2015-03-29 Thread Paul O'Neil via Digitalmars-d-learn
I'm registering a callback with some C code. The simplified story is here, but the actual code is on GitHub [1] at the end if you care. The call looks something like this. void register(void(*fp)(void*), void* context); I have a class that holds state for the callback and registers itself: fin