Skip to content

Commit

Permalink
Fix compilation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed Jan 5, 2023
1 parent e7183c2 commit 835adef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/HVDb.pas
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ procedure THVDb.FillHVs(var CB: TComboBox; var Indexes: TWordAr; addr: Integer =
SetLength(Indexes, Self.HVs.Count + 1);
CB.Items.Add(IntToStr(special.addr) + ' : ' + special.name + ' (' + special.designation + ')');
Indexes[0] := special.addr;
if (special.addr = addr) then
if (Integer(special.addr) = addr) then
CB.ItemIndex := 0;
index := 1;
end else begin
Expand All @@ -165,7 +165,7 @@ procedure THVDb.FillHVs(var CB: TComboBox; var Indexes: TWordAr; addr: Integer =
begin
CB.Items.Add(IntToStr(Self.HVs[i].addr) + ' : ' + Self.HVs[i].name + ' (' + Self.HVs[i].designation + ')');
Indexes[index] := Self.HVs[i].addr;
if (Self.HVs[i].addr = addr) then
if (Integer(Self.HVs[i].addr) = addr) then
CB.ItemIndex := i;
index := index + 1;
end;
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/BlockTurnout.pas
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ procedure TPTurnout.Show(obj: TDXDraw; blik: boolean; useky: TList<TPTrack>);
end;
TVyhPoloha.plus:
begin
Symbols.Draw(SymbolSet.IL_Symbols, Self.position, (Self.symbolID) + 4 + (4 * Self.orientationPlus), fg,
Symbols.Draw(SymbolSet.IL_Symbols, Self.position, (Self.symbolID) + 4 + (4 * Integer(Self.orientationPlus)), fg,
bkcol, obj);
end;
TVyhPoloha.minus:
begin
Symbols.Draw(SymbolSet.IL_Symbols, Self.position, (Self.symbolID) + 8 - (4 * Self.orientationPlus), fg,
Symbols.Draw(SymbolSet.IL_Symbols, Self.position, (Self.symbolID) + 8 - (4 * Integer(Self.orientationPlus)), fg,
bkcol, obj);
end;
TVyhPoloha.both:
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/BlocksTrack.pas
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ procedure TPTracks.ShowBranches(track: TPTrack; vetevI: Integer; visible: boolea

TVyhPoloha.plus, TVyhPoloha.minus:
begin
if ((Integer(turnout.panelProp.position) xor turnout.orientationPlus) = 0) then
if ((Cardinal(turnout.panelProp.position) xor turnout.orientationPlus) = 0) then
begin
ShowBranches(track, branch.node1.ref_plus, visible, showed, myORs, flash, obj, startJC, turnouts);
ShowBranches(track, branch.node1.ref_minus, false, showed, myORs, flash, obj, startJC, turnouts);
Expand Down Expand Up @@ -404,7 +404,7 @@ procedure TPTracks.ShowBranches(track: TPTrack; vetevI: Integer; visible: boolea

TVyhPoloha.plus, TVyhPoloha.minus:
begin
if ((Integer(turnout.panelProp.position) xor turnout.orientationPlus) = 0) then
if ((Cardinal(turnout.panelProp.position) xor turnout.orientationPlus) = 0) then
begin
ShowBranches(track, branch.node2.ref_plus, visible, showed, myORs, flash, obj, startJC, turnouts);
ShowBranches(track, branch.node2.ref_minus, false, showed, myORs, flash, obj, startJC, turnouts);
Expand Down
6 changes: 3 additions & 3 deletions src/panel/Panel.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,9 @@ procedure TRelief.Image(filename: string);
var PYStart := Cardinal(Bmp.ScanLine[Y]);
for var X := 0 to Bmp.Width - 1 do
begin
PB := Pointer(PYStart + 3 * X);
PG := Pointer(PYStart + 3 * X + 1);
PR := Pointer(PYStart + 3 * X + 2);
PB := Pointer(Integer(PYStart) + 3 * X);
PG := Pointer(Integer(PYStart) + 3 * X + 1);
PR := Pointer(Integer(PYStart) + 3 * X + 2);

var aColor := PR^ + (PG^ shl 8) + (PB^ shl 16);
if (aColor = clBlack) then
Expand Down
4 changes: 2 additions & 2 deletions src/panel/Symbols.pas
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ procedure TSymbolSet.LoadIL(var IL: TImageList; ResourceName: string; PartWidth,

ColouredImages.PixelFormat := pf32Bit;
IL.SetSize(PartWidth, PartHeight);
ColouredImages.SetSize(PartWidth * Length(_SYMBOL_COLORS), PartHeight);
ColouredImages.SetSize(Integer(PartWidth) * Length(_SYMBOL_COLORS), PartHeight);

for var symbol: Cardinal := 0 to (AllImages.Width div PartWidth) - 1 do
for var symbol: Cardinal := 0 to (Cardinal(AllImages.Width) div PartWidth) - 1 do
begin
for var i: Cardinal := 0 to Length(_Symbol_Colors) - 1 do
begin
Expand Down

0 comments on commit 835adef

Please sign in to comment.