From 9fb3dd0cab25b6108947b73442c4e9eb40c2d449 Mon Sep 17 00:00:00 2001 From: paweld Date: Fri, 3 May 2024 12:41:19 +0200 Subject: [PATCH 1/2] `LF` support and fixed rounding in the `Lurendrejer Aksen` version --- entries/laksen/src/laksen.lpr | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/entries/laksen/src/laksen.lpr b/entries/laksen/src/laksen.lpr index 0e1bee5..c049109 100644 --- a/entries/laksen/src/laksen.lpr +++ b/entries/laksen/src/laksen.lpr @@ -2,6 +2,8 @@ {$mode objfpc}{$h+} +{$define LFONLY} + uses cthreads, SysUtils, @@ -212,15 +214,17 @@ TParser = class ptr := @pbyte(@ABuffer)[offset]; lineEnd := IndexChar(ptr^, remainder, #$A); + {$IFNDEF LFONLY} // Mark EOL ptr[lineEnd-1] := 0; + {$ENDIF} // Find delimiter and add null terminator - delim := IndexChar(ptr^, lineEnd-2, ';'); + delim := IndexChar(ptr^, lineEnd-{$IFNDEF LFONLY}2{$ELSE}1{$ENDIF}, ';'); ptr[delim] := 0; tempStart := PChar(@ptr[delim+1]); - tempLen := lineEnd-2-delim; + tempLen := lineEnd-{$IFNDEF LFONLY}2{$ELSE}1{$ENDIF}-delim; tempNeg := False; if tempStart^ = '-' then @@ -294,7 +298,7 @@ TParser = class function AsNum(AValue, ACount: longint): string; begin - Result := formatfloat('0.0', RoundExDouble(AValue/ACount)/10); + Result := formatfloat('0.0', RoundExDouble(AValue/(ACount * 10))); end; procedure TParser.Dump; @@ -482,4 +486,4 @@ TParser = class p.Parse(threads); p.Dump(); p.Free; -end. +end. \ No newline at end of file From 015ec40b7eda9bf13521b8673d91541f8afb4f8d Mon Sep 17 00:00:00 2001 From: paweld Date: Fri, 3 May 2024 12:49:58 +0200 Subject: [PATCH 2/2] =?UTF-8?q?set=20min=20thread=20count=20to=208=20in=20?= =?UTF-8?q?the=20`Sz=C3=A9kely=20Bal=C3=A1zs`=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entries/sbalazs/src/obrc.lpr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/sbalazs/src/obrc.lpr b/entries/sbalazs/src/obrc.lpr index 95d21a8..6833794 100644 --- a/entries/sbalazs/src/obrc.lpr +++ b/entries/sbalazs/src/obrc.lpr @@ -29,12 +29,12 @@ if (Trim(ParamStr(2)) <> '') then begin - TC := StrToIntDef(ParamStr(2), 16); - if TC < 16 then - TC := 16; + TC := StrToIntDef(ParamStr(2), 8); + if TC < 8 then + TC := 8; end else - TC := 16; + TC := 8; FWSManager := TWSManager.Create(ParamStr(1), TC); FWSManager.WSThreadsWatcher.Start;