From 99f5dd2443d6861b7922fa8d94555ebc0d06bfd9 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 26 Jun 2016 14:54:28 +0200 Subject: [PATCH] Changed: Use toString instead of std::stringstream --- code/ryzom/client/src/init.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index ffc6aa308..7b1ca728f 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -46,9 +46,6 @@ // Ligo. #include "nel/ligo/ligo_config.h" -// Std. -#include -#include // Client #include "init.h" #include "input.h" @@ -578,14 +575,12 @@ void listStereoDisplayDevices(std::vector &devices) IStereoDisplay::listDevices(devices); for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) { - std::stringstream name; - name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName; - std::stringstream fullname; - fullname << std::string("[") << name.str() << "] [" << it->Serial << "]"; - nlinfo("VR [C]: Stereo Display: %s", name.str().c_str()); + std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str()); + std::string fullname = toString("[%s] [%s]", name.c_str(), it->Serial.c_str()); + nlinfo("VR [C]: Stereo Display: %s", name.c_str()); if (cache) { - VRDeviceCache.push_back(std::pair(name.str(), it->Serial)); // VR_CONFIG + VRDeviceCache.push_back(std::pair(name, it->Serial)); // VR_CONFIG } } } @@ -623,9 +618,8 @@ void initStereoDisplayDevice() { for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) { - std::stringstream name; - name << IStereoDisplay::getLibraryName(it->Library) << " - " << it->Manufacturer << " - " << it->ProductName; - if (name.str() == ClientCfg.VRDisplayDevice) + std::string name = toString("%s - %s - %s", IStereoDisplay::getLibraryName(it->Library), it->Manufacturer.c_str(), it->ProductName.c_str()); + if (name == ClientCfg.VRDisplayDevice) deviceInfo = &(*it); if (ClientCfg.VRDisplayDeviceId == it->Serial) break;