use realpath to get the absolute pathname, fixes some forgotten cases, especially...
[lttv.git] / ltt / branches / poly / include / ltt / time.h
index dc0f8ecb67186a0af560c5c2e8a5ae4b4839536f..2cce27608baaf2aaecf5969cdb72efdb6caf7482 100644 (file)
@@ -1,3 +1,21 @@
+/* This file is part of the Linux Trace Toolkit trace reading library
+ * Copyright (C) 2003-2004 Michel Dagenais
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License Version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
 #ifndef LTT_TIME_H
 #define LTT_TIME_H
 
@@ -44,13 +62,14 @@ static inline LttTime ltt_time_add(LttTime t1, LttTime t2)
 static inline LttTime ltt_time_mul(LttTime t1, float f)
 {
   LttTime res;
-  float d = 1.0/f;
+  float d;
   double sec;
 
   if(f == 0.0){
     res.tv_sec = 0;
     res.tv_nsec = 0;
   }else{
+    d = 1.0/f;
     sec = t1.tv_sec / (double)d;
     res.tv_sec = sec;
     res.tv_nsec = t1.tv_nsec / (double)d + (sec - res.tv_sec) *
This page took 0.024337 seconds and 4 git commands to generate.