mirror of
https://github.com/PretendoNetwork/Inkay.git
synced 2026-03-21 17:45:17 -05:00
fix(p2p): Fix compilation error in multiplayer port text
GCC complains about std::make_format_args using non-const references, so we can't pass along the `get_console_peertopeer_port` directly. Also replace `unsigned short` with `uint16_t` for clarity.
This commit is contained in:
parent
a710bd985a
commit
06847b21e5
|
|
@ -102,14 +102,14 @@ static inline int digit(char a) {
|
|||
return a - '0';
|
||||
}
|
||||
|
||||
unsigned short get_console_peertopeer_port() {
|
||||
uint16_t get_console_peertopeer_port() {
|
||||
const char * serial = get_console_serial();
|
||||
|
||||
unsigned short port = 50000 +
|
||||
(digit(serial[4]) * 1000) +
|
||||
(digit(serial[5]) * 100 ) +
|
||||
(digit(serial[6]) * 10 ) +
|
||||
(digit(serial[7]) * 1 );
|
||||
uint16_t port = 50000 +
|
||||
(digit(serial[4]) * 1000) +
|
||||
(digit(serial[5]) * 100 ) +
|
||||
(digit(serial[6]) * 10 ) +
|
||||
(digit(serial[7]) * 1 );
|
||||
|
||||
return port;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,8 @@ static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHa
|
|||
if (!res) return report_error(err);
|
||||
|
||||
{
|
||||
std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(get_console_peertopeer_port()));
|
||||
uint16_t port = get_console_peertopeer_port();
|
||||
std::string multiplayer_port_text = std::vformat(strings.multiplayer_port_display, std::make_format_args(port));
|
||||
res = network_cat->add(WUPSConfigItemStub::Create(multiplayer_port_text), err);
|
||||
if (!res) return report_error(err);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user