mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:17:39 +08:00
clang readability-braces-around-statements (#6298)
This commit is contained in:
@@ -435,10 +435,11 @@ VDev::poll_notify(pollevent_t events)
|
||||
/* lock against poll() as well as other wakeups */
|
||||
lock();
|
||||
|
||||
for (unsigned i = 0; i < _max_pollwaiters; i++)
|
||||
for (unsigned i = 0; i < _max_pollwaiters; i++) {
|
||||
if (nullptr != _pollset[i]) {
|
||||
poll_notify_one(_pollset[i], events);
|
||||
}
|
||||
}
|
||||
|
||||
unlock();
|
||||
}
|
||||
@@ -621,20 +622,22 @@ void VDev::showFiles()
|
||||
|
||||
const char *VDev::topicList(unsigned int *next)
|
||||
{
|
||||
for (; *next < PX4_MAX_DEV; (*next)++)
|
||||
for (; *next < PX4_MAX_DEV; (*next)++) {
|
||||
if (devmap[*next] && strncmp(devmap[(*next)]->name, "/obj/", 5) == 0) {
|
||||
return devmap[(*next)++]->name;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *VDev::devList(unsigned int *next)
|
||||
{
|
||||
for (; *next < PX4_MAX_DEV; (*next)++)
|
||||
for (; *next < PX4_MAX_DEV; (*next)++) {
|
||||
if (devmap[*next] && strncmp(devmap[(*next)]->name, "/dev/", 5) == 0) {
|
||||
return devmap[(*next)++]->name;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -793,9 +793,10 @@ PWMSim::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
ret = -EINVAL;
|
||||
|
||||
} else {
|
||||
if (_mixers == nullptr)
|
||||
if (_mixers == nullptr) {
|
||||
_mixers = new MixerGroup(control_callback,
|
||||
(uintptr_t)&_controls);
|
||||
}
|
||||
|
||||
_mixers->add_mixer(mixer);
|
||||
_mixers->groups_required(_groups_required);
|
||||
|
||||
@@ -453,10 +453,11 @@ _file_write(dm_item_t item, unsigned char index, dm_persitence_t persistence, co
|
||||
len = -1;
|
||||
|
||||
/* Seek to the right spot in the data manager file and write the data item */
|
||||
if (lseek(g_task_fd, offset, SEEK_SET) == offset)
|
||||
if (lseek(g_task_fd, offset, SEEK_SET) == offset) {
|
||||
if ((len = write(g_task_fd, buffer, count)) == count) {
|
||||
fsync(g_task_fd); /* Make sure data is written to physical media */
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure the write succeeded */
|
||||
if (len != count) {
|
||||
|
||||
Reference in New Issue
Block a user