From 33b63dbd55beaf23d6c9987c9bc9e41973e59a9d Mon Sep 17 00:00:00 2001 From: chucky-n-ice Date: Tue, 11 Jun 2024 21:07:57 +0200 Subject: [PATCH] Code has been improved (couple of warnings) --- src/citymania/cm_commands_gui.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/citymania/cm_commands_gui.cpp b/src/citymania/cm_commands_gui.cpp index c105981adf..cb37d09442 100644 --- a/src/citymania/cm_commands_gui.cpp +++ b/src/citymania/cm_commands_gui.cpp @@ -241,7 +241,6 @@ char _inilogindata[9][MAX_COMMUNITY_STRING_LEN]; void AccountLogin(CommunityName community); void IniReloadLogin(); -void ShowAdminCompanyButtons(int companyid = INVALID_COMPANY); void ShowServerButtons(int left,int top, int height); void ReloadServerButtons(); @@ -718,9 +717,9 @@ class CommunityServerManager: public HTTPCallback { } private: - char buf[4096]; - char *buf_last; - char *cursor; + char buf[4096]{}; + char *buf_last{}; + char *cursor{}; }; void CommunityServerManagerSend() @@ -834,15 +833,15 @@ public: virtual ~GetHTTPContent() { } private: - char buf[HTTPBUFLEN]; - char *buf_last; - char *cursor; + char buf[HTTPBUFLEN]{}; + char *buf_last{}; + char *cursor{}; }; std::string urlencode(const std::string &s) { static const char lookup[]= "0123456789abcdef"; std::stringstream e; - for(int i=0, ix=s.length(); i MakeServerButtons() } /* check for disabled server from serverlist file */ - int active = 0, aactive[50], s_max = 0; + int active = 0, aactive[50]{}, s_max = 0; if (_community == 1) s_max = 50; //for n-ice if (_community == 2) s_max = 30; //for btpro if (_community == 3) s_max = 10; //for citymania @@ -1616,7 +1615,7 @@ void CheckCommunity() { std::string::npos) { if (GetServerItem(COMMUNITY) != "3") { SetServerItem(COMMUNITY, "3"); - // GetCommunityServerListText(); + GetCommunityServerListText(); } } else if (_network_server_name.find("reddit.com") != std::string::npos) {