From: Arnaud Giersch Date: Wed, 10 Oct 2012 09:08:40 +0000 (+0200) Subject: An inline declaration without definition does not make sense. X-Git-Tag: v3_8~92^2~8 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4029ae3f92593d678e8f4c116dca41167760f963?hp=e027d8fca6972da210a3444579e92014a79f57d4 An inline declaration without definition does not make sense. --- 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);