UPnP: use std::to_string

This commit is contained in:
Michael M 2017-08-06 23:45:39 -07:00
parent 862e0bec79
commit ff1d1a7a4d
1 changed files with 4 additions and 3 deletions

View File

@ -7,15 +7,16 @@
#include "Common/UPnP.h"
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
#include <array>
#include <cstdlib>
#include <cstring>
#include <miniupnpc.h>
#include <miniwget.h>
#include <string>
#include <thread>
#include <upnpcommands.h>
#include <vector>
static UPNPUrls s_urls;
static IGDdatas s_data;
@ -108,7 +109,7 @@ static bool InitUPnP()
// --
static bool UnmapPort(const u16 port)
{
std::string port_str = StringFromFormat("%d", port);
std::string port_str = std::to_string(port);
UPNP_DeletePortMapping(s_urls.controlURL, s_data.first.servicetype, port_str.c_str(), "UDP",
nullptr);
@ -122,7 +123,7 @@ static bool MapPort(const char* addr, const u16 port)
if (s_mapped > 0)
UnmapPort(s_mapped);
std::string port_str = StringFromFormat("%d", port);
std::string port_str = std::to_string(port);
int result = UPNP_AddPortMapping(
s_urls.controlURL, s_data.first.servicetype, port_str.c_str(), port_str.c_str(), addr,
(std::string("dolphin-emu UDP on ") + addr).c_str(), "UDP", nullptr, nullptr);