Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
44d97f51
Commit
44d97f51
authored
Aug 11, 2019
by
murata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comm: Change NULL or 0 to nullptr
parent
d60ffb2b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
28 deletions
+28
-28
BluetoothLink.h
src/comm/BluetoothLink.h
+1
-1
LinkConfiguration.cc
src/comm/LinkConfiguration.cc
+1
-1
LinkInterface.h
src/comm/LinkInterface.h
+1
-1
MockLink.cc
src/comm/MockLink.cc
+1
-1
MockLinkMissionItemHandler.cc
src/comm/MockLinkMissionItemHandler.cc
+1
-1
QGCJSBSimLink.cc
src/comm/QGCJSBSimLink.cc
+4
-4
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+6
-6
SerialLink.cc
src/comm/SerialLink.cc
+4
-4
TCPLink.cc
src/comm/TCPLink.cc
+5
-5
UDPLink.cc
src/comm/UDPLink.cc
+4
-4
No files found.
src/comm/BluetoothLink.h
View file @
44d97f51
...
...
@@ -91,7 +91,7 @@ public:
QString
devName
()
{
return
_device
.
name
;
}
QString
address
();
QStringList
nameList
()
{
return
_nameList
;
}
bool
scanning
()
{
return
_deviceDiscover
!=
NULL
;
}
bool
scanning
()
{
return
_deviceDiscover
!=
nullptr
;
}
BluetoothData
device
()
{
return
_device
;
}
...
...
src/comm/LinkConfiguration.cc
View file @
44d97f51
...
...
@@ -55,7 +55,7 @@ LinkConfiguration::LinkConfiguration(LinkConfiguration* copy)
void
LinkConfiguration
::
copyFrom
(
LinkConfiguration
*
source
)
{
Q_ASSERT
(
source
!=
NULL
);
Q_ASSERT
(
source
!=
nullptr
);
_link
=
source
->
link
();
_name
=
source
->
name
();
_dynamic
=
source
->
isDynamic
();
...
...
src/comm/LinkInterface.h
View file @
44d97f51
...
...
@@ -39,7 +39,7 @@ class LinkInterface : public QThread
public:
virtual
~
LinkInterface
()
{
stopMavlinkMessagesTimer
();
_config
->
setLink
(
NULL
);
_config
->
setLink
(
nullptr
);
}
Q_PROPERTY
(
bool
active
READ
active
NOTIFY
activeChanged
)
...
...
src/comm/MockLink.cc
View file @
44d97f51
...
...
@@ -70,7 +70,7 @@ MockLink::MockLink(SharedLinkConfigurationPointer& config)
,
_vehicleLatitude
(
_defaultVehicleLatitude
+
((
_vehicleSystemId
-
128
)
*
0.0001
))
// Slight offset for each vehicle
,
_vehicleLongitude
(
_defaultVehicleLongitude
+
((
_vehicleSystemId
-
128
)
*
0.0001
))
,
_vehicleAltitude
(
_defaultVehicleAltitude
)
,
_fileServer
(
NULL
)
,
_fileServer
(
nullptr
)
,
_sendStatusText
(
false
)
,
_apmSendHomePositionOnEmptyList
(
false
)
,
_failureMode
(
MockConfiguration
::
FailNone
)
...
...
src/comm/MockLinkMissionItemHandler.cc
View file @
44d97f51
...
...
@@ -17,7 +17,7 @@ QGC_LOGGING_CATEGORY(MockLinkMissionItemHandlerLog, "MockLinkMissionItemHandlerL
MockLinkMissionItemHandler
::
MockLinkMissionItemHandler
(
MockLink
*
mockLink
,
MAVLinkProtocol
*
mavlinkProtocol
)
:
_mockLink
(
mockLink
)
,
_missionItemResponseTimer
(
NULL
)
,
_missionItemResponseTimer
(
nullptr
)
,
_failureMode
(
FailNone
)
,
_sendHomePositionOnEmptyList
(
false
)
,
_mavlinkProtocol
(
mavlinkProtocol
)
...
...
src/comm/QGCJSBSimLink.cc
View file @
44d97f51
...
...
@@ -30,8 +30,8 @@
QGCJSBSimLink
::
QGCJSBSimLink
(
Vehicle
*
vehicle
,
QString
startupArguments
,
QString
remoteHost
,
QHostAddress
host
,
quint16
port
)
:
_vehicle
(
vehicle
)
,
socket
(
NULL
)
,
process
(
NULL
)
,
socket
(
nullptr
)
,
process
(
nullptr
)
,
startupArguments
(
startupArguments
)
{
// We're doing it wrong - because the Qt folks got the API wrong:
...
...
@@ -337,13 +337,13 @@ bool QGCJSBSimLink::disconnectSimulation()
{
process
->
close
();
delete
process
;
process
=
NULL
;
process
=
nullptr
;
}
if
(
socket
)
{
socket
->
close
();
delete
socket
;
socket
=
NULL
;
socket
=
nullptr
;
}
connectState
=
false
;
...
...
src/comm/QGCXPlaneLink.cc
View file @
44d97f51
...
...
@@ -35,9 +35,9 @@ QGCXPlaneLink::QGCXPlaneLink(Vehicle* vehicle, QString remoteHost, QHostAddress
_vehicle
(
vehicle
),
remoteHost
(
QHostAddress
(
"127.0.0.1"
)),
remotePort
(
49000
),
socket
(
NULL
),
process
(
NULL
),
terraSync
(
NULL
),
socket
(
nullptr
),
process
(
nullptr
),
terraSync
(
nullptr
),
barometerOffsetkPa
(
-
8.0
f
),
airframeID
(
QGCXPlaneLink
::
AIRFRAME_UNKNOWN
),
xPlaneConnected
(
false
),
...
...
@@ -75,7 +75,7 @@ QGCXPlaneLink::~QGCXPlaneLink()
if
(
socket
)
{
socket
->
close
();
socket
->
deleteLater
();
socket
=
NULL
;
socket
=
nullptr
;
}
}
...
...
@@ -180,7 +180,7 @@ void QGCXPlaneLink::run()
emit
statusMessage
(
"Binding socket failed!"
);
socket
->
deleteLater
();
socket
=
NULL
;
socket
=
nullptr
;
return
;
}
...
...
@@ -260,7 +260,7 @@ void QGCXPlaneLink::run()
socket
->
close
();
socket
->
deleteLater
();
socket
=
NULL
;
socket
=
nullptr
;
emit
simulationDisconnected
();
emit
simulationConnected
(
false
);
...
...
src/comm/SerialLink.cc
View file @
44d97f51
...
...
@@ -32,7 +32,7 @@ static QStringList kSupportedBaudRates;
SerialLink
::
SerialLink
(
SharedLinkConfigurationPointer
&
config
,
bool
isPX4Flow
)
:
LinkInterface
(
config
,
isPX4Flow
)
,
_port
(
NULL
)
,
_port
(
nullptr
)
,
_bytesRead
(
0
)
,
_stopp
(
false
)
,
_reqReset
(
false
)
...
...
@@ -103,7 +103,7 @@ void SerialLink::_disconnect(void)
if
(
_port
)
{
_port
->
close
();
_port
->
deleteLater
();
_port
=
NULL
;
_port
=
nullptr
;
}
#ifdef __android__
...
...
@@ -161,7 +161,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString&
qgcApp
()
->
processEvents
(
QEventLoop
::
ExcludeUserInputEvents
);
}
delete
_port
;
_port
=
NULL
;
_port
=
nullptr
;
}
qCDebug
(
SerialLinkLog
)
<<
"SerialLink: hardwareConnect to "
<<
_serialConfig
->
portName
();
...
...
@@ -234,7 +234,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString&
emit
communicationUpdate
(
getName
(),
tr
(
"Error opening port: %1"
).
arg
(
_port
->
errorString
()));
_port
->
close
();
delete
_port
;
_port
=
NULL
;
_port
=
nullptr
;
return
false
;
// couldn't open serial port
}
...
...
src/comm/TCPLink.cc
View file @
44d97f51
...
...
@@ -27,7 +27,7 @@
TCPLink
::
TCPLink
(
SharedLinkConfigurationPointer
&
config
)
:
LinkInterface
(
config
)
,
_tcpConfig
(
qobject_cast
<
TCPConfiguration
*>
(
config
.
data
()))
,
_socket
(
NULL
)
,
_socket
(
nullptr
)
,
_socketIsConnected
(
false
)
{
Q_ASSERT
(
_tcpConfig
);
...
...
@@ -123,7 +123,7 @@ void TCPLink::_disconnect(void)
_socket
->
disconnectFromHost
();
// Disconnect tcp
_socket
->
waitForDisconnected
();
_socket
->
deleteLater
();
// Make sure delete happens on correct thread
_socket
=
NULL
;
_socket
=
nullptr
;
emit
disconnected
();
}
}
...
...
@@ -146,7 +146,7 @@ bool TCPLink::_connect(void)
bool
TCPLink
::
_hardwareConnect
()
{
Q_ASSERT
(
_socket
==
NULL
);
Q_ASSERT
(
_socket
==
nullptr
);
_socket
=
new
QTcpSocket
();
QSignalSpy
errorSpy
(
_socket
,
static_cast
<
void
(
QTcpSocket
::*
)(
QAbstractSocket
::
SocketError
)
>
(
&
QTcpSocket
::
error
));
...
...
@@ -165,7 +165,7 @@ bool TCPLink::_hardwareConnect()
emit
communicationError
(
tr
(
"Link Error"
),
tr
(
"Error on link %1. Connection failed"
).
arg
(
getName
()));
}
delete
_socket
;
_socket
=
NULL
;
_socket
=
nullptr
;
return
false
;
}
_socketIsConnected
=
true
;
...
...
@@ -281,7 +281,7 @@ void TCPConfiguration::copyFrom(LinkConfiguration *source)
{
LinkConfiguration
::
copyFrom
(
source
);
TCPConfiguration
*
usource
=
dynamic_cast
<
TCPConfiguration
*>
(
source
);
Q_ASSERT
(
usource
!=
NULL
);
Q_ASSERT
(
usource
!=
nullptr
);
_port
=
usource
->
port
();
_address
=
usource
->
address
();
}
...
...
src/comm/UDPLink.cc
View file @
44d97f51
...
...
@@ -80,10 +80,10 @@ static bool contains_target(const QList<UDPCLient*> list, const QHostAddress& ad
UDPLink
::
UDPLink
(
SharedLinkConfigurationPointer
&
config
)
:
LinkInterface
(
config
)
#if defined(QGC_ZEROCONF_ENABLED)
,
_dnssServiceRef
(
NULL
)
,
_dnssServiceRef
(
nullptr
)
#endif
,
_running
(
false
)
,
_socket
(
NULL
)
,
_socket
(
nullptr
)
,
_udpConfig
(
qobject_cast
<
UDPConfiguration
*>
(
config
.
data
()))
,
_connectState
(
false
)
{
...
...
@@ -253,7 +253,7 @@ void UDPLink::_disconnect(void)
if
(
_socket
)
{
// Make sure delete happen on correct thread
_socket
->
deleteLater
();
_socket
=
NULL
;
_socket
=
nullptr
;
emit
disconnected
();
}
_connectState
=
false
;
...
...
@@ -281,7 +281,7 @@ bool UDPLink::_hardwareConnect()
{
if
(
_socket
)
{
delete
_socket
;
_socket
=
NULL
;
_socket
=
nullptr
;
}
QHostAddress
host
=
QHostAddress
::
AnyIPv4
;
_socket
=
new
QUdpSocket
(
this
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment