From e49429587bbf01ff741a218c86a11fe2b59a0b5c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 May 2016 21:50:44 -0700 Subject: clang-format --- include/grpc/impl/codegen/atm_win32.h | 2 +- src/core/lib/iomgr/async_execution_lock.c | 2 +- src/core/lib/iomgr/async_execution_lock.h | 2 +- src/core/lib/support/mpscq.c | 8 ++++---- src/core/lib/support/mpscq.h | 6 ++---- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/grpc/impl/codegen/atm_win32.h b/include/grpc/impl/codegen/atm_win32.h index 2904007d63..f931f4509f 100644 --- a/include/grpc/impl/codegen/atm_win32.h +++ b/include/grpc/impl/codegen/atm_win32.h @@ -123,7 +123,7 @@ static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) { } static __inline gpr_atm gpr_atm_full_xchg(gpr_atm *p, gpr_atm n) { - return (gpr_atm)InterlockedExchangePointer((PVOID*)p, (PVOID)n); + return (gpr_atm)InterlockedExchangePointer((PVOID *)p, (PVOID)n); } #endif /* GRPC_IMPL_CODEGEN_ATM_WIN32_H */ diff --git a/src/core/lib/iomgr/async_execution_lock.c b/src/core/lib/iomgr/async_execution_lock.c index b6b7e0d92c..595290f78c 100644 --- a/src/core/lib/iomgr/async_execution_lock.c +++ b/src/core/lib/iomgr/async_execution_lock.c @@ -57,7 +57,7 @@ static void finish(grpc_exec_ctx *exec_ctx, grpc_aelock *lock) { while ((n = gpr_mpscq_pop(&lock->queue)) == NULL) { // TODO(ctiller): find something to fill in the time } - grpc_aelock_qnode *ln = (grpc_aelock_qnode*)n; + grpc_aelock_qnode *ln = (grpc_aelock_qnode *)n; ln->action(exec_ctx, ln->arg); gpr_free(ln); } diff --git a/src/core/lib/iomgr/async_execution_lock.h b/src/core/lib/iomgr/async_execution_lock.h index 20cbcaf2e1..66551f9398 100644 --- a/src/core/lib/iomgr/async_execution_lock.h +++ b/src/core/lib/iomgr/async_execution_lock.h @@ -37,8 +37,8 @@ #include #include -#include "src/core/lib/support/mpscq.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/support/mpscq.h" typedef void (*grpc_aelock_action)(grpc_exec_ctx *exec_ctx, void *arg); diff --git a/src/core/lib/support/mpscq.c b/src/core/lib/support/mpscq.c index 911fdd161c..25b055b172 100644 --- a/src/core/lib/support/mpscq.c +++ b/src/core/lib/support/mpscq.c @@ -48,13 +48,14 @@ void gpr_mpscq_destroy(gpr_mpscq *q) { void gpr_mpscq_push(gpr_mpscq *q, gpr_mpscq_node *n) { gpr_atm_no_barrier_store(&n->next, 0); - gpr_mpscq_node *prev = (gpr_mpscq_node*)gpr_atm_full_xchg(&q->head, (gpr_atm)n); + gpr_mpscq_node *prev = + (gpr_mpscq_node *)gpr_atm_full_xchg(&q->head, (gpr_atm)n); gpr_atm_rel_store(&prev->next, (gpr_atm)n); } gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) { gpr_mpscq_node *tail = q->tail; - gpr_mpscq_node *next = (gpr_mpscq_node*)gpr_atm_acq_load(&tail->next); + gpr_mpscq_node *next = (gpr_mpscq_node *)gpr_atm_acq_load(&tail->next); if (tail == &q->stub) { if (next == NULL) return NULL; q->tail = next; @@ -65,7 +66,7 @@ gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) { q->tail = next; return tail; } - gpr_mpscq_node *head = (gpr_mpscq_node*)gpr_atm_acq_load(&q->head); + gpr_mpscq_node *head = (gpr_mpscq_node *)gpr_atm_acq_load(&q->head); if (tail != head) { return 0; } @@ -77,4 +78,3 @@ gpr_mpscq_node *gpr_mpscq_pop(gpr_mpscq *q) { } return NULL; } - diff --git a/src/core/lib/support/mpscq.h b/src/core/lib/support/mpscq.h index 30b37a94a1..e7f4773258 100644 --- a/src/core/lib/support/mpscq.h +++ b/src/core/lib/support/mpscq.h @@ -34,12 +34,10 @@ #ifndef GRPC_CORE_LIB_SUPPORT_MPSCQ_H #define GRPC_CORE_LIB_SUPPORT_MPSCQ_H -#include #include +#include -typedef struct gpr_mpscq_node { - gpr_atm next; -} gpr_mpscq_node; +typedef struct gpr_mpscq_node { gpr_atm next; } gpr_mpscq_node; typedef struct gpr_mpscq { gpr_atm head; -- cgit v1.2.3