]> git.sur5r.net Git - bacula/bacula/commitdiff
Make double to int64_t conversion explicit to avoid compiler warning
authorKern Sibbald <kern@sibbald.com>
Sun, 28 Nov 2010 11:11:43 +0000 (12:11 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 1 Dec 2010 09:10:21 +0000 (10:10 +0100)
bacula/src/lib/bsock.c

index 9a8d03cf5f1013f4563842b17e53513125d8a454..22b4155ddcb874ca2d8623ae700ff9f528e09ed2 100644 (file)
@@ -1083,14 +1083,14 @@ void BSOCK::control_bwlimit(int bytes)
    }
 
    /* Remove what was authorised to be written in temp us */
-   m_nb_bytes -= temp * ((double)m_bwlimit / 1000000.0);
+   m_nb_bytes -= (int64_t)(temp * ((double)m_bwlimit / 1000000.0));
 
    if (m_nb_bytes < 0) {
       m_nb_bytes = 0;
    }
 
    /* What exceed should be converted in sleep time */
-   int64_t usec_sleep = m_nb_bytes / ((double)m_bwlimit / 1000000.0);
+   int64_t usec_sleep = m_nb_bytes / (int64_t)((double)m_bwlimit / 1000000.0);
    if (usec_sleep > 100) {
       bmicrosleep(0, usec_sleep);
       m_last_tick = get_current_btime();