From a1ccea0ce0d6b372dcfe6e05e59b42290b4d5e82 Mon Sep 17 00:00:00 2001
From: thomasl <thomasl@eurecom.fr>
Date: Wed, 19 Nov 2014 09:15:28 +0000
Subject: [PATCH] fix compilation warning and printf of  char % not correct
 (should be %%)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6038 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair1/PHY/TOOLS/time_meas.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/openair1/PHY/TOOLS/time_meas.c b/openair1/PHY/TOOLS/time_meas.c
index 93bbe9aae25..36bea7c9fb6 100644
--- a/openair1/PHY/TOOLS/time_meas.c
+++ b/openair1/PHY/TOOLS/time_meas.c
@@ -25,7 +25,7 @@
   
   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
 
- *******************************************************************************/
+*******************************************************************************/
 #include <stdio.h>
 #include "time_meas.h"
 #include <math.h>
@@ -34,15 +34,15 @@
 // global var for openair performance profiler 
 int opp_enabled = 0;
 /*
-double get_cpu_freq_GHz(void) {
+  double get_cpu_freq_GHz(void) {
   
-    time_stats_t ts;
-    reset_meas(&ts);
-    start_meas(&ts);
-    sleep(1);
-    stop_meas(&ts);
-    return (double)ts.diff/1000000000;
-}*/
+  time_stats_t ts;
+  reset_meas(&ts);
+  start_meas(&ts);
+  sleep(1);
+  stop_meas(&ts);
+  return (double)ts.diff/1000000000;
+  }*/
 
 void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time){
 
@@ -55,13 +55,13 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
       cpu_freq_GHz = get_cpu_freq_GHz();
     
     if (first_time == 0) {
-      first_time=1;
+    first_time=1;
       fprintf(stderr, "%25s  %25s  %25s  %20s %15s %6f\n","Name","Total","Average/Frame","Trials","CPU_F_GHz", cpu_freq_GHz);
     }
     if (ts->trials>0) {
       //printf("%20s: total: %10.3f ms, average: %10.3f us (%10d trials)\n", name, ts->diff/cpu_freq_GHz/1000000.0, ts->diff/ts->trials/cpu_freq_GHz/1000.0, ts->trials);
      
-      fprintf(stderr, "%25s:  %15.3f ms (%5.2f%); %15.3f us (%5.2f%); %15d;\n", 
+      fprintf(stderr, "%25s:  %15.3f ms (%5.2f%%); %15.3f us (%5.2f%%); %15d;\n", 
 	      name, 
 	      (ts->diff/cpu_freq_GHz/1000000.0), 
 	      ((ts->diff/cpu_freq_GHz/1000000.0)/(total_exec_time->diff/cpu_freq_GHz/1000000.0))*100,  // percentage 
@@ -75,12 +75,12 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
 
 double get_time_meas_us(time_stats_t *ts){
 
- static double cpu_freq_GHz = 0.0;
+  static double cpu_freq_GHz = 0.0;
     
- if (cpu_freq_GHz == 0.0)
-   cpu_freq_GHz = get_cpu_freq_GHz();
+  if (cpu_freq_GHz == 0.0)
+    cpu_freq_GHz = get_cpu_freq_GHz();
    
- if (ts->trials>0) 
-   return  (ts->diff/ts->trials/cpu_freq_GHz/1000.0);
- 
+  if (ts->trials>0) 
+    return  (ts->diff/ts->trials/cpu_freq_GHz/1000.0);
+  return 0;
 }
-- 
GitLab