#1 2020-03-04 08:28:16

sakura
Member
From: Germany
Registered: 2018-02-21
Posts: 230
Website

SynCommons.pas Value assigned to C never used

Hi Arnaud,

function GetCardinalDef(P: PUTF8Char; Default: PtrUInt): PtrUInt;
var c: byte;
begin
  result := Default;
  if P=nil then
    exit;
  c := byte(P^);
  repeat
    if c=0 then
      exit;
    if c>ord(' ') then
      break;
    inc(P);
    c := byte(P^);
  until false;
  dec(c,48);  // <--------------------------------------
  c := byte(P^)-48;
  if c>9 then
    exit;
  result := c;
  repeat
    inc(P);
    c := byte(P^)-48;
    if c>9 then
      break;
    result := result*10+PtrUInt(c);
  until false;
end;

I guess, that one may be just removed and fine it is.

Offline

#2 2020-03-04 14:20:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,263
Website

Re: SynCommons.pas Value assigned to C never used

Should be fixed now. smile
The 2nd line was redundant (c := byte(P^)-48) not this one, in fact..

Offline

Board footer

Powered by FluxBB