Fix build warnings when printf a tv_usec.
authorDavid M. Lee <dlee@digium.com>
Tue, 13 Aug 2013 14:57:34 +0000 (14:57 +0000)
committerDavid M. Lee <dlee@digium.com>
Tue, 13 Aug 2013 14:57:34 +0000 (14:57 +0000)
The debug logs added in r396528 neglected to account for suseconds_t
being an int.

See r392076 for more info.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396559 65c4cc65-6c06-0410-ace0-fbb531ad65f3

tests/test_hashtab_thrash.c

index a0eacef..d547862 100644 (file)
@@ -66,9 +66,10 @@ static int is_timed_out(struct hash_test const *data) {
        struct timeval now = ast_tvnow();
        int val = ast_tvdiff_us(data->deadline, now) < 0;
        if (val) {
+               /* tv_usec is suseconds_t, which could be int or long */
                ast_test_status_update(data->test, "Now: %ld.%06ld Deadline: %ld.%06ld\n",
                        now.tv_sec, now.tv_usec,
-                       data->deadline.tv_sec, data->deadline.tv_usec);
+                       data->deadline.tv_sec, (long)data->deadline.tv_usec);
        }
        return val;
 }