From 48546073829e07b9b238dc6d7ea9cb282d13b167 Mon Sep 17 00:00:00 2001 From: gallaert Date: Mon, 20 Apr 2020 19:45:11 +0100 Subject: [PATCH] Replace boost::lexical_cast by std::ostringstream and std:stof/stoi/stod --- src/GUI/FGWindowsMenuBar.cxx | 2 -- src/Network/http/ScreenshotUriHandler.cxx | 22 ++++++++++------------ src/Scenery/terrain_pgt.cxx | 14 +++++++++----- src/Scenery/tilemgr.cxx | 2 -- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/GUI/FGWindowsMenuBar.cxx b/src/GUI/FGWindowsMenuBar.cxx index 1ce3f5653..b1f70bf70 100644 --- a/src/GUI/FGWindowsMenuBar.cxx +++ b/src/GUI/FGWindowsMenuBar.cxx @@ -3,8 +3,6 @@ #include #include -#include - #include #include #include diff --git a/src/Network/http/ScreenshotUriHandler.cxx b/src/Network/http/ScreenshotUriHandler.cxx index a721f871d..3fcb40aaf 100644 --- a/src/Network/http/ScreenshotUriHandler.cxx +++ b/src/Network/http/ScreenshotUriHandler.cxx @@ -36,7 +36,6 @@ #include #include -#include using std::string; using std::vector; @@ -526,11 +525,11 @@ bool ScreenshotUriHandler::poll(Connection * connection) SG_LOG(SG_NETWORK, SG_DEBUG, "Screenshot is ready, size=" << screenshot.size()); if (screenshotRequest->isStream()) { - string s( BOUNDARY "\r\nContent-Type: image/"); - s.append(screenshotRequest->getType()).append("\r\nContent-Length:"); - s += boost::lexical_cast(screenshot.size()); - s += "\r\n\r\n"; - connection->write(s.c_str(), s.length()); + std::ostringstream ss; + ss << BOUNDARY << "\r\nContent-Type: image/"; + ss << screenshotRequest->getType() << "\r\nContent-Length:"; + ss << screenshot.size() << "\r\n\r\n"; + connection->write(ss.str().c_str(), ss.str().length()); } connection->write(screenshot.data(), screenshot.size()); @@ -566,11 +565,11 @@ bool ScreenshotUriHandler::poll(Connection * connection) SG_LOG(SG_NETWORK, SG_DEBUG, "CanvasImage is ready, size=" << canvasimage.size()); if (canvasimageRequest->isStream()) { - string s(BOUNDARY "\r\nContent-Type: image/"); - s.append(canvasimageRequest->getType()).append("\r\nContent-Length:"); - s += boost::lexical_cast(canvasimage.size()); - s += "\r\n\r\n"; - connection->write(s.c_str(), s.length()); + std::ostringstream ss; + ss << BOUNDARY << "\r\nContent-Type: image/"; + ss << canvasimageRequest->getType() << "\r\nContent-Length:"; + ss << canvasimage.size() << "\r\n\r\n"; + connection->write(ss.str().c_str(), ss.str().length()); } connection->write(canvasimage.data(), canvasimage.size()); if (canvasimageRequest->isStream()) { @@ -587,4 +586,3 @@ bool ScreenshotUriHandler::poll(Connection * connection) } // namespace http } // namespace flightgear - diff --git a/src/Scenery/terrain_pgt.cxx b/src/Scenery/terrain_pgt.cxx index d39d8dcf1..f91441b0f 100644 --- a/src/Scenery/terrain_pgt.cxx +++ b/src/Scenery/terrain_pgt.cxx @@ -26,8 +26,6 @@ #ifdef ENABLE_GDAL -#include - #include #include @@ -84,9 +82,15 @@ void FGPgtTerrain::init( osg::Group* terrain ) { options->setPluginStringData("SimGear::FG_ROOT", globals->get_fg_root().utf8Str()); - options->setPluginStringData("SimGear::BARE_LOD_RANGE", fgGetString("/sim/rendering/static-lod/bare-delta", boost::lexical_cast(SG_OBJECT_RANGE_BARE))); - options->setPluginStringData("SimGear::ROUGH_LOD_RANGE", fgGetString("/sim/rendering/static-lod/rough-delta", boost::lexical_cast(SG_OBJECT_RANGE_ROUGH))); - options->setPluginStringData("SimGear::ROUGH_LOD_DETAILED", fgGetString("/sim/rendering/static-lod/detailed", boost::lexical_cast(SG_OBJECT_RANGE_DETAILED))); + options->setPluginStringData("SimGear::BARE_LOD_RANGE", + fgGetString("/sim/rendering/static-lod/bare-delta", + std::to_string(SG_OBJECT_RANGE_BARE))); + options->setPluginStringData("SimGear::ROUGH_LOD_RANGE", + fgGetString("/sim/rendering/static-lod/rough-delta", + std::to_string(SG_OBJECT_RANGE_ROUGH))); + options->setPluginStringData("SimGear::ROUGH_LOD_DETAILED", + fgGetString("/sim/rendering/static-lod/detailed", + std::to_string(SG_OBJECT_RANGE_DETAILED))); options->setPluginStringData("SimGear::RENDER_BUILDING_MESH", fgGetBool("/sim/rendering/building-mesh", false) ? "true" : "false"); options->setPluginStringData("SimGear::FG_EARTH", "ON"); diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 96fdb81a9..b42ddf4c3 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -28,8 +28,6 @@ #include #include -#include - #include #include