diff --git a/Extractor/XMLParser.h b/Extractor/XMLParser.h index 2d6f2e3be..eb1312680 100644 --- a/Extractor/XMLParser.h +++ b/Extractor/XMLParser.h @@ -67,9 +67,8 @@ public: if ( xmlStrEqual( currentName, ( const xmlChar* ) "node" ) == 1 ) { ImportNode n = _ReadXMLNode( ); /** Pass the unpacked node to the LUA call back **/ - int ret = -1; try { - ret = luabind::call_function( + luabind::call_function( myLuaState, "node_function", boost::ref(n) @@ -92,9 +91,8 @@ public: _Way way = _ReadXMLWay( ); /** Pass the unpacked way to the LUA call back **/ - int ret = -1; try { - ret = luabind::call_function( + luabind::call_function( myLuaState, "way_function", boost::ref(way), @@ -286,7 +284,7 @@ private: xmlChar* k = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "k" ); xmlChar* value = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "v" ); if ( k != NULL && value != NULL ) { - node.keyVals.Add(std::string( (char *) k ), std::string( (char *) value)); + node.keyVals.Add(std::string( reinterpret_cast(k) ), std::string( reinterpret_cast(value))); } if ( k != NULL ) xmlFree( k ); diff --git a/RoutingAlgorithms/AlternativePathRouting.h b/RoutingAlgorithms/AlternativePathRouting.h index c03d2104d..6ae0383ca 100644 --- a/RoutingAlgorithms/AlternativePathRouting.h +++ b/RoutingAlgorithms/AlternativePathRouting.h @@ -41,7 +41,7 @@ class AlternativeRouting : private BasicRoutingInterface{ NodeID node; int length; int sharing; - const bool operator<(const RankedCandidateNode& other) const { + bool operator<(const RankedCandidateNode& other) const { return (2*length + sharing) < (2*other.length + other.sharing); } }; @@ -121,7 +121,7 @@ public: BOOST_FOREACH(const PreselectedNode node, nodesThatPassPreselection) { int lengthOfViaPath = 0, sharingOfViaPath = 0; - computeLengthAndSharingOfViaPath(phantomNodePair, node, &lengthOfViaPath, &sharingOfViaPath, offset, packedShortestPath); + computeLengthAndSharingOfViaPath(node, &lengthOfViaPath, &sharingOfViaPath, offset, packedShortestPath); if(sharingOfViaPath <= VIAPATH_GAMMA*_upperBound) rankedCandidates.push_back(RankedCandidateNode(node.first, lengthOfViaPath, sharingOfViaPath)); } @@ -130,7 +130,7 @@ public: NodeID selectedViaNode = UINT_MAX; int lengthOfViaPath = INT_MAX; - NodeID s_v_middle, v_t_middle; + NodeID s_v_middle = UINT_MAX, v_t_middle = UINT_MAX; BOOST_FOREACH(const RankedCandidateNode candidate, rankedCandidates){ if(viaNodeCandidatePasses_T_Test(forwardHeap, backwardHeap, forwardHeap2, backwardHeap2, candidate, offset, _upperBound, &lengthOfViaPath, &s_v_middle, &v_t_middle)) { // select first admissable @@ -169,7 +169,7 @@ private: super::UnpackPath(packed_s_v_path, unpackedPath); } - inline void computeLengthAndSharingOfViaPath(const PhantomNodes & phantomNodePair, const PreselectedNode& node, int *lengthOfViaPath, int *sharingOfViaPath, + inline void computeLengthAndSharingOfViaPath(const PreselectedNode& node, int *lengthOfViaPath, int *sharingOfViaPath, const int offset, const std::deque & packedShortestPath) { //compute and unpack and by exploring search spaces from v and intersecting against queues //only half-searches have to be done at this stage