I see a lot of discussions around cdecl, but no "reference manual" to it. Is there such?
I was thinking of translating it to PascalIf you are just after simple interpolation without vectors, then take a look at this: https://bitbucket.org/avra/interpolate1234d
@Zvoni: I really appreciate the effort, but please don't haul my water. I'm too lazy as it is!
(Also now I really have to test the crap out of it! ::) ).
I'll also be looking at that pointer notation in C that I don't fully get ( such as result.v[0] = (q1->v[0] * 0.5 + q2->v[0] * 0.5); ).
That is simply a pointer dereferentiation. In C you use either *p if you want the value p points to or p->f if you want to access field f of the struct p points to. In Pascal you simply use p^ for both cases.
That is simply a pointer dereferentiation. In C you use either *p if you want the value p points to or p->f if you want to access field f of the struct p points to. In Pascal you simply use p^ for both cases.
Pascal still requires the point for field access though, so -> is equal to ^. or just . in pointermath mode.
I'll also be looking at that pointer notation in C that I don't fully get ( such as result.v[0] = (q1->v[0] * 0.5 + q2->v[0] * 0.5); ).btw: i changed that calculation in my "translated" code to
res.v[0]:=0.5*(q1^.v[0]+q2^.v[0])
C-Version = 3 Instructions (Multiplication, Multiplication, Addition)That is simply a pointer dereferentiation. In C you use either *p if you want the value p points to or p->f if you want to access field f of the struct p points to. In Pascal you simply use p^ for both cases.
Pascal still requires the point for field access though, so -> is equal to ^. or just . in pointermath mode.
btw: i changed that calculation in my "translated" code toCode: [Select]res.v[0]:=0.5*(q1^.v[0]+q2^.v[0])
C-Version = 3 Instructions (Multiplication, Multiplication, Addition)
My Version = 2 Instructions (Addition, Multiplication)