fix: Get rid of warnings on clang-cl (#6528)

This commit is contained in:
nerix
2025-10-25 16:14:20 +02:00
committed by GitHub
parent 6e443cd767
commit 7214c49e79
27 changed files with 124 additions and 105 deletions
+5 -4
View File
@@ -36,12 +36,12 @@ const QString CRASHPAD_EXECUTABLE_NAME = QStringLiteral("crashpad-handler.exe");
/// Converts a QString into the platform string representation.
#if defined(Q_OS_UNIX)
std::string nativeString(const QString &s)
[[maybe_unused]] std::string nativeString(const QString &s)
{
return s.toStdString();
}
#elif defined(Q_OS_WINDOWS)
std::wstring nativeString(const QString &s)
[[maybe_unused]] std::wstring nativeString(const QString &s)
{
return s.toStdWString();
}
@@ -82,7 +82,8 @@ std::optional<bool> readRecoverySettings(const Paths &paths)
return shouldRecover.toBool();
}
bool canRestart(const Paths &paths, const Args &args)
[[maybe_unused]] bool canRestart(const Paths &paths,
[[maybe_unused]] const Args &args)
{
#ifdef NDEBUG
if (args.isFramelessEmbed || args.shouldRunBrowserExtensionHost)
@@ -108,7 +109,7 @@ bool canRestart(const Paths &paths, const Args &args)
/// additional plus ('++' -> '+').
///
/// The decoding happens in crash-handler/src/CommandLine.cpp
std::string encodeArguments(const Args &appArgs)
[[maybe_unused]] std::string encodeArguments(const Args &appArgs)
{
std::string args;
for (auto arg : appArgs.currentArguments())
+3
View File
@@ -251,6 +251,9 @@ Fonts::FontData Fonts::createFontData(FontStyle type, float scale)
#endif
}
break;
default:
break;
}
return font;
+5 -3
View File
@@ -76,14 +76,16 @@ void registerNmManifest([[maybe_unused]] const Paths &paths,
const Config &config, const QJsonDocument &document)
{
#ifdef Q_OS_WIN
writeManifestTo(paths.miscDirectory, u"."_s, config.fileName, document);
std::ignore =
writeManifestTo(paths.miscDirectory, u"."_s, config.fileName, document);
QSettings registry(config.registryKey, QSettings::NativeFormat);
registry.setValue("Default",
QString(paths.miscDirectory % u'/' % config.fileName));
#else
writeManifestTo(config.browserDirectory, config.nmDirectory,
u"com.chatterino.chatterino.json"_s, document);
std::ignore =
writeManifestTo(config.browserDirectory, config.nmDirectory,
u"com.chatterino.chatterino.json"_s, document);
#endif
}
+13
View File
@@ -314,6 +314,9 @@ Window &WindowManager::createWindow(WindowType type, bool show, QWidget *parent)
assertInGuiThread();
auto *const realParent = [this, type, parent]() -> QWidget * {
(void)this;
(void)type;
if (parent)
{
// If a parent is explicitly specified, we use that immediately.
@@ -696,6 +699,9 @@ void WindowManager::encodeNodeRecursively(SplitNode *node, QJsonObject &obj)
obj.insert("items", itemsArr);
}
break;
default:
break;
}
obj.insert("flexh", node->getHorizontalFlex());
@@ -737,6 +743,10 @@ void WindowManager::encodeChannel(IndirectChannel channel, QJsonObject &obj)
obj.insert("type", "misc");
obj.insert("name", channel.get()->getName());
}
break;
default:
break;
}
}
@@ -923,6 +933,9 @@ void WindowManager::applyWindowLayout(const WindowLayout &layout)
window.setWindowState(Qt::WindowMaximized);
}
break;
case WindowDescriptor::State::None:
break;
}
}
}