Skip to content

Commit 63d8e36

Browse files
authored
Merge pull request #149 from paweld/gus
`LF` support and fixed rounding in the `Lurendrejer Aksen` version
2 parents d721900 + 015ec40 commit 63d8e36

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

entries/laksen/src/laksen.lpr

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
{$mode objfpc}{$h+}
44

5+
{$define LFONLY}
6+
57
uses
68
cthreads,
79
SysUtils,
@@ -212,15 +214,17 @@ TParser = class
212214
ptr := @pbyte(@ABuffer)[offset];
213215
lineEnd := IndexChar(ptr^, remainder, #$A);
214216

217+
{$IFNDEF LFONLY}
215218
// Mark EOL
216219
ptr[lineEnd-1] := 0;
220+
{$ENDIF}
217221

218222
// Find delimiter and add null terminator
219-
delim := IndexChar(ptr^, lineEnd-2, ';');
223+
delim := IndexChar(ptr^, lineEnd-{$IFNDEF LFONLY}2{$ELSE}1{$ENDIF}, ';');
220224
ptr[delim] := 0;
221225

222226
tempStart := PChar(@ptr[delim+1]);
223-
tempLen := lineEnd-2-delim;
227+
tempLen := lineEnd-{$IFNDEF LFONLY}2{$ELSE}1{$ENDIF}-delim;
224228
tempNeg := False;
225229

226230
if tempStart^ = '-' then
@@ -294,7 +298,7 @@ TParser = class
294298

295299
function AsNum(AValue, ACount: longint): string;
296300
begin
297-
Result := formatfloat('0.0', RoundExDouble(AValue/ACount)/10);
301+
Result := formatfloat('0.0', RoundExDouble(AValue/(ACount * 10)));
298302
end;
299303

300304
procedure TParser.Dump;
@@ -482,4 +486,4 @@ TParser = class
482486
p.Parse(threads);
483487
p.Dump();
484488
p.Free;
485-
end.
489+
end.

entries/sbalazs/src/obrc.lpr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929

3030
if (Trim(ParamStr(2)) <> '') then
3131
begin
32-
TC := StrToIntDef(ParamStr(2), 16);
33-
if TC < 16 then
34-
TC := 16;
32+
TC := StrToIntDef(ParamStr(2), 8);
33+
if TC < 8 then
34+
TC := 8;
3535
end
3636
else
37-
TC := 16;
37+
TC := 8;
3838

3939
FWSManager := TWSManager.Create(ParamStr(1), TC);
4040
FWSManager.WSThreadsWatcher.Start;

0 commit comments

Comments
 (0)