Fixed up a bunch of compiler warnings.

There should be no functional difference, just less noise when compiling
This commit is contained in:
Collin Kidder
2019-08-08 21:15:51 -04:00
parent 27fa8e6c8b
commit e7e65b7216
27 changed files with 187 additions and 187 deletions
+1 -1
View File
@@ -17,5 +17,5 @@ CANConnection* CanConFactory::create(type pType, QString pPortName, QString pDri
default: {}
}
return NULL;
return nullptr;
}
+5 -5
View File
@@ -4,7 +4,7 @@
#include "canconmanager.h"
#include "canconfactory.h"
CANConManager* CANConManager::mInstance = NULL;
CANConManager* CANConManager::mInstance = nullptr;
CANConManager* CANConManager::getInstance()
{
@@ -43,7 +43,7 @@ void CANConManager::resetTimeBasis()
CANConManager::~CANConManager()
{
mTimer.stop();
mInstance = NULL;
mInstance = nullptr;
}
void CANConManager::stopAllConnections()
@@ -142,7 +142,7 @@ CANConnection* CANConManager::getByName(const QString& pName) const
return conn_p;
}
return NULL;
return nullptr;
}
@@ -159,9 +159,9 @@ void CANConManager::refreshConnection(CANConnection* pConn_p)
emit connectionStatusUpdated(buses);
}
if (pConn_p->getQueue().peek() == NULL) return;
if (pConn_p->getQueue().peek() == nullptr) return;
CANFrame* frame_p = NULL;
CANFrame* frame_p = nullptr;
QVector<CANFrame> frames;
//Each connection only knows about its own bus numbers
+2 -2
View File
@@ -16,7 +16,7 @@ CANConnection::CANConnection(QString pPort,
mIsCapSuspended(false),
mStatus(CANCon::NOT_CONNECTED),
mStarted(false),
mThread_p(NULL)
mThread_p(nullptr)
{
/* register types */
qRegisterMetaType<CANBus>("CANBus");
@@ -48,7 +48,7 @@ CANConnection::~CANConnection()
mThread_p->quit();
mThread_p->wait();
delete mThread_p;
mThread_p = NULL;
mThread_p = nullptr;
}
mBusData.clear();
+3 -3
View File
@@ -87,11 +87,11 @@ QVariant CANConnectionModel::data(const QModelIndex &index, int role) const
case CANCon::GVRET_SERIAL: return "GVRET";
default: {}
}
else qDebug() << "Tried to show connection type but connection was NULL";
else qDebug() << "Tried to show connection type but connection was nullptr";
break;
case Column::Port:
if (conn_p) return conn_p->getPort();
else qDebug() << "Tried to show connection port but connection was NULL";
else qDebug() << "Tried to show connection port but connection was nullptr";
break;
case Column::Subtype:
return conn_p->getDriver();
@@ -138,7 +138,7 @@ void CANConnectionModel::replace(int idx , CANConnection* pConn_p)
CANConnection* CANConnectionModel::getAtIdx(int pIdx) const
{
if (pIdx < 0)
return NULL;
return nullptr;
QList<CANConnection*>& conns = CANConManager::getInstance()->getConnections();
+12 -12
View File
@@ -15,9 +15,9 @@ GVRetSerial::GVRetSerial(QString portName, bool useTcp) :
{
sendDebug("GVRetSerial()");
serial = NULL;
tcpClient = NULL;
udpClient = NULL;
serial = nullptr;
tcpClient = nullptr;
udpClient = nullptr;
rx_state = IDLE;
rx_step = 0;
validationCounter = 10; //how many times we can miss validation before we die
@@ -46,7 +46,7 @@ void GVRetSerial::sendDebug(const QString debugText)
void GVRetSerial::sendToSerial(const QByteArray &bytes)
{
if (serial == NULL && tcpClient == NULL && udpClient == NULL)
if (serial == nullptr && tcpClient == nullptr && udpClient == nullptr)
{
sendDebug("Attempt to write to serial port when it has not been initialized!");
return;
@@ -238,7 +238,7 @@ bool GVRetSerial::piSendFrame(const CANFrame& frame)
framesRapid++;
if (serial == NULL && tcpClient == NULL && udpClient == NULL) return false;
if (serial == nullptr && tcpClient == nullptr && udpClient == nullptr) return false;
if (serial && !serial->isOpen()) return false;
if (tcpClient && !tcpClient->isOpen()) return false;
if (udpClient && !udpClient->isOpen()) return false;
@@ -422,7 +422,7 @@ void GVRetSerial::deviceConnected()
}
void GVRetSerial::disconnectDevice() {
if (serial != NULL)
if (serial != nullptr)
{
if (serial->isOpen())
{
@@ -432,9 +432,9 @@ void GVRetSerial::disconnectDevice() {
}
serial->disconnect(); //disconnect all signals
delete serial;
serial = NULL;
serial = nullptr;
}
if (tcpClient != NULL)
if (tcpClient != nullptr)
{
if (tcpClient->isOpen())
{
@@ -442,9 +442,9 @@ void GVRetSerial::disconnectDevice() {
}
tcpClient->disconnect();
delete tcpClient;
tcpClient = NULL;
tcpClient = nullptr;
}
if (udpClient != NULL)
if (udpClient != nullptr)
{
if (udpClient->isOpen())
{
@@ -452,7 +452,7 @@ void GVRetSerial::disconnectDevice() {
}
udpClient->disconnect();
delete udpClient;
udpClient = NULL;
udpClient = nullptr;
}
setStatus(CANCon::NOT_CONNECTED);
@@ -1004,7 +1004,7 @@ void GVRetSerial::handleTick()
//qDebug() << validationCounter;
if (validationCounter == 0 && doValidation)
{
if (serial == NULL && tcpClient == NULL) return;
if (serial == nullptr && tcpClient == nullptr) return;
if ( (serial && serial->isOpen()) || (tcpClient && tcpClient->isOpen()) || (udpClient && udpClient->isOpen())) //if it's still false we have a problem...
{
sendDebug("Comm validation failed.");