Skip to content

Commit

Permalink
Remove extraneous semicolon from mcrouter/lib/fbi/counting_sem.cpp
Browse files Browse the repository at this point in the history
Summary:
Extraneous semicolons are a code smell and can mask more serious problems. `-Wextra-semi-stmt` finds them.

This diff removes an extraneous semicolon or adjusts a macro so that a semicolon is required after the macro (making it look like a standard function).

This file is drawn from a heavy-hitting list, so fixing this problem will allow *many* other files to take advantage of the safety `-Wextra-semi-stmt` offers.

This should be a low-risk diff: if it compiles, it works.

Reviewed By: meyering

Differential Revision: D51631114

fbshipit-source-id: 0f2aa3cfc77283d89c8444231b3a9de421a10850
  • Loading branch information
r-barnes authored and facebook-github-bot committed Nov 29, 2023
1 parent d132934 commit c282591
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mcrouter/lib/fbi/counting_sem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
#include "mcrouter/lib/fbi/util.h"

#define fbi_futex_wait(p, val) \
syscall( \
SYS_futex, (p), FUTEX_WAIT | FUTEX_PRIVATE_FLAG, (val), NULL, NULL, 0);
syscall(SYS_futex, (p), FUTEX_WAIT | FUTEX_PRIVATE_FLAG, (val), NULL, NULL, 0)

#define fbi_futex_wake(p, n) \
syscall(SYS_futex, (p), FUTEX_WAKE | FUTEX_PRIVATE_FLAG, (n), NULL, NULL, 0);
syscall(SYS_futex, (p), FUTEX_WAKE | FUTEX_PRIVATE_FLAG, (n), NULL, NULL, 0)

void counting_sem_init(counting_sem_t* sem, int32_t val) {
sem->cnt.store(std::max(val, 0), std::memory_order_release);
Expand Down

0 comments on commit c282591

Please sign in to comment.