mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-06-15 08:17:05 +00:00
refactor: use nullptr for null pointer literals
- replace `0` null pointer literals (e.g. `void* hint = 0`) with `nullptr` - clang-tidy modernize-use-nullptr https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-nullptr.html
This commit is contained in:
committed by
Dennis Klein
parent
b53d25738e
commit
8ab00ecddc
@@ -77,7 +77,12 @@ class Message final : public fair::mq::Message
|
||||
fManager.IncrementMsgCounter();
|
||||
}
|
||||
|
||||
Message(Manager& manager, UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0, fair::mq::TransportFactory* factory = nullptr)
|
||||
Message(Manager& manager,
|
||||
UnmanagedRegionPtr& region,
|
||||
void* data,
|
||||
const size_t size,
|
||||
void* hint = nullptr,
|
||||
fair::mq::TransportFactory* factory = nullptr)
|
||||
: fair::mq::Message(factory)
|
||||
, fManager(manager)
|
||||
, fLocalPtr(static_cast<char*>(data))
|
||||
|
||||
@@ -118,7 +118,10 @@ class TransportFactory final : public fair::mq::TransportFactory
|
||||
return std::make_unique<Message>(*fManager, data, size, ffn, hint, this);
|
||||
}
|
||||
|
||||
MessagePtr CreateMessage(UnmanagedRegionPtr& region, void* data, size_t size, void* hint = 0) override
|
||||
MessagePtr CreateMessage(UnmanagedRegionPtr& region,
|
||||
void* data,
|
||||
size_t size,
|
||||
void* hint = nullptr) override
|
||||
{
|
||||
return std::make_unique<Message>(*fManager, region, data, size, hint, this);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ struct UnmanagedRegion
|
||||
}
|
||||
fFileMapping = file_mapping(fName.c_str(), read_write);
|
||||
LOG(debug) << "UnmanagedRegion(): initialized file: " << fName;
|
||||
fRegion = mapped_region(fFileMapping, read_write, 0, size, 0, cfg.creationFlags);
|
||||
fRegion = mapped_region(fFileMapping, read_write, 0, size, nullptr, cfg.creationFlags);
|
||||
} else {
|
||||
try {
|
||||
// if opening fails, create
|
||||
@@ -126,7 +126,7 @@ struct UnmanagedRegion
|
||||
}
|
||||
|
||||
try {
|
||||
fRegion = mapped_region(fShmemObject, read_write, 0, 0, 0, cfg.creationFlags);
|
||||
fRegion = mapped_region(fShmemObject, read_write, 0, 0, nullptr, cfg.creationFlags);
|
||||
if (size != 0 && size != fRegion.get_size()) {
|
||||
LOG(error) << "Created/opened region size (" << fRegion.get_size() << ") does not match configured size (" << size << ")";
|
||||
throw TransportError(tools::ToString("Created/opened region size (", fRegion.get_size(), ") does not match configured size (", size, ")"));
|
||||
|
||||
@@ -107,7 +107,11 @@ class Message final : public fair::mq::Message
|
||||
}
|
||||
}
|
||||
|
||||
Message(UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0, fair::mq::TransportFactory* factory = nullptr)
|
||||
Message(UnmanagedRegionPtr& region,
|
||||
void* data,
|
||||
const size_t size,
|
||||
void* hint = nullptr,
|
||||
fair::mq::TransportFactory* factory = nullptr)
|
||||
: fair::mq::Message(factory)
|
||||
, fMsg(std::make_unique<zmq_msg_t>())
|
||||
{
|
||||
|
||||
@@ -73,7 +73,10 @@ class TransportFactory final : public fair::mq::TransportFactory
|
||||
return std::make_unique<Message>(data, size, ffn, hint, this);
|
||||
}
|
||||
|
||||
MessagePtr CreateMessage(UnmanagedRegionPtr& region, void* data, size_t size, void* hint = 0) override
|
||||
MessagePtr CreateMessage(UnmanagedRegionPtr& region,
|
||||
void* data,
|
||||
size_t size,
|
||||
void* hint = nullptr) override
|
||||
{
|
||||
return std::make_unique<Message>(region, data, size, hint, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user