From 0a7a7e395b2fd1e8ccfc8e9f70e6870feae69609 Mon Sep 17 00:00:00 2001 From: tudor Date: Tue, 18 Oct 2016 15:56:40 +0000 Subject: [PATCH] Scan iterator fix for compilation under Visual Studio 2010 --- scan_engine.cc | 20 ++++++++++---------- scan_engine.h | 2 +- scan_engine_connect.cc | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scan_engine.cc b/scan_engine.cc index e6f859e7a..cdb586548 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -760,7 +760,7 @@ UltraScanInfo::UltraScanInfo() { } UltraScanInfo::~UltraScanInfo() { - std::multiset::iterator hostI; + std::multiset::iterator hostI; for (hostI = incompleteHosts.begin(); hostI != incompleteHosts.end(); hostI++) { delete *hostI; @@ -819,7 +819,7 @@ HostScanStats *UltraScanInfo::nextIncompleteHost() { /* Return a number between 0.0 and 1.0 inclusive indicating how much of the scan is done. */ double UltraScanInfo::getCompletionFraction() { - std::multiset::iterator hostI; + std::multiset::iterator hostI; double total; /* Add 1 for each completed host. */ @@ -1076,7 +1076,7 @@ unsigned int UltraScanInfo::numProbesPerHost() { bool UltraScanInfo::sendOK(struct timeval *when) { struct timeval lowhtime = {0}; struct timeval tmptv; - std::multiset::iterator host; + std::multiset::iterator host; bool ggood = false; bool thisHostGood = false; bool foundgood = false; @@ -1134,7 +1134,7 @@ bool UltraScanInfo::sendOK(struct timeval *when) { /* Find a HostScanStats by its IP address in the incomplete and completed lists. Returns NULL if none are found. */ HostScanStats *UltraScanInfo::findHost(struct sockaddr_storage *ss) { - std::multiset::iterator hss; + std::multiset::iterator hss; HssPredicate::ss = ss; HostScanStats *fakeHss = NULL; @@ -1160,7 +1160,7 @@ HostScanStats *UltraScanInfo::findHost(struct sockaddr_storage *ss) { is here to replace numIncompleteHosts() < n, which would have to walk through the entire list. */ bool UltraScanInfo::numIncompleteHostsLessThan(unsigned int n) { - std::multiset::iterator hostI; + std::multiset::iterator hostI; unsigned int count; count = 0; @@ -1180,7 +1180,7 @@ static bool pingprobe_is_better(const probespec *new_probe, int new_state, list, and remove any hosts from completedHosts which have exceeded their lifetime. Returns the number of hosts removed. */ int UltraScanInfo::removeCompletedHosts() { - std::multiset::iterator hostI, nxt; + std::multiset::iterator hostI, nxt; HostScanStats *hss = NULL; int hostsRemoved = 0; bool timedout = false; @@ -2290,7 +2290,7 @@ static void sendGlobalPingProbe(UltraScanInfo *USI) { } static void doAnyPings(UltraScanInfo *USI) { - std::multiset::iterator hostI; + std::multiset::iterator hostI; HostScanStats *hss = NULL; gettimeofday(&USI->now, NULL); @@ -2365,7 +2365,7 @@ static void retransmitProbe(UltraScanInfo *USI, HostScanStats *hss, /* Go through the ProbeQueue of each host, identify any timed out probes, then try to retransmit them as appropriate */ static void doAnyOutstandingRetransmits(UltraScanInfo *USI) { - std::multiset::iterator hostI; + std::multiset::iterator hostI; std::list::iterator probeI; /* A cache of the last processed probe from each host, to avoid re-examining a bunch of probes to find the next one that needs to be retransmitted. */ @@ -2445,7 +2445,7 @@ static void doAnyOutstandingRetransmits(UltraScanInfo *USI) { /* Print occasional remaining time estimates, as well as debugging information */ static void printAnyStats(UltraScanInfo *USI) { - std::multiset::iterator hostI; + std::multiset::iterator hostI; HostScanStats *hss; struct ultra_timing_vals hosttm; @@ -2515,7 +2515,7 @@ static void waitForResponses(UltraScanInfo *USI) { /* Go through the data structures, making appropriate changes (such as expiring probes, noting when hosts are complete, etc. */ static void processData(UltraScanInfo *USI) { - std::multiset::iterator hostI; + std::multiset::iterator hostI; std::list::iterator probeI, nextProbeI; HostScanStats *host = NULL; UltraProbe *probe = NULL; diff --git a/scan_engine.h b/scan_engine.h index 302cacabe..2dd76c174 100644 --- a/scan_engine.h +++ b/scan_engine.h @@ -759,7 +759,7 @@ public: private: unsigned int numInitialTargets; - std::multiset::iterator nextI; + std::multiset::iterator nextI; }; diff --git a/scan_engine_connect.cc b/scan_engine_connect.cc index ae3c80c9b..eec6a3e71 100644 --- a/scan_engine_connect.cc +++ b/scan_engine_connect.cc @@ -491,7 +491,7 @@ bool do_one_select_round(UltraScanInfo *USI, struct timeval *stime) { int timeleft; ConnectScanInfo *CSI = USI->gstats->CSI; int sd; - std::multiset::iterator hostI; + std::multiset::iterator hostI; HostScanStats *host; UltraProbe *probe = NULL; int optval; @@ -532,7 +532,7 @@ bool do_one_select_round(UltraScanInfo *USI, struct timeval *stime) { and find the relevant ones. Note the peculiar structure of the loop--we iterate through both incompleteHosts and completedHosts, because global timing pings are sent to hosts in completedHosts. */ - std::multiset::iterator incompleteHostI, completedHostI; + std::multiset::iterator incompleteHostI, completedHostI; incompleteHostI = USI->incompleteHosts.begin(); completedHostI = USI->completedHosts.begin(); while ((incompleteHostI != USI->incompleteHosts.end()