View Issue Details

IDProjectCategoryView StatusLast Update
0001731SkyChart1-Softwarepublic18-10-09 16:35
ReporterSasa Assigned ToPatrick Chevalley  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionno change required 
PlatformLinux 64-bitOSLubuntuOS Version17.04
Product Version4.1 SVN 
Summary0001731: cu_catalog - suspicious unconditional loop break
DescriptionSevela methods in cu_catalog have unconditional break in the loop.
For instance:

function Tcatalog.ReadDSL(var rec:GcatRec):boolean;
begin
result:=true;
repeat
  ReadGCat(rec,result);
  if not result then break;
  rec.ra:=deg2rad*rec.ra;
  rec.dec:=deg2rad*rec.dec;
  if DSLForceColor then begin
    rec.outlines.valid[vlLinecolor]:=true;
    rec.outlines.linecolor:=DSLcolor;
  end;
  break;
until not result;
end;

Upper code will be executed at most once. I have not analyzed specific methods in order to determinate loop is actually needed or not.
TagsNo tags attached.

Activities

Patrick Chevalley

17-06-25 11:00

administrator   ~0003861

This is because this DSL catalog (nebula contour) is very simple with a single file and no object filter, but I want to keep the same structure as the other catalog for the case I need more in the future.

See for example GetGCatS, in this case if the magnitude filter is reach it open the next file and retry.

I can replace "until not result;" by "until false;" if this can avoid some confusion in reading the code.

Sasa

17-06-29 21:51

reporter   ~0003867

Actually I tested here my own automatic Pascal source formatter/indenter with your source code and have noticed this suspicious code...

Another similar suspicious code with case structure contain only one case value.

If all that is not sign for a bug as you noted, changes are not needed.
You may close this, in that case.

Issue History

Date Modified Username Field Change
17-06-12 13:09 Sasa New Issue
17-06-25 11:00 Patrick Chevalley Assigned To => Patrick Chevalley
17-06-25 11:00 Patrick Chevalley Status new => assigned
17-06-25 11:00 Patrick Chevalley Note Added: 0003861
17-06-29 21:51 Sasa Note Added: 0003867
18-10-09 16:35 Patrick Chevalley Status assigned => resolved
18-10-09 16:35 Patrick Chevalley Resolution open => no change required