mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
UPnP: use std::to_string
This commit is contained in:
@ -7,15 +7,16 @@
|
|||||||
#include "Common/UPnP.h"
|
#include "Common/UPnP.h"
|
||||||
|
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
#include "Common/StringUtil.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <miniupnpc.h>
|
#include <miniupnpc.h>
|
||||||
#include <miniwget.h>
|
#include <miniwget.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <upnpcommands.h>
|
#include <upnpcommands.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
static UPNPUrls s_urls;
|
static UPNPUrls s_urls;
|
||||||
static IGDdatas s_data;
|
static IGDdatas s_data;
|
||||||
@ -108,7 +109,7 @@ static bool InitUPnP()
|
|||||||
// --
|
// --
|
||||||
static bool UnmapPort(const u16 port)
|
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",
|
UPNP_DeletePortMapping(s_urls.controlURL, s_data.first.servicetype, port_str.c_str(), "UDP",
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
@ -122,7 +123,7 @@ static bool MapPort(const char* addr, const u16 port)
|
|||||||
if (s_mapped > 0)
|
if (s_mapped > 0)
|
||||||
UnmapPort(s_mapped);
|
UnmapPort(s_mapped);
|
||||||
|
|
||||||
std::string port_str = StringFromFormat("%d", port);
|
std::string port_str = std::to_string(port);
|
||||||
int result = UPNP_AddPortMapping(
|
int result = UPNP_AddPortMapping(
|
||||||
s_urls.controlURL, s_data.first.servicetype, port_str.c_str(), port_str.c_str(), addr,
|
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);
|
(std::string("dolphin-emu UDP on ") + addr).c_str(), "UDP", nullptr, nullptr);
|
||||||
|
Reference in New Issue
Block a user