mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
fixed some potential memory leaks and other errors detected by cppcheck
This commit is contained in:
30
Console.cpp
30
Console.cpp
@@ -248,35 +248,35 @@ void Console::BitsUpdate(int mask)
|
||||
if (PoKeys55[0])
|
||||
{ // pewnie trzeba będzie to dodatkowo buforować i oczekiwać na potwierdzenie
|
||||
if (mask & 0x0001) // b0 gdy SHP
|
||||
PoKeys55[0]->Write(0x40, 23 - 1, iBits & 0x0001 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 23 - 1, (iBits & 0x0001) ? 1 : 0);
|
||||
if (mask & 0x0002) // b1 gdy zmieniony CA
|
||||
PoKeys55[0]->Write(0x40, 24 - 1, iBits & 0x0002 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 24 - 1, (iBits & 0x0002) ? 1 : 0);
|
||||
if (mask & 0x0004) // b2 gdy jazda na oporach
|
||||
PoKeys55[0]->Write(0x40, 32 - 1, iBits & 0x0004 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 32 - 1, (iBits & 0x0004) ? 1 : 0);
|
||||
if (mask & 0x0008) // b3 Lampka WS (wyłącznika szybkiego)
|
||||
PoKeys55[0]->Write(0x40, 25 - 1, iBits & 0x0008 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 25 - 1, (iBits & 0x0008) ? 1 : 0);
|
||||
if (mask & 0x0010) // b4 Lampka przekaźnika nadmiarowego silników trakcyjnych
|
||||
PoKeys55[0]->Write(0x40, 27 - 1, iBits & 0x0010 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 27 - 1, (iBits & 0x0010) ? 1 : 0);
|
||||
if (mask & 0x0020) // b5 Lampka styczników liniowych
|
||||
PoKeys55[0]->Write(0x40, 29 - 1, iBits & 0x0020 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 29 - 1, (iBits & 0x0020) ? 1 : 0);
|
||||
if (mask & 0x0040) // b6 Lampka poślizgu
|
||||
PoKeys55[0]->Write(0x40, 30 - 1, iBits & 0x0040 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 30 - 1, (iBits & 0x0040) ? 1 : 0);
|
||||
if (mask & 0x0080) // b7 Lampka "przetwornicy"
|
||||
PoKeys55[0]->Write(0x40, 28 - 1, iBits & 0x0080 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 28 - 1, (iBits & 0x0080) ? 1 : 0);
|
||||
if (mask & 0x0100) // b8 Kontrolka przekaźnika nadmiarowego sprężarki
|
||||
PoKeys55[0]->Write(0x40, 33 - 1, iBits & 0x0100 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 33 - 1, (iBits & 0x0100) ? 1 : 0);
|
||||
if (mask & 0x0200) // b9 Kontrolka sygnalizacji wentylatorów i oporów
|
||||
PoKeys55[0]->Write(0x40, 26 - 1, iBits & 0x0200 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 26 - 1, (iBits & 0x0200) ? 1 : 0);
|
||||
if (mask & 0x0400) // b10 Kontrolka wysokiego rozruchu
|
||||
PoKeys55[0]->Write(0x40, 31 - 1, iBits & 0x0400 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 31 - 1, (iBits & 0x0400) ? 1 : 0);
|
||||
if (mask & 0x0800) // b11 Kontrolka ogrzewania pociągu
|
||||
PoKeys55[0]->Write(0x40, 34 - 1, iBits & 0x0800 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 34 - 1, (iBits & 0x0800) ? 1 : 0);
|
||||
if (mask & 0x1000) // b12 Ciśnienie w cylindrach do odbijania w haslerze
|
||||
PoKeys55[0]->Write(0x40, 52 - 1, iBits & 0x1000 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 52 - 1, (iBits & 0x1000) ? 1 : 0);
|
||||
if (mask & 0x2000) // b13 Prąd na silnikach do odbijania w haslerze
|
||||
PoKeys55[0]->Write(0x40, 53 - 1, iBits & 0x2000 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 53 - 1, (iBits & 0x2000) ? 1 : 0);
|
||||
if (mask & 0x4000) // b14 Brzęczyk SHP lub CA
|
||||
PoKeys55[0]->Write(0x40, 16 - 1, iBits & 0x4000 ? 1 : 0);
|
||||
PoKeys55[0]->Write(0x40, 16 - 1, (iBits & 0x4000) ? 1 : 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user