Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
An inline declaration without definition does not make sense.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 10 Oct 2012 09:08:40 +0000 (11:08 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 10 Oct 2012 09:08:40 +0000 (11:08 +0200)
examples/smpi/MM/timer.c
examples/smpi/MM/timer.h

index a647f98..692e8fa 100644 (file)
 #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;
index bb45687..c8f648a 100644 (file)
@@ -6,11 +6,20 @@
  */
 # include <sys/time.h>
 
-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);