From b0ae5d16c993045fd9ec5e7866962164bf9934fd Mon Sep 17 00:00:00 2001 From: Martin Baute Date: Mon, 4 Apr 2016 07:17:14 +0200 Subject: [PATCH] difftime.c --- functions/time/difftime.c | 2 +- platform/example/internals/_PDCLIB_config.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/time/difftime.c b/functions/time/difftime.c index d2dcfac..fa6eb9c 100644 --- a/functions/time/difftime.c +++ b/functions/time/difftime.c @@ -10,7 +10,7 @@ double difftime( time_t time1, time_t time0 ) { - return 0.0; + return ( time1 > time0 ) ? (double)( time1 - time0 ) : -(double)( time0 - time1 ); } #endif diff --git a/platform/example/internals/_PDCLIB_config.h b/platform/example/internals/_PDCLIB_config.h index 4dd5e3a..41fe9e0 100755 --- a/platform/example/internals/_PDCLIB_config.h +++ b/platform/example/internals/_PDCLIB_config.h @@ -174,6 +174,9 @@ struct _PDCLIB_imaxdiv_t /* Time types */ /* -------------------------------------------------------------------------- */ +/* See for a couple of comments on these types and their semantics. */ + +/* If you change this type to something exotic, check time/difftime.c */ #define _PDCLIB_time long #define _PDCLIB_clock long -- 2.40.0