summaryrefslogtreecommitdiff
path: root/src/benchmark.h
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2023-04-24 12:39:42 +0900
committerDaiki Ueno <ueno@gnu.org>2023-04-24 12:45:46 +0900
commitaa5950abab56b011331ad4331409b6ff8efb8aeb (patch)
treead363fb38e8b65c942876641cda9c76caa13b498 /src/benchmark.h
parent0fe9cb6842d63761718046cc7dd7eb437e6c5163 (diff)
downloadgnutls-aa5950abab56b011331ad4331409b6ff8efb8aeb.tar.gz
build: re-indent code
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'src/benchmark.h')
-rw-r--r--src/benchmark.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/benchmark.h b/src/benchmark.h
index af9bc3a4c8..cb5ddaafcc 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -18,22 +18,22 @@
*/
#ifndef GNUTLS_SRC_BENCHMARK_H
-# define GNUTLS_SRC_BENCHMARK_H
+#define GNUTLS_SRC_BENCHMARK_H
-# include <sys/time.h>
-# include <time.h>
-# include <signal.h>
-# if defined(_WIN32)
-# include <windows.h>
-# endif
+#include <sys/time.h>
+#include <time.h>
+#include <signal.h>
+#if defined(_WIN32)
+#include <windows.h>
+#endif
/* for uint64_t */
-# include <stdint.h>
+#include <stdint.h>
-# if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
-# undef gettime
-# define gettime(x) clock_gettime(CLOCK_PROCESS_CPUTIME_ID, x)
-# else
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
+#undef gettime
+#define gettime(x) clock_gettime(CLOCK_PROCESS_CPUTIME_ID, x)
+#else
inline static void gettime(struct timespec *ts)
{
struct timeval tv;
@@ -41,7 +41,7 @@ inline static void gettime(struct timespec *ts)
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
}
-# endif
+#endif
typedef void (*sighandler_t)(int);
@@ -52,11 +52,11 @@ struct benchmark_st {
struct timespec start;
uint64_t size;
sighandler_t old_handler;
-# if defined(_WIN32)
+#if defined(_WIN32)
HANDLE wtimer;
HANDLE wthread;
LARGE_INTEGER alarm_timeout;
-# endif
+#endif
};
extern volatile int benchmark_must_finish;
@@ -64,17 +64,17 @@ extern volatile int benchmark_must_finish;
void start_benchmark(struct benchmark_st *st);
double stop_benchmark(struct benchmark_st *st, const char *metric, int quiet);
-inline static unsigned int
-timespec_sub_ms(struct timespec *a, struct timespec *b)
+inline static unsigned int timespec_sub_ms(struct timespec *a,
+ struct timespec *b)
{
- return (a->tv_sec - b->tv_sec) * 1000 + (a->tv_nsec -
- b->tv_nsec) / (1000 * 1000);
+ return (a->tv_sec - b->tv_sec) * 1000 +
+ (a->tv_nsec - b->tv_nsec) / (1000 * 1000);
}
-inline static unsigned long
-timespec_sub_ns(struct timespec *a, struct timespec *b)
+inline static unsigned long timespec_sub_ns(struct timespec *a,
+ struct timespec *b)
{
return (a->tv_sec - b->tv_sec) * 1000000000 + (a->tv_nsec - b->tv_nsec);
}
-#endif /* GNUTLS_SRC_BENCHMARK_H */
+#endif /* GNUTLS_SRC_BENCHMARK_H */