Posts

Showing posts with the label include

Hello

Hello, I'm translating some C code to Delphi and found something that surprise me...is it logical that this code compiles ? {code} #include #include void test(); void test2() { test(); } void test(char *msg) { printf("test called '%s' (%d)\n", msg, strlen(msg)); } void main() { test2(); } {code} and the result is test called 'test' (4) tested with gcc under Ubuntu thanks

Following on from my recent post (https://plus.

Following on from my recent post ( https://plus.google.com/103246155735524926641/posts/JMzpSCFyUCD ) about poor performance of dcc64, here is an MCVE: Pascal, LUperf.dpr program LUperf; {$APPTYPE CONSOLE} {$POINTERMATH ON} uses System.Diagnostics, System.Win.Crtl; function LinearIndex(i, j, d: Integer): Integer; begin Result := i * (d + 1) + j; end; procedure PascalLUDecomposeBandedReal(A, Al: PDouble; Index: PInteger; N, Bandwidth: Integer); cdecl; var d: Double; i, j, k, l, iidx, kidx, Alidx: Integer; mm: Integer; tmp1, tmp2: Double; begin mm := 1+2*Bandwidth; l := Bandwidth; for i := 1 to Bandwidth do begin iidx := LinearIndex(i, 0, mm); for j := Bandwidth+2-i to mm do begin A[iidx + j - l] := A[iidx + j]; end; dec(l); for j := mm-l to mm do begin A[iidx + j] := 0.0; end; end; d := 1.0; l := Bandwidth; for k := 1 to N do begin kidx := LinearIndex(k, 0, mm); tmp1 := A[kidx + 1]; i := k; if l inc(l);

Following on from my recent post (https://plus.google.com/103246155735524926641/posts/JMzpSCFyUCD) about poor performance of dcc64, here is an MCVE:

Following on from my recent post ( https://plus.google.com/103246155735524926641/posts/JMzpSCFyUCD ) about poor performance of dcc64, here is an MCVE: Pascal, LUperf.dpr program LUperf; {$APPTYPE CONSOLE} {$POINTERMATH ON} uses System.Diagnostics, System.Win.Crtl; function LinearIndex(i, j, d: Integer): Integer; begin Result := i * (d + 1) + j; end; procedure PascalLUDecomposeBandedReal(A, Al: PDouble; Index: PInteger; N, Bandwidth: Integer); cdecl; var d: Double; i, j, k, l, iidx, kidx, Alidx: Integer; mm: Integer; tmp1, tmp2: Double; begin mm := 1+2*Bandwidth; l := Bandwidth; for i := 1 to Bandwidth do begin iidx := LinearIndex(i, 0, mm); for j := Bandwidth+2-i to mm do begin A[iidx + j - l] := A[iidx + j]; end; dec(l); for j := mm-l to mm do begin A[iidx + j] := 0.0; end; end; d := 1.0; l := Bandwidth; for k := 1 to N do begin kidx := LinearIndex(k, 0, mm); tmp1 := A[kidx + 1]; i := k; if l inc(l);