diff options
author | OBATA Akio <obache@wizdas.com> | 2019-04-09 18:49:43 +0900 |
---|---|---|
committer | TDE Gitea <gitea@mirror.git.trinitydesktop.org> | 2019-04-11 15:47:12 +0000 |
commit | 9b8b7c129917f2813e5f412fe08b6a153ca05981 (patch) | |
tree | 41bf39dc8ddf808fc5b97287dd946353603eaf35 /kscd | |
parent | a2b21b9cf6125f091d83cd99c91d57fa77f1c917 (diff) | |
download | tdemultimedia-9b8b7c129917f2813e5f412fe08b6a153ca05981.tar.gz tdemultimedia-9b8b7c129917f2813e5f412fe08b6a153ca05981.zip |
Fix for time_t != long
`time_t` may not be `long`, for examples, unsigned (long) int,
long long int (64bit integer type on 32bit arch), double, and so on.
Change to use difftime(3) to retrieve seconds.
Signed-off-by: OBATA Akio <obache@wizdas.com>
Diffstat (limited to 'kscd')
-rw-r--r-- | kscd/libwm/database.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kscd/libwm/database.c b/kscd/libwm/database.c index 62d66a32..d9b17d79 100644 --- a/kscd/libwm/database.c +++ b/kscd/libwm/database.c @@ -1107,11 +1107,11 @@ load( void ) /* This is some kind of profiling code. I don't change it to wm_lib_message() for now... */ #ifndef NDEBUG - long t1, t2; + time_t t1, t2; if( getenv( "WORKMAN_DEBUG" ) != NULL ) { time(&t1); - printf("%s (%d): search start = %ld\n", __FILE__, __LINE__, t1); + printf("%s (%d): search start = %.0f\n", __FILE__, __LINE__, difftime(t1, (time_t)0)); fflush(stdout); } #endif @@ -1158,7 +1158,7 @@ load( void ) if( getenv( "WORKMAN_DEBUG" ) != NULL ) { time(&t2); - printf("%s (%d): db search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1); + printf("%s (%d): db search end = %.0f, elapsed = %.0f\n", __FILE__, __LINE__, difftime(t2, (time_t)0), difftime(t2, t1)); fflush(stdout); } #endif @@ -1192,7 +1192,7 @@ load( void ) if( getenv( "WORKMAN_DEBUG" ) != NULL ) { time(&t2); - printf("%s (%d): search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1); + printf("%s (%d): search end = %.0f, elapsed = %.0f\n", __FILE__, __LINE__, difftime(t2, (time_t)0), difftime(t2, t1)); fflush(stdout); } #endif |