clang-tidy: enable hicpp-braces-around-statements and fix

This commit is contained in:
Daniel Agar
2019-10-27 19:33:10 -04:00
parent 744f06cc8f
commit a7f330075a
5 changed files with 4 additions and 5 deletions

View File

@@ -48,7 +48,6 @@ Checks: '*,
-google-readability-todo, -google-readability-todo,
-google-runtime-int, -google-runtime-int,
-google-runtime-references, -google-runtime-references,
-hicpp-braces-around-statements,
-hicpp-deprecated-headers, -hicpp-deprecated-headers,
-hicpp-explicit-conversions, -hicpp-explicit-conversions,
-hicpp-function-size, -hicpp-function-size,

View File

@@ -55,7 +55,7 @@ void sq_rem(sq_entry_t *node, sq_queue_t *queue)
for (prev = (sq_entry_t *)queue->head; for (prev = (sq_entry_t *)queue->head;
prev && prev->flink != node; prev && prev->flink != node;
prev = prev->flink); prev = prev->flink) {}
if (prev) { if (prev) {
sq_remafter(prev, queue); sq_remafter(prev, queue);

View File

@@ -1152,7 +1152,7 @@ void Logger::run()
* And on linux this is quite accurate as well, but under NuttX it is not accurate, * And on linux this is quite accurate as well, but under NuttX it is not accurate,
* because usleep() has only a granularity of CONFIG_MSEC_PER_TICK (=1ms). * because usleep() has only a granularity of CONFIG_MSEC_PER_TICK (=1ms).
*/ */
while (px4_sem_wait(&timer_callback_data.semaphore) != 0); while (px4_sem_wait(&timer_callback_data.semaphore) != 0) {}
} }
} }

View File

@@ -364,7 +364,7 @@ MavlinkFTP::_workList(PayloadHeader *payload, bool list_hidden)
// move to the requested offset // move to the requested offset
int requested_offset = payload->offset; int requested_offset = payload->offset;
while (requested_offset-- > 0 && readdir(dp)); while (requested_offset-- > 0 && readdir(dp)) {}
for (;;) { for (;;) {
errno = 0; errno = 0;

View File

@@ -289,7 +289,7 @@ MavlinkParametersManager::send(const hrt_abstime t)
int i = 0; int i = 0;
// Send while burst is not exceeded, we still have buffer space and still something to send // Send while burst is not exceeded, we still have buffer space and still something to send
while ((i++ < max_num_to_send) && (_mavlink->get_free_tx_buf() >= get_size()) && send_params()); while ((i++ < max_num_to_send) && (_mavlink->get_free_tx_buf() >= get_size()) && send_params()) {}
} }
bool bool