Added -Wzero-as-null-pointer-constant, replaced NULL --> UAVCAN_NULLPTR. All changes are automatic, no manual edits to the library code.

This commit is contained in:
Pavel Kirienko
2016-07-29 15:39:24 +03:00
parent b6fa34fed5
commit 38a241a90a
69 changed files with 306 additions and 274 deletions
@@ -38,7 +38,7 @@ class UAVCAN_EXPORT ReceivedDataStructure : public DataType_
template <typename Ret, Ret(IncomingTransfer::*Fun) () const>
Ret safeget() const
{
if (_transfer_ == NULL)
if (_transfer_ == UAVCAN_NULLPTR)
{
return Ret();
}
@@ -47,13 +47,13 @@ class UAVCAN_EXPORT ReceivedDataStructure : public DataType_
protected:
ReceivedDataStructure()
: _transfer_(NULL)
: _transfer_(UAVCAN_NULLPTR)
{ }
ReceivedDataStructure(const IncomingTransfer* arg_transfer)
: _transfer_(arg_transfer)
{
UAVCAN_ASSERT(arg_transfer != NULL);
UAVCAN_ASSERT(arg_transfer != UAVCAN_NULLPTR);
}
public:
@@ -230,7 +230,7 @@ int GenericSubscriber<DataSpec, DataStruct, TransferListenerType>::checkInit()
GlobalDataTypeRegistry::instance().freeze();
const DataTypeDescriptor* const descr =
GlobalDataTypeRegistry::instance().find(DataTypeKind(DataSpec::DataTypeKind), DataSpec::getDataTypeFullName());
if (descr == NULL)
if (descr == UAVCAN_NULLPTR)
{
UAVCAN_TRACE("GenericSubscriber", "Type [%s] is not registered", DataSpec::getDataTypeFullName());
return -ErrUnknownDataType;