From 53b8a2f8e63a3b107ef05a7a158661b2f359003e Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:41:43 -0400 Subject: [PATCH] Fix compilation warnings and stop demos when hosting (#313) * [WIP] fix warnings Committing now as is for Isaac to take a look at this. Having issues with VERSION_TEXT * Fix VERSION_TEXT crash and stop demos on host --- autogen/convert_constants.py | 4 ++-- autogen/lua_definitions/constants.lua | 2 +- src/pc/djui/djui_panel_host_message.c | 1 + src/pc/djui/djui_panel_join.c | 1 + src/pc/network/socket/domain_res.h | 4 ++++ src/pc/network/socket/socket.c | 1 + src/pc/network/socket/socket.h | 3 --- src/pc/network/version.h | 2 +- src/pc/pc_main.c | 2 +- 9 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 src/pc/network/socket/domain_res.h diff --git a/autogen/convert_constants.py b/autogen/convert_constants.py index b8f72f98..45066f18 100644 --- a/autogen/convert_constants.py +++ b/autogen/convert_constants.py @@ -221,7 +221,7 @@ def build_constant(processed_constant): constants = [processed_constant] for c in constants: - s += '%s = %s\n' % (c[0], c[1]) + s += '%s = %s\n' % (c[0], c[1].replace('"', "'")) return s @@ -327,7 +327,7 @@ def def_constant(processed_constant): return s for c in [processed_constant]: - if "'" in c[1]: + if '"' in c[1]: s += '\n--- @type string\n' else: s += '\n--- @type integer\n' diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua index 23df2f34..31bd4f55 100644 --- a/autogen/lua_definitions/constants.lua +++ b/autogen/lua_definitions/constants.lua @@ -11489,4 +11489,4 @@ MINOR_VERSION_NUMBER = 0 VERSION_NUMBER = 32 --- @type string -VERSION_TEXT = 'beta' +VERSION_TEXT = "beta" diff --git a/src/pc/djui/djui_panel_host_message.c b/src/pc/djui/djui_panel_host_message.c index edbfc5ad..fda41f5e 100644 --- a/src/pc/djui/djui_panel_host_message.c +++ b/src/pc/djui/djui_panel_host_message.c @@ -28,6 +28,7 @@ Forward port '\\#d0d0ff\\%d\\#c8c8c8\\' for UDP.\ "; void djui_panel_host_message_do_host(UNUSED struct DjuiBase* caller) { + stop_demo(NULL); djui_panel_shutdown(); extern s16 gCurrSaveFileNum; gCurrSaveFileNum = configHostSaveSlot; diff --git a/src/pc/djui/djui_panel_join.c b/src/pc/djui/djui_panel_join.c index 999cb107..63af6879 100644 --- a/src/pc/djui/djui_panel_join.c +++ b/src/pc/djui/djui_panel_join.c @@ -2,6 +2,7 @@ #include "djui.h" #include "src/pc/network/network.h" #include "src/pc/network/socket/socket.h" +#include "src/pc/network/socket/domain_res.h" #include "src/pc/utils/misc.h" #include "src/pc/configfile.h" #include "src/pc/debuglog.h" diff --git a/src/pc/network/socket/domain_res.h b/src/pc/network/socket/domain_res.h new file mode 100644 index 00000000..6cbfef31 --- /dev/null +++ b/src/pc/network/socket/domain_res.h @@ -0,0 +1,4 @@ +extern char gGetHostName[MAX_CONFIG_STRING]; + +void domain_resolution(void); +void save_domain(void); diff --git a/src/pc/network/socket/socket.c b/src/pc/network/socket/socket.c index 59085019..fb428469 100644 --- a/src/pc/network/socket/socket.c +++ b/src/pc/network/socket/socket.c @@ -1,4 +1,5 @@ #include "socket.h" +#include "domain_res.h" #include #include "pc/configfile.h" #include "pc/debuglog.h" diff --git a/src/pc/network/socket/socket.h b/src/pc/network/socket/socket.h index fd8cd788..97682a54 100644 --- a/src/pc/network/socket/socket.h +++ b/src/pc/network/socket/socket.h @@ -10,11 +10,8 @@ #include "../network.h" extern struct NetworkSystem gNetworkSystemSocket; -extern char gGetHostName[MAX_CONFIG_STRING]; SOCKET socket_initialize(void); void socket_shutdown(SOCKET socket); -void domain_resolution(void); -void save_domain(void); #endif diff --git a/src/pc/network/version.h b/src/pc/network/version.h index ac0924bf..d4f00bae 100644 --- a/src/pc/network/version.h +++ b/src/pc/network/version.h @@ -1,7 +1,7 @@ #ifndef VERSION_H #define VERSION_H -#define VERSION_TEXT 'beta' +#define VERSION_TEXT "beta" #define VERSION_NUMBER 32 #define MINOR_VERSION_NUMBER 0 diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index 7eba1b03..e63ffbea 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -47,7 +47,7 @@ #include "pc/discord/discordrpc.h" #endif #include "pc/network/version.h" -#include "pc/network/socket/socket.h" +#include "pc/network/socket/domain_res.h" #include "pc/network/network_player.h" #include "pc/djui/djui.h" #include "pc/debuglog.h"