From 4029ae3f92593d678e8f4c116dca41167760f963 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 10 Oct 2012 11:08:40 +0200 Subject: [PATCH 1/1] An inline declaration without definition does not make sense. --- examples/smpi/MM/timer.c | 12 +----------- examples/smpi/MM/timer.h | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/smpi/MM/timer.c b/examples/smpi/MM/timer.c index a647f98712..692e8fa943 100644 --- a/examples/smpi/MM/timer.c +++ b/examples/smpi/MM/timer.c @@ -11,17 +11,7 @@ #define CLOCK_TIMER CLOCK_MONOTONIC_RAW */ -inline double get_microsecond(struct timespec *res){ - return (res->tv_sec*1000000 + res->tv_nsec/1000); -} -inline double get_nanosecond(struct timespec *res){ - return (res->tv_sec*1000000000 + res->tv_nsec); -} -inline double get_second(struct timespec *res){ - return (res->tv_sec + res->tv_nsec/1000000000); -} - -inline int get_time(struct timespec *tp){ +int get_time(struct timespec *tp){ double time = MPI_Wtime(); time_t value = (time_t)floor(time); time -= (double) value; diff --git a/examples/smpi/MM/timer.h b/examples/smpi/MM/timer.h index bb4568714d..c8f648ad2c 100644 --- a/examples/smpi/MM/timer.h +++ b/examples/smpi/MM/timer.h @@ -6,11 +6,20 @@ */ # include -inline double get_second(struct timespec *res); -inline double get_microsecond(struct timespec *res); -inline double get_nanosecond(struct timespec *res); +static inline double get_microsecond(struct timespec *res) +{ + return (res->tv_sec*1000000 + res->tv_nsec/1000); +} +static inline double get_nanosecond(struct timespec *res) +{ + return (res->tv_sec*1000000000 + res->tv_nsec); +} +static inline double get_second(struct timespec *res) +{ + return (res->tv_sec + res->tv_nsec/1000000000); +} int get_time(struct timespec *tp); double get_timediff(struct timespec *start, struct timespec * end); -- 2.20.1