Skip to content

Instantly share code, notes, and snippets.

View nielsAD's full-sized avatar

Niels AD nielsAD

View GitHub Profile
procedure TPASortXY(var A: TPointArray; iLo, iHi: Integer);
var
Lo, Hi, PivotX, PivotY: Integer;
begin
Lo := iLo;
Hi := iHi;
PivotX := A[(Lo + Hi) div 2].x;
PivotY := A[(Lo + Hi) div 2].y;
repeat
while (A[Lo].y < PivotY) or ((A[Lo].y = PivotY) and (A[Lo].x < PivotX)) do Inc(Lo);
@nielsAD
nielsAD / ffitest.pas
Created April 30, 2012 17:43
Lape ffi tests.
function testInc(a, b: Integer; c: Double): Integer; cdecl;
begin
WriteLn('In testInc ', a, ',', b, ',', c);
Result := a + Round(b*c);
end;
const
header = 'function tst(a, b: Int32; c: Double): Int32;';
procedure testCall;