coding style fixes

- fix switch case formatting
- use utility function equals to compare strings that can be std::string_view
- do not default initialize strings with ""
This commit is contained in:
Katharine Chui committed 2026-02-19 01:14:02 +01:00
1 parent b3b9e90403
commit 3e11b33e6f
2 files changed
+11 -11

No files matched your search

+6 -6
View File
@@ -87,11 +87,11 @@ std::mutex downloadedProAdhocServerListMutex;
std::vector<AdhocServerListEntry> downloadedProAdhocServerList;
static const char *get_data_mode_string(AdhocDataMode mode) {
switch(mode) {
case AdhocDataMode::P2P:
return "AdhocDataMode::P2P";
case AdhocDataMode::AemuPostoffice:
return "AdhocDataMode::AemuPostoffice";
switch (mode) {
case AdhocDataMode::P2P:
return "AdhocDataMode::P2P";
case AdhocDataMode::AemuPostoffice:
return "AdhocDataMode::AemuPostoffice";
}
return "unknown";
}
@@ -107,7 +107,7 @@ AdhocDataMode getAdhocServerDataMode(std::string &server) {
downloadedProAdhocServerListMutex.unlock();
for (const auto &item : list) {
if (strcmp(server.c_str(), item.hostname.c_str()) == 0) {
if (equals(server, item.hostname)) {
INFO_LOG(Log::sceNet, "server %s is in known list, using data mode %s", server.c_str(), get_data_mode_string(item.mode));
return item.mode;
}
+5 -5
View File
@@ -786,11 +786,11 @@ enum class AdhocDataMode {
};
struct AdhocServerListEntry{
std::string name = "";
std::string hostname = "";
std::string community_link = "";
std::string location = "";
std::string note = "";
std::string name;
std::string hostname;
std::string community_link;
std::string location;
std::string note;
AdhocDataMode mode = AdhocDataMode::P2P;
};