]> git.tdb.fi Git - netvis.git/blobdiff - source/netvis.cpp
Avoid unsigned int overflow if total number of hosts exceeds the maximum
[netvis.git] / source / netvis.cpp
index 83dbd1a78d53933bef55d1948fef43dc9024d3e0..7bb49bb458e507cb52d3f33cfcd17872f3537142 100644 (file)
@@ -126,7 +126,7 @@ void NetVis::tick()
                i->second->tick(dt);
                min_activity = min(min_activity, i->second->get_activity());
        }
-       float del_limit = pow(10, 6-0.1*(max_hosts-hosts.size()-disabled_hosts.size()));
+       float del_limit = pow(10, 6-0.1*static_cast<int>(max_hosts-hosts.size()-disabled_hosts.size()));
        for(map<unsigned, Host *>::iterator i=disabled_hosts.begin(); i!=disabled_hosts.end();)
        {
                i->second->tick(dt);