From 0464dfbddb44865354da00f9a0973fa2d35ccdf4 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Fri, 1 Dec 2017 13:24:47 +0300 Subject: [PATCH] Convert sb_counter_add() to C99 inline. --- src/sb_counter.c | 6 ++++-- src/sb_counter.h | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sb_counter.c b/src/sb_counter.c index b7e56c7..e0aa64e 100644 --- a/src/sb_counter.c +++ b/src/sb_counter.c @@ -28,8 +28,10 @@ static sb_counters_t last_intermediate_counters; static sb_counters_t last_cumulative_counters; -extern inline uint64_t sb_counter_val(int thread_id, sb_counter_type_t type); -extern inline void sb_counter_inc(int thread_id, sb_counter_type_t type); +extern inline uint64_t sb_counter_val(int, sb_counter_type_t); +extern inline void sb_counter_add(int, sb_counter_type_t, uint64_t); +extern inline void sb_counter_inc(int, sb_counter_type_t); + /* Initialize per-thread stats */ diff --git a/src/sb_counter.h b/src/sb_counter.h index 19ce2f8..be28463 100644 --- a/src/sb_counter.h +++ b/src/sb_counter.h @@ -65,8 +65,7 @@ inline uint64_t sb_counter_val(int thread_id, sb_counter_type_t type) } /* Add a given value to a given stat counter for a given thread */ -static inline void sb_counter_add(int thread_id, sb_counter_type_t type, - uint64_t val) +inline void sb_counter_add(int thread_id, sb_counter_type_t type, uint64_t val) { ck_pr_store_64(&sb_counters[thread_id][type], sb_counter_val(thread_id, type) + val);