aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/util/time.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/util/time.c')
-rw-r--r--src/util/time.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/util/time.c b/src/util/time.c
index f4d4c4070..34880b08b 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -145,9 +145,8 @@ GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel)
145 * @return timestamp that is smaller 145 * @return timestamp that is smaller
146 */ 146 */
147struct GNUNET_TIME_Relative 147struct GNUNET_TIME_Relative
148GNUNET_TIME_relative_min (struct 148GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1,
149 GNUNET_TIME_Relative 149 struct GNUNET_TIME_Relative t2)
150 t1, struct GNUNET_TIME_Relative t2)
151{ 150{
152 return (t1.rel_value < t2.rel_value) ? t1 : t2; 151 return (t1.rel_value < t2.rel_value) ? t1 : t2;
153} 152}
@@ -161,9 +160,8 @@ GNUNET_TIME_relative_min (struct
161 * @return timestamp that is larger 160 * @return timestamp that is larger
162 */ 161 */
163struct GNUNET_TIME_Relative 162struct GNUNET_TIME_Relative
164GNUNET_TIME_relative_max (struct 163GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1,
165 GNUNET_TIME_Relative 164 struct GNUNET_TIME_Relative t2)
166 t1, struct GNUNET_TIME_Relative t2)
167{ 165{
168 return (t1.rel_value > t2.rel_value) ? t1 : t2; 166 return (t1.rel_value > t2.rel_value) ? t1 : t2;
169} 167}
@@ -178,9 +176,8 @@ GNUNET_TIME_relative_max (struct
178 * @return timestamp that is smaller 176 * @return timestamp that is smaller
179 */ 177 */
180struct GNUNET_TIME_Absolute 178struct GNUNET_TIME_Absolute
181GNUNET_TIME_absolute_min (struct 179GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1,
182 GNUNET_TIME_Absolute 180 struct GNUNET_TIME_Absolute t2)
183 t1, struct GNUNET_TIME_Absolute t2)
184{ 181{
185 return (t1.abs_value < t2.abs_value) ? t1 : t2; 182 return (t1.abs_value < t2.abs_value) ? t1 : t2;
186} 183}
@@ -194,9 +191,8 @@ GNUNET_TIME_absolute_min (struct
194 * @return timestamp that is smaller 191 * @return timestamp that is smaller
195 */ 192 */
196struct GNUNET_TIME_Absolute 193struct GNUNET_TIME_Absolute
197GNUNET_TIME_absolute_max (struct 194GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1,
198 GNUNET_TIME_Absolute 195 struct GNUNET_TIME_Absolute t2)
199 t1, struct GNUNET_TIME_Absolute t2)
200{ 196{
201 return (t1.abs_value > t2.abs_value) ? t1 : t2; 197 return (t1.abs_value > t2.abs_value) ? t1 : t2;
202} 198}
@@ -298,9 +294,8 @@ GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start,
298 * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise 294 * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise
299 */ 295 */
300struct GNUNET_TIME_Absolute 296struct GNUNET_TIME_Absolute
301GNUNET_TIME_absolute_subtract (struct 297GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
302 GNUNET_TIME_Absolute 298 struct GNUNET_TIME_Relative duration)
303 start, struct GNUNET_TIME_Relative duration)
304{ 299{
305 struct GNUNET_TIME_Absolute ret; 300 struct GNUNET_TIME_Absolute ret;
306 301
@@ -368,8 +363,8 @@ GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
368 * assuming it continues at the same speed 363 * assuming it continues at the same speed
369 */ 364 */
370struct GNUNET_TIME_Relative 365struct GNUNET_TIME_Relative
371GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, 366GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, uint64_t finished,
372 uint64_t finished, uint64_t total) 367 uint64_t total)
373{ 368{
374 struct GNUNET_TIME_Relative dur; 369 struct GNUNET_TIME_Relative dur;
375 double exp; 370 double exp;