mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-27 16:06:36 +08:00
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:
@@ -22,7 +22,7 @@ int GenericPublisherBase::doInit(DataTypeKind dtkind, const char* dtname, CanTxQ
|
||||
GlobalDataTypeRegistry::instance().freeze();
|
||||
|
||||
const DataTypeDescriptor* const descr = GlobalDataTypeRegistry::instance().find(dtkind, dtname);
|
||||
if (descr == NULL)
|
||||
if (descr == UAVCAN_NULLPTR)
|
||||
{
|
||||
UAVCAN_TRACE("GenericPublisher", "Type [%s] is not registered", dtname);
|
||||
return -ErrUnknownDataType;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace uavcan
|
||||
int GenericSubscriberBase::genericStart(TransferListener* listener,
|
||||
bool (Dispatcher::*registration_method)(TransferListener*))
|
||||
{
|
||||
if (listener == NULL)
|
||||
if (listener == UAVCAN_NULLPTR)
|
||||
{
|
||||
UAVCAN_ASSERT(0);
|
||||
return -ErrLogic;
|
||||
@@ -26,7 +26,7 @@ int GenericSubscriberBase::genericStart(TransferListener* listener,
|
||||
|
||||
void GenericSubscriberBase::stop(TransferListener* listener)
|
||||
{
|
||||
if (listener != NULL)
|
||||
if (listener != UAVCAN_NULLPTR)
|
||||
{
|
||||
node_.getDispatcher().unregisterMessageListener(listener);
|
||||
node_.getDispatcher().unregisterServiceRequestListener(listener);
|
||||
|
||||
@@ -23,7 +23,7 @@ GlobalDataTypeRegistry::List* GlobalDataTypeRegistry::selectList(DataTypeKind ki
|
||||
else
|
||||
{
|
||||
UAVCAN_ASSERT(0);
|
||||
return NULL;
|
||||
return UAVCAN_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ void GlobalDataTypeRegistry::freeze()
|
||||
const DataTypeDescriptor* GlobalDataTypeRegistry::find(const char* name) const
|
||||
{
|
||||
const DataTypeDescriptor* desc = find(DataTypeKindMessage, name);
|
||||
if (desc == NULL)
|
||||
if (desc == UAVCAN_NULLPTR)
|
||||
{
|
||||
desc = find(DataTypeKindService, name);
|
||||
}
|
||||
@@ -156,13 +156,13 @@ const DataTypeDescriptor* GlobalDataTypeRegistry::find(DataTypeKind kind, const
|
||||
if (!name)
|
||||
{
|
||||
UAVCAN_ASSERT(0);
|
||||
return NULL;
|
||||
return UAVCAN_NULLPTR;
|
||||
}
|
||||
const List* list = selectList(kind);
|
||||
if (!list)
|
||||
{
|
||||
UAVCAN_ASSERT(0);
|
||||
return NULL;
|
||||
return UAVCAN_NULLPTR;
|
||||
}
|
||||
Entry* p = list->get();
|
||||
while (p)
|
||||
@@ -173,7 +173,7 @@ const DataTypeDescriptor* GlobalDataTypeRegistry::find(DataTypeKind kind, const
|
||||
}
|
||||
p = p->getNextListNode();
|
||||
}
|
||||
return NULL;
|
||||
return UAVCAN_NULLPTR;
|
||||
}
|
||||
|
||||
const DataTypeDescriptor* GlobalDataTypeRegistry::find(DataTypeKind kind, DataTypeID dtid) const
|
||||
@@ -182,7 +182,7 @@ const DataTypeDescriptor* GlobalDataTypeRegistry::find(DataTypeKind kind, DataTy
|
||||
if (!list)
|
||||
{
|
||||
UAVCAN_ASSERT(0);
|
||||
return NULL;
|
||||
return UAVCAN_NULLPTR;
|
||||
}
|
||||
Entry* p = list->get();
|
||||
while (p)
|
||||
@@ -193,7 +193,7 @@ const DataTypeDescriptor* GlobalDataTypeRegistry::find(DataTypeKind kind, DataTy
|
||||
}
|
||||
p = p->getNextListNode();
|
||||
}
|
||||
return NULL;
|
||||
return UAVCAN_NULLPTR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void ServiceClientBase::CallState::handleDeadline(MonotonicTime)
|
||||
{
|
||||
UAVCAN_TRACE("ServiceClient::CallState", "Timeout from nid=%d, tid=%d, dtname=%s",
|
||||
int(id_.server_node_id.get()), int(id_.transfer_id.get()),
|
||||
(owner_.data_type_descriptor_ == NULL) ? "???" : owner_.data_type_descriptor_->getFullName());
|
||||
(owner_.data_type_descriptor_ == UAVCAN_NULLPTR) ? "???" : owner_.data_type_descriptor_->getFullName());
|
||||
/*
|
||||
* What we're doing here is relaying execution from this call stack to a different one.
|
||||
* We need it because call registry cannot release memory from this callback, because this will destroy the
|
||||
@@ -46,18 +46,18 @@ int ServiceClientBase::prepareToCall(INode& node,
|
||||
/*
|
||||
* Determining the Data Type ID
|
||||
*/
|
||||
if (data_type_descriptor_ == NULL)
|
||||
if (data_type_descriptor_ == UAVCAN_NULLPTR)
|
||||
{
|
||||
GlobalDataTypeRegistry::instance().freeze();
|
||||
data_type_descriptor_ = GlobalDataTypeRegistry::instance().find(DataTypeKindService, dtname);
|
||||
if (data_type_descriptor_ == NULL)
|
||||
if (data_type_descriptor_ == UAVCAN_NULLPTR)
|
||||
{
|
||||
UAVCAN_TRACE("ServiceClient", "Type [%s] is not registered", dtname);
|
||||
return -ErrUnknownDataType;
|
||||
}
|
||||
UAVCAN_TRACE("ServiceClient", "Data type descriptor inited: %s", data_type_descriptor_->toString().c_str());
|
||||
}
|
||||
UAVCAN_ASSERT(data_type_descriptor_ != NULL);
|
||||
UAVCAN_ASSERT(data_type_descriptor_ != UAVCAN_NULLPTR);
|
||||
|
||||
/*
|
||||
* Determining the Transfer ID
|
||||
|
||||
Reference in New Issue
Block a user