mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Use casts or intermediate variables to remove a number
of platform/compiler-dependent warnings when handing struct timeval fields, both reading and printing them. It is a lost battle to handle the different ways struct timeval is handled on the various platforms and compilers, so try to be pragmatic and go through int/long which are universally supported. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1202,12 +1202,12 @@ static struct timeval tvfix(struct timeval a)
|
||||
{
|
||||
if (a.tv_usec >= ONE_MILLION) {
|
||||
ast_log(LOG_WARNING, "warning too large timestamp %ld.%ld\n",
|
||||
a.tv_sec, (long int) a.tv_usec);
|
||||
(long)a.tv_sec, (long int) a.tv_usec);
|
||||
a.tv_sec += a.tv_usec / ONE_MILLION;
|
||||
a.tv_usec %= ONE_MILLION;
|
||||
} else if (a.tv_usec < 0) {
|
||||
ast_log(LOG_WARNING, "warning negative timestamp %ld.%ld\n",
|
||||
a.tv_sec, (long int) a.tv_usec);
|
||||
(long)a.tv_sec, (long int) a.tv_usec);
|
||||
a.tv_usec = 0;
|
||||
}
|
||||
return a;
|
||||
|
Reference in New Issue
Block a user