diff --git a/Algorithms/ObjectToBase64.h b/Algorithms/ObjectToBase64.h index fab161b21..8d69c0a8a 100644 --- a/Algorithms/ObjectToBase64.h +++ b/Algorithms/ObjectToBase64.h @@ -33,12 +33,12 @@ or see http://www.gnu.org/licenses/agpl.txt. typedef boost::archive::iterators::base64_from_binary< - boost::archive::iterators::transform_width + boost::archive::iterators::transform_width > base64_t; typedef boost::archive::iterators::transform_width< - boost::archive::iterators::binary_from_base64, 8, 6 + boost::archive::iterators::binary_from_base64, 8, 6 > binary_t; template @@ -54,7 +54,7 @@ static void EncodeObjectToBase64(const ToEncodeT & object, std::string& encoded) template static void DecodeObjectFromBase64(ToEncodeT & object, const std::string& _encoded) { try { - string encoded(_encoded); + std::string encoded(_encoded); //replace "-" with "+" and "_" with "/" replaceAll(encoded, "-", "+"); replaceAll(encoded, "_", "/"); diff --git a/DataStructures/InputReaderFactory.h b/DataStructures/InputReaderFactory.h index 552eb7370..f58232f79 100644 --- a/DataStructures/InputReaderFactory.h +++ b/DataStructures/InputReaderFactory.h @@ -43,21 +43,21 @@ int readFromBz2Stream( void* pointer, char* buffer, int len ) { return read; } else if(BZ_STREAM_END == context->error) { BZ2_bzReadGetUnused(&context->error, context->bz2, &unusedTmpVoid, &context->nUnused); - if(BZ_OK != context->error) { cerr << "Could not BZ2_bzReadGetUnused" << endl; exit(-1);}; + if(BZ_OK != context->error) {std::cerr << "Could not BZ2_bzReadGetUnused" <nUnused;i++) { context->unused[i] = unusedTmp[i]; } BZ2_bzReadClose(&context->error, context->bz2); - if(BZ_OK != context->error) { cerr << "Could not BZ2_bzReadClose" << endl; exit(-1);}; + if(BZ_OK != context->error) {std::cerr << "Could not BZ2_bzReadClose" <error = BZ_STREAM_END; // set to the stream end for next call to this function if(0 == context->nUnused && feof(context->file)) { return read; } else { context->bz2 = BZ2_bzReadOpen(&context->error, context->file, 0, 0, context->unused, context->nUnused); - if(NULL == context->bz2){ cerr << "Could not open file" << endl; exit(-1);}; + if(NULL == context->bz2){std::cerr << "Could not open file" <error = false; diff --git a/DataStructures/SearchEngine.h b/DataStructures/SearchEngine.h index d0cf25191..bd3e42005 100644 --- a/DataStructures/SearchEngine.h +++ b/DataStructures/SearchEngine.h @@ -48,10 +48,10 @@ template struct SearchEngineData { typedef SearchEngineHeapPtr HeapPtr; typedef GraphT Graph; - SearchEngineData(GraphT * g, NodeInformationHelpDesk * nh, std::vector & n) :graph(g), nodeHelpDesk(nh), names(n) {} + SearchEngineData(GraphT * g, NodeInformationHelpDesk * nh, std::vector & n) :graph(g), nodeHelpDesk(nh), names(n) {} const GraphT * graph; NodeInformationHelpDesk * nodeHelpDesk; - std::vector & names; + std::vector & names; static HeapPtr forwardHeap; static HeapPtr backwardHeap; static HeapPtr forwardHeap2; @@ -113,7 +113,7 @@ public: ShortestPathRouting shortestPath; AlternativeRouting alternativePaths; - SearchEngine(GraphT * g, NodeInformationHelpDesk * nh, std::vector & n) : + SearchEngine(GraphT * g, NodeInformationHelpDesk * nh, std::vector & n) : _queryData(g, nh, n), shortestPath(_queryData), alternativePaths(_queryData) diff --git a/Extractor/ExtractorCallbacks.cpp b/Extractor/ExtractorCallbacks.cpp index 5423d8970..3db1d8d8b 100644 --- a/Extractor/ExtractorCallbacks.cpp +++ b/Extractor/ExtractorCallbacks.cpp @@ -92,7 +92,7 @@ bool ExtractorCallbacks::wayFunction(_Way &w) { std::reverse( w.path.begin(), w.path.end() ); } - for(vector< NodeID >::size_type n = 0; n < w.path.size()-1; ++n) { + for(std::vector< NodeID >::size_type n = 0; n < w.path.size()-1; ++n) { externalMemory->allEdges.push_back(_Edge(w.path[n], w.path[n+1], w.type, w.direction, w.speed, w.nameID, w.roundabout, w.ignoreInGrid, w.isDurationSet, w.isAccessRestricted)); externalMemory->usedNodeIDs.push_back(w.path[n]); } diff --git a/Extractor/ExtractorStructs.h b/Extractor/ExtractorStructs.h index ebd40fc66..36194f119 100644 --- a/Extractor/ExtractorStructs.h +++ b/Extractor/ExtractorStructs.h @@ -110,7 +110,7 @@ struct _Edge { return _Edge(0,0); } static _Edge max_value() { - return _Edge((numeric_limits::max)(), (numeric_limits::max)()); + return _Edge((std::numeric_limits::max)(), (std::numeric_limits::max)()); } }; @@ -125,10 +125,10 @@ struct _WayIDStartAndEndEdge { _WayIDStartAndEndEdge(unsigned w, NodeID fs, NodeID ft, NodeID ls, NodeID lt) : wayID(w), firstStart(fs), firstTarget(ft), lastStart(ls), lastTarget(lt) {} static _WayIDStartAndEndEdge min_value() { - return _WayIDStartAndEndEdge((numeric_limits::min)(), (numeric_limits::min)(), (numeric_limits::min)(), (numeric_limits::min)(), (numeric_limits::min)()); + return _WayIDStartAndEndEdge((std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)(), (std::numeric_limits::min)()); } static _WayIDStartAndEndEdge max_value() { - return _WayIDStartAndEndEdge((numeric_limits::max)(), (numeric_limits::max)(), (numeric_limits::max)(), (numeric_limits::max)(), (numeric_limits::max)()); + return _WayIDStartAndEndEdge((std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)(), (std::numeric_limits::max)()); } }; @@ -202,7 +202,7 @@ struct CmpEdgeByTargetID : public std::binary_function<_Edge, _Edge, bool> } }; -inline string GetRandomString() { +inline std::string GetRandomString() { char s[128]; static const char alphanum[] = "0123456789" @@ -213,7 +213,7 @@ inline string GetRandomString() { s[i] = alphanum[rand() % (sizeof(alphanum) - 1)]; } s[127] = 0; - return string(s); + return std::string(s); } #endif /* EXTRACTORSTRUCTS_H_ */ diff --git a/Extractor/XMLParser.h b/Extractor/XMLParser.h index c9d665dc3..820dcb596 100644 --- a/Extractor/XMLParser.h +++ b/Extractor/XMLParser.h @@ -75,7 +75,7 @@ public: if(!externalMemory->nodeFunction(n)) std::cerr << "[XMLParser] dense node not parsed" << std::endl; } catch (const luabind::error &er) { - cerr << er.what() << endl; + std::cerr << er.what() << std::endl; lua_State* Ler=er.state(); report_errors(Ler, -1); } catch (std::exception & e) { @@ -86,7 +86,6 @@ public: } if ( xmlStrEqual( currentName, ( const xmlChar* ) "way" ) == 1 ) { - string name; _Way way = _ReadXMLWay( ); /** Pass the unpacked way to the LUA call back **/ @@ -101,7 +100,7 @@ public: std::cerr << "[PBFParser] way not parsed" << std::endl; } } catch (const luabind::error &er) { - cerr << er.what() << endl; + std::cerr << er.what() << std::endl; lua_State* Ler=er.state(); report_errors(Ler, -1); } catch (std::exception & e) { diff --git a/extractor.cpp b/extractor.cpp index c7b6decb2..5d4e66fbc 100644 --- a/extractor.cpp +++ b/extractor.cpp @@ -67,12 +67,12 @@ int main (int argc, char *argv[]) { isPBF = true; } } - if(pos!=string::npos) { + if(pos!=std::string::npos) { outputFileName.replace(pos, 8, ".osrm"); restrictionsFileName.replace(pos, 8, ".osrm.restrictions"); } else { pos=outputFileName.find(".osm"); - if(pos!=string::npos) { + if(pos!=std::string::npos) { outputFileName.replace(pos, 5, ".osrm"); restrictionsFileName.replace(pos, 5, ".osrm.restrictions"); } else { diff --git a/typedefs.h b/typedefs.h index b65307859..32807130e 100644 --- a/typedefs.h +++ b/typedefs.h @@ -35,13 +35,6 @@ or see http://www.gnu.org/licenses/agpl.txt. #include -using namespace std; - -#ifdef STXXL_VERBOSE_LEVEL -#undef STXXL_VERBOSE_LEVEL -#endif -#define STXXL_VERBOSE_LEVEL -100 - #define INFO(x) do {std::cout << "[info " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl;} while(0); #define ERR(x) do {std::cerr << "[error " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl; std::exit(-1);} while(0); #define WARN(x) do {std::cerr << "[warn " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl;} while(0);