+/* 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
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) *