diff --git a/src/include/dongle.cpp b/src/include/dongle.cpp index 270e19a39..6506b7e75 100755 --- a/src/include/dongle.cpp +++ b/src/include/dongle.cpp @@ -22,24 +22,19 @@ // Current dongle /////////////////////////////////////////////////////////// -static TDongle* _dongle = NULL; +static TDongle* _dongle = nullptr; TDongle& dongle() { - if (_dongle == NULL) + if (_dongle == nullptr) _dongle = new TDongle; return *_dongle; } bool destroy_dongle() { - bool ok = _dongle != NULL; - if (ok) - { - delete _dongle; - _dongle = NULL; - } - return ok; + safe_delete(_dongle); + return true; } /////////////////////////////////////////////////////////// @@ -137,9 +132,10 @@ bool TDongle::ssa_login(const char* mod) _module.reset(); // Disattiva tutti i moduli ... _module.set(long(BAAUT)); // ... tranne la base - const int err = xvt_dongle_sa_login(NULL); + const int err = xvt_dongle_sa_login(nullptr); _serno = (err >= 0) ? err : 0xFFFF; - if (_serno == 0xFFFF && is_power_station()) + if (//_serno == 0xFFFF && + is_power_station()) _serno = 0; if (_serno != 0xFFFF) { diff --git a/src/include/utility.cpp b/src/include/utility.cpp index 3c8842d1f..2e42adc60 100755 --- a/src/include/utility.cpp +++ b/src/include/utility.cpp @@ -750,8 +750,7 @@ static bool is_sirio_station(const char* hostname) "NBKPEREGOW10", // Stefano "NBKPEREGOW8", // Stefano "NBCALDERONIW10", // Simone - - NULL + nullptr }; for (int i = 0; ranger[i]; i++) if (xvt_str_same(hostname, ranger[i])) diff --git a/src/xvaga/xvt_ssa.cpp b/src/xvaga/xvt_ssa.cpp index 4b3931188..198674038 100644 --- a/src/xvaga/xvt_ssa.cpp +++ b/src/xvaga/xvt_ssa.cpp @@ -174,16 +174,16 @@ TSSA_Pinger::TSSA_Pinger() int xvt_dongle_sa_login(const char* module) { - if (_ssa_timer == NULL) + if (_ssa_timer == nullptr) _ssa_timer = new TSSA_Pinger; return _ssa_timer->Login(module); } int xvt_dongle_sa_crypt(unsigned short* data) { - if (_ssa_timer == NULL) + if (_ssa_timer == nullptr) return SSA_UTENTE_NON_LOGGATO; - if (data == NULL) + if (data == nullptr) return -EACCES; data[0] ^= 0xDEAD;