From 66a7786c29036a966ebc935b2cb69991276d90ed Mon Sep 17 00:00:00 2001 From: brarcher Date: Sat, 25 Jan 2014 18:18:05 +0000 Subject: [PATCH] Changing duration returned from DIFF_IN_USEC to unsigned long In the case that the diff returned from the start and end of the test overflowed an unsigned int, making the container for the result an unsigned long. (This is the type returned from the macro anyway). git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1060 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- src/check_log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/check_log.c b/src/check_log.c index 2439ac7..35459c4 100644 --- a/src/check_log.c +++ b/src/check_log.c @@ -274,12 +274,12 @@ void xml_lfun (SRunner *sr CK_ATTRIBUTE_UNUSED, FILE *file, enum print_output pr case CLENDLOG_SR: { struct timespec ts_end = {0,0}; - unsigned int duration; + unsigned long duration; /* calculate time the test were running */ clock_gettime(check_get_clockid(), &ts_end); - duration = DIFF_IN_USEC(ts_start, ts_end); - fprintf(file, " %u.%06u\n", + duration = (unsigned long)DIFF_IN_USEC(ts_start, ts_end); + fprintf(file, " %lu.%06lu\n", duration / US_PER_SEC, duration % US_PER_SEC); fprintf(file, "\n"); } -- 2.40.0