another msvc-7.1 fix

This commit is contained in:
Arvid Norberg 2014-03-25 04:13:58 +00:00
parent 87a05814e5
commit f3535b1e69
1 changed files with 5 additions and 5 deletions

View File

@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <fstream> #include <fstream>
#include <deque> #include <deque>
#include <map>
#include "setup_transfer.hpp" #include "setup_transfer.hpp"
@ -417,17 +418,17 @@ int start_proxy(int proxy_type)
{ {
using namespace libtorrent; using namespace libtorrent;
for (std::map<int, proxy_t>::iterator i = running_proxies.begin() std::map<int, proxy_t> :: iterator i = running_proxies.begin();
, end(running_proxies.end()); i != end; ++i) for (; i != running_proxies.end(); ++i)
{ {
if (i->second.type == proxy_type) return i->first; if (i->second.type == proxy_type) { return i->first; }
} }
unsigned int seed = total_microseconds(time_now_hires() - min_time()) & 0xffffffff; unsigned int seed = total_microseconds(time_now_hires() - min_time()) & 0xffffffff;
printf("random seed: %u\n", seed); printf("random seed: %u\n", seed);
std::srand(seed); std::srand(seed);
int port = 5000 + (rand() % 55000);
int port = 5000 + (rand() % 55000);
char const* type = ""; char const* type = "";
char const* auth = ""; char const* auth = "";
char const* cmd = ""; char const* cmd = "";
@ -458,7 +459,6 @@ int start_proxy(int proxy_type)
cmd = "python ../http.py"; cmd = "python ../http.py";
break; break;
} }
char buf[512]; char buf[512];
snprintf(buf, sizeof(buf), "%s --port %d%s", cmd, port, auth); snprintf(buf, sizeof(buf), "%s --port %d%s", cmd, port, auth);