From: Mikko Rasa Date: Sun, 15 Jun 2014 08:42:41 +0000 (+0300) Subject: Avoid unsigned int overflow if total number of hosts exceeds the maximum X-Git-Url: http://git.tdb.fi/?p=netvis.git;a=commitdiff_plain;h=049518d751b3e2bada5af0bd1af63273e782775f Avoid unsigned int overflow if total number of hosts exceeds the maximum --- diff --git a/source/netvis.cpp b/source/netvis.cpp index 83dbd1a..7bb49bb 100644 --- a/source/netvis.cpp +++ b/source/netvis.cpp @@ -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(max_hosts-hosts.size()-disabled_hosts.size())); for(map::iterator i=disabled_hosts.begin(); i!=disabled_hosts.end();) { i->second->tick(dt);