From 8bbeee11734d3ba8e2cf15d19cb3c302f8bfdbf2 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:51:18 +0100 Subject: core: Add clang-tidy (#8664) This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright. --- src/managers/AnimationManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/managers/AnimationManager.cpp') diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 7525bf6b..5ebbea8a 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -216,17 +216,17 @@ void CAnimationManager::tick() { switch (av->m_Type) { case AVARTYPE_FLOAT: { - auto typedAv = static_cast*>(av); + auto typedAv = dynamic_cast*>(av); updateVariable(*typedAv); break; } case AVARTYPE_VECTOR: { - auto typedAv = static_cast*>(av); + auto typedAv = dynamic_cast*>(av); updateVariable(*typedAv); break; } case AVARTYPE_COLOR: { - auto typedAv = static_cast*>(av); + auto typedAv = dynamic_cast*>(av); updateColorVariable(*typedAv); break; } @@ -495,7 +495,7 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config, else if (style.starts_with("popin")) { // try parsing float minPerc = 0.f; - if (style.find("%") != std::string::npos) { + if (style.find('%') != std::string::npos) { try { auto percstr = style.substr(style.find_last_of(' ')); minPerc = std::stoi(percstr.substr(0, percstr.length() - 1)); @@ -516,7 +516,7 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config, else if (style.starts_with("slidefade")) { // try parsing float movePerc = 0.f; - if (style.find("%") != std::string::npos) { + if (style.find('%') != std::string::npos) { try { auto percstr = style.substr(style.find_last_of(' ') + 1); movePerc = std::stoi(percstr.substr(0, percstr.length() - 1)); @@ -541,7 +541,7 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config, else if (style.starts_with("popin")) { // try parsing float minPerc = 0.f; - if (style.find("%") != std::string::npos) { + if (style.find('%') != std::string::npos) { try { auto percstr = style.substr(style.find_last_of(' ')); minPerc = std::stoi(percstr.substr(0, percstr.length() - 1)); -- cgit v1.2.3