Skip to content

Commit

Permalink
Use nullptr in lightspeed/msysclient/ArmadilloUserContext.cpp
Browse files Browse the repository at this point in the history
Summary:
`nullptr` is preferable to `0` or `NULL`. Let's use it everywhere so we can enable `-Wzero-as-null-pointer-constant`.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: dmm-fb

Differential Revision: D54835576

fbshipit-source-id: 4dfa91ea23a21ba2bf9edbf4ded73314fe15fba4
  • Loading branch information
r-barnes authored and facebook-github-bot committed Apr 4, 2024
1 parent 482416d commit bc7800b
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions mcrouter/lib/fbi/counting_sem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,25 @@

#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)

#define fbi_futex_wake(p, n) \
syscall(SYS_futex, (p), FUTEX_WAKE | FUTEX_PRIVATE_FLAG, (n), NULL, NULL, 0)
#define fbi_futex_wait(p, val) \
syscall( \
SYS_futex, \
(p), \
FUTEX_WAIT | FUTEX_PRIVATE_FLAG, \
(val), \
nullptr, \
nullptr, \
0)

#define fbi_futex_wake(p, n) \
syscall( \
SYS_futex, \
(p), \
FUTEX_WAKE | FUTEX_PRIVATE_FLAG, \
(n), \
nullptr, \
nullptr, \
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 bc7800b

Please sign in to comment.