projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed trailing whitespace.
[synfig.git]
/
ETL
/
trunk
/
ETL
/
_clock_gettimeofday.h
diff --git
a/ETL/trunk/ETL/_clock_gettimeofday.h
b/ETL/trunk/ETL/_clock_gettimeofday.h
index
8626c73
..
525aac8
100644
(file)
--- a/
ETL/trunk/ETL/_clock_gettimeofday.h
+++ b/
ETL/trunk/ETL/_clock_gettimeofday.h
@@
-66,17
+66,17
@@
protected:
{
timestamp(int sec, int usec)
{ tv_sec=sec; tv_usec=usec; }
{
timestamp(int sec, int usec)
{ tv_sec=sec; tv_usec=usec; }
-
- friend class clock_desc_gettimeofday;
+
+ friend class clock_desc_gettimeofday;
public:
timestamp() { }
public:
timestamp() { }
-
-
+
+
inline timestamp operator-(const timestamp &rhs)const
{
timestamp ret;
ret.tv_usec=tv_usec-rhs.tv_usec;
inline timestamp operator-(const timestamp &rhs)const
{
timestamp ret;
ret.tv_usec=tv_usec-rhs.tv_usec;
-
+
if(ret.tv_usec<0)
{
ret.tv_sec=tv_sec-rhs.tv_sec-1;
if(ret.tv_usec<0)
{
ret.tv_sec=tv_sec-rhs.tv_sec-1;
@@
-87,10
+87,10
@@
protected:
return ret;
}
return ret;
}
- inline timestamp
&
operator+(timestamp rhs)const
+ inline timestamp operator+(timestamp rhs)const
{
rhs.tv_usec+=tv_usec;
{
rhs.tv_usec+=tv_usec;
-
+
if(rhs.tv_usec>1000000)
{
rhs.tv_sec+=tv_sec+1;
if(rhs.tv_usec>1000000)
{
rhs.tv_sec+=tv_sec+1;
@@
-100,7
+100,7
@@
protected:
rhs.tv_sec+=tv_sec;
return rhs;
}
rhs.tv_sec+=tv_sec;
return rhs;
}
-
+
inline bool operator<(const timestamp &rhs)const
{ return tv_sec<rhs.tv_sec || tv_usec<rhs.tv_usec; }
inline bool operator<(const timestamp &rhs)const
{ return tv_sec<rhs.tv_sec || tv_usec<rhs.tv_usec; }
@@
-110,7
+110,7
@@
protected:
inline bool operator!=(const timestamp &rhs)const
{ return tv_usec!=rhs.tv_usec || tv_sec!=rhs.tv_sec; }
};
inline bool operator!=(const timestamp &rhs)const
{ return tv_usec!=rhs.tv_usec || tv_sec!=rhs.tv_sec; }
};
-
+
static void
get_current_time(timestamp &x)
{ gettimeofday(&x,NULL);}
static void
get_current_time(timestamp &x)
{ gettimeofday(&x,NULL);}
@@
-118,14
+118,14
@@
protected:
static timestamp
get_current_time()
{ timestamp ret; get_current_time(ret); return ret; }
static timestamp
get_current_time()
{ timestamp ret; get_current_time(ret); return ret; }
-
+
static value_type
timestamp_to_seconds(const timestamp &x)
static value_type
timestamp_to_seconds(const timestamp &x)
- { return (value_type)x.tv_sec + precision()*x.tv_usec; }
+ { return (value_type)x.tv_sec + precision()*x.tv_usec; }
static timestamp
seconds_to_timestamp(const value_type &x)
static timestamp
seconds_to_timestamp(const value_type &x)
- { return timestamp((int)floor(x), (int)((x-floor(x))/precision()+0.5)); }
+ { return timestamp((int)floor(x), (int)((x-floor(x))/precision()+0.5)); }
};
_ETL_END_NAMESPACE
};
_ETL_END_NAMESPACE