mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 21:20:35 +08:00
More fixups for orb_advert_t changed to void *
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
committed by
Lorenz Meier
parent
bd2b5e4738
commit
a452478ef9
@@ -284,7 +284,7 @@ uORB::DeviceNode::publish(const orb_metadata *meta, orb_advert_t handle, const v
|
||||
{
|
||||
//warnx("uORB::DeviceNode::publish meta = %p", meta);
|
||||
|
||||
if (handle == 0) {
|
||||
if (handle == nullptr) {
|
||||
warnx("uORB::DeviceNode::publish called with invalid handle");
|
||||
errno = EINVAL;
|
||||
return ERROR;
|
||||
|
||||
@@ -89,18 +89,18 @@ orb_advert_t uORB::Manager::orb_advertise_multi(const struct orb_metadata *meta,
|
||||
/* open the node as an advertiser */
|
||||
fd = node_open(PUBSUB, meta, data, true, instance, priority);
|
||||
if (fd == ERROR)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
/* get the advertiser handle and close the node */
|
||||
result = ioctl(fd, ORBIOCGADVERTISER, (unsigned long)&advertiser);
|
||||
close(fd);
|
||||
if (result == ERROR)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
/* the advertiser must perform an initial publish to initialise the object */
|
||||
result = orb_publish(meta, advertiser, data);
|
||||
if (result == ERROR)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
return advertiser;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ int uORBTest::UnitTest::test()
|
||||
t.val = 0;
|
||||
ptopic = orb_advertise(ORB_ID(orb_test), &t);
|
||||
|
||||
if (ptopic == 0)
|
||||
if (ptopic == nullptr)
|
||||
return test_fail("advertise failed: %d", errno);
|
||||
|
||||
test_note("publish handle 0x%08x", ptopic);
|
||||
|
||||
Reference in New Issue
Block a user