Re: [fpc-pascal] Porting C macro

2013-03-12 Thread Flávio Etrusco
On Tue, Mar 12, 2013 at 5:30 AM, Darius Blaszyk wrote: > function GETNEXT(x: pLList): pLList; inline; > begin > exit(pLList(pchar(x) - pchar(pLList(nil)^.next))); > end; > > And let LList be declared as: > > LList = record > len: integer; > next, prev: pLList; > name: PChar; > nextname: PCha

Re: [fpc-pascal] Porting C macro

2013-03-12 Thread Darius Blaszyk
Flávio Etrusco schreef op 12 mrt '13: > On 3/11/13, Darius Blaszyk wrote: > >> I'm stuck porting a macro from C. Below is the original define. The part I'm struggeling with is the right most part after the - sign. #define GETNEXT(x) ((LList *)(((char *) x) - ((char *) & (((LList *)0)^.next))

Re: [fpc-pascal] Porting C macro

2013-03-11 Thread Darius Blaszyk
Henry Vermaak schreef op 12 mrt '13: > On Mon, Mar 11, 2013 at 11:26:57PM +0100, Darius Blaszyk wrote: > >> I'm stuck porting a macro from C. Below is the original define. The part I'm struggeling with is the right most part after the - sign. #define GETNEXT(x) ((LList *)(((char *) x) - ((cha

Re: [fpc-pascal] Porting C macro

2013-03-11 Thread Darius Blaszyk
Henry Vermaak schreef op 12 mrt '13: > On Mon, Mar 11, 2013 at 11:26:57PM +0100, Darius Blaszyk wrote: > >> I'm stuck porting a macro from C. Below is the original define. The part I'm struggeling with is the right most part after the - sign. #define GETNEXT(x) ((LList *)(((char *) x) - ((cha

Re: [fpc-pascal] Porting C macro

2013-03-11 Thread Henry Vermaak
On Mon, Mar 11, 2013 at 11:26:57PM +0100, Darius Blaszyk wrote: > > > I'm stuck porting a macro from C. Below is the original define. The > part I'm struggeling with is the right most part after the - sign. > > > #define GETNEXT(x) ((LList *)(((char *) x) - ((char *) & (((LList > *)0)^.next)))

Re: [fpc-pascal] Porting C macro

2013-03-11 Thread Flávio Etrusco
On 3/11/13, Darius Blaszyk wrote: > > > I'm stuck porting a macro from C. Below is the original define. The > part I'm struggeling with is the right most part after the - sign. > > > #define GETNEXT(x) ((LList *)(((char *) x) - ((char *) & (((LList > *)0)^.next > > Does anyone know what is mea

[fpc-pascal] Porting C macro

2013-03-11 Thread Darius Blaszyk
I'm stuck porting a macro from C. Below is the original define. The part I'm struggeling with is the right most part after the - sign. #define GETNEXT(x) ((LList *)(((char *) x) - ((char *) & (((LList *)0)^.next Does anyone know what is meant with the define? Obviously LList is a linked l