Skip to content

Commit

Permalink
code reformatting #2
Browse files Browse the repository at this point in the history
  • Loading branch information
daedric committed Feb 22, 2018
1 parent 98f98c7 commit d4cbbee
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/metrics/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
*
*/

#include <commonpp/core/LoggingInterface.hpp>
#include <commonpp/core/Utils.hpp>
#include <commonpp/metric/Metrics.hpp>
#include <commonpp/metric/reservoir/ExponentiallyDecaying.hpp>
#include <commonpp/metric/sink/Console.hpp>
#include <commonpp/metric/sink/Graphite.hpp>
#include <commonpp/metric/sink/InfluxDB.hpp>
#include <commonpp/metric/type/TimeScope.hpp>
#include <commonpp/core/LoggingInterface.hpp>

using commonpp::metric::MetricTag;
using commonpp::metric::MetricValue;
Expand Down
2 changes: 2 additions & 0 deletions include/commonpp/core/Options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <commonpp/core/Utils.hpp>
#include <commonpp/core/config.hpp>

// clang-format off
#if BOOST_CLANG == 1 && BOOST_MAJOR == 1 && BOOST_MAJOR <= 55
# if defined(BOOST_PP_VARIADICS)
# if !BOOST_PP_VARIADICS
Expand All @@ -27,6 +28,7 @@
# define BOOST_PP_VARIADICS 1
# endif
#endif
// clang-format on

#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
Expand Down
3 changes: 3 additions & 0 deletions include/commonpp/metric/type/Counter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define SHARED_LOCK_USE_ATOMIC 2
#define SHARED_LOCK_USE_SPINLOCK 3

// clang-format off
#ifndef SHARED_COUNTER_BACKEND
# define SHARED_COUNTER_BACKEND SHARED_LOCK_USE_TBB
#endif
Expand All @@ -31,6 +32,8 @@
# include <atomic>
#endif

// clang-format on

#include <commonpp/core/FloatingArithmeticTools.hpp>
#include <commonpp/metric/MetricValue.hpp>
#include <commonpp/metric/detail/types.hpp>
Expand Down
8 changes: 5 additions & 3 deletions include/commonpp/thread/Spinlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define SPINLOCK_USE_ATOMIC 1
#define SPINLOCK_USE_TBB 2

// clang-format off
#ifndef SPINLOCK_BACKEND
# define SPINLOCK_BACKEND SPINLOCK_USE_TBB
#endif
Expand All @@ -29,6 +30,7 @@
#elif SPINLOCK_BACKEND == SPINLOCK_USE_TBB
# include <tbb/spin_mutex.h>
#endif
// clang-format on

namespace commonpp
{
Expand Down Expand Up @@ -59,11 +61,11 @@ struct _spinlock
while (!try_lock)
{
#if defined(__i386__) || defined(__x86_64__)
# ifdef __clang__
#ifdef __clang__
_mm_pause();
# else
#else
__builtin_ia32_pause();
# endif
#endif
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion include/commonpp/thread/ThreadTimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <commonpp/core/config.hpp>

#if not defined(HAVE_POSIX_CPU_CLOCK)
# error "Current platform cannot use the ThreadTimer"
#error "Current platform cannot use the ThreadTimer"
#endif

#include <boost/timer/timer.hpp>
Expand Down
3 changes: 3 additions & 0 deletions src/commonpp/thread/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include "commonpp/core/config.hpp"

// clang-format off

#if HAVE_HWLOC == 1
# include "detail/Cores.hpp"
#endif
Expand All @@ -28,6 +30,7 @@
#ifndef HAVE_THREAD_LOCAL_SPECIFIER
# include <boost/thread/tss.hpp>
#endif
// clang-format on

#include "commonpp/core/LoggingInterface.hpp"
#include "detail/logger.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/commonpp/thread/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
#include "commonpp/core/config.hpp"
#include "detail/logger.hpp"

// clang-format off
#if HAVE_HWLOC == 1
# include <hwloc.h>
# include "detail/Cores.hpp"
#endif
// clang-format on

namespace commonpp
{
Expand Down

0 comments on commit d4cbbee

Please sign in to comment.