mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Fix clang-tidy readability-static-accessed-through-instance
The crash that was occurring with this check was fixed in clang 15.
This commit is contained in:
parent
4e31052821
commit
5a10ef049a
|
@ -10,8 +10,6 @@
|
||||||
# TODO: Requires C11 to fix
|
# TODO: Requires C11 to fix
|
||||||
# misc-unused-parameters
|
# misc-unused-parameters
|
||||||
# TODO: Many changes
|
# TODO: Many changes
|
||||||
# readability-static-accessed-through-instance,
|
|
||||||
# Crashes: https://github.com/llvm/llvm-project/issues/53359
|
|
||||||
# misc-use-anonymous-namespace
|
# misc-use-anonymous-namespace
|
||||||
# We don't want to use anonymous namespaces instead of static functions.
|
# We don't want to use anonymous namespaces instead of static functions.
|
||||||
# bugprone-suspicious-realloc-usage
|
# bugprone-suspicious-realloc-usage
|
||||||
|
@ -87,7 +85,6 @@ Checks: >
|
||||||
-readability-named-parameter,
|
-readability-named-parameter,
|
||||||
-readability-non-const-parameter,
|
-readability-non-const-parameter,
|
||||||
-readability-simplify-boolean-expr,
|
-readability-simplify-boolean-expr,
|
||||||
-readability-static-accessed-through-instance,
|
|
||||||
-readability-suspicious-call-argument,
|
-readability-suspicious-call-argument,
|
||||||
-readability-uppercase-literal-suffix,
|
-readability-uppercase-literal-suffix,
|
||||||
performance-*,
|
performance-*,
|
||||||
|
|
|
@ -1711,7 +1711,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
|
||||||
char aTmpBackendName[256];
|
char aTmpBackendName[256];
|
||||||
|
|
||||||
auto IsInfoDefault = [](const SMenuBackendInfo &CheckInfo) {
|
auto IsInfoDefault = [](const SMenuBackendInfo &CheckInfo) {
|
||||||
return str_comp_nocase(CheckInfo.m_pBackendName, g_Config.ms_pGfxBackend) == 0 && CheckInfo.m_Major == g_Config.ms_GfxGLMajor && CheckInfo.m_Minor == g_Config.ms_GfxGLMinor && CheckInfo.m_Patch == g_Config.ms_GfxGLPatch;
|
return str_comp_nocase(CheckInfo.m_pBackendName, CConfig::ms_pGfxBackend) == 0 && CheckInfo.m_Major == CConfig::ms_GfxGLMajor && CheckInfo.m_Minor == CConfig::ms_GfxGLMinor && CheckInfo.m_Patch == CConfig::ms_GfxGLPatch;
|
||||||
};
|
};
|
||||||
|
|
||||||
int OldSelectedBackend = -1;
|
int OldSelectedBackend = -1;
|
||||||
|
|
|
@ -30,9 +30,9 @@ void CLayerQuads::Render(bool QuadPicker)
|
||||||
Graphics()->TextureSet(m_pEditor->m_Map.m_vpImages[m_Image]->m_Texture);
|
Graphics()->TextureSet(m_pEditor->m_Map.m_vpImages[m_Image]->m_Texture);
|
||||||
|
|
||||||
Graphics()->BlendNone();
|
Graphics()->BlendNone();
|
||||||
m_pEditor->RenderTools()->ForceRenderQuads(m_vQuads.data(), m_vQuads.size(), LAYERRENDERFLAG_OPAQUE, m_pEditor->EnvelopeEval, m_pEditor);
|
m_pEditor->RenderTools()->ForceRenderQuads(m_vQuads.data(), m_vQuads.size(), LAYERRENDERFLAG_OPAQUE, CEditor::EnvelopeEval, m_pEditor);
|
||||||
Graphics()->BlendNormal();
|
Graphics()->BlendNormal();
|
||||||
m_pEditor->RenderTools()->ForceRenderQuads(m_vQuads.data(), m_vQuads.size(), LAYERRENDERFLAG_TRANSPARENT, m_pEditor->EnvelopeEval, m_pEditor);
|
m_pEditor->RenderTools()->ForceRenderQuads(m_vQuads.data(), m_vQuads.size(), LAYERRENDERFLAG_TRANSPARENT, CEditor::EnvelopeEval, m_pEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
CQuad *CLayerQuads::NewQuad(int x, int y, int Width, int Height)
|
CQuad *CLayerQuads::NewQuad(int x, int y, int Width, int Height)
|
||||||
|
|
|
@ -40,7 +40,7 @@ void CLayerSounds::Render(bool Tileset)
|
||||||
if(Source.m_PosEnv >= 0)
|
if(Source.m_PosEnv >= 0)
|
||||||
{
|
{
|
||||||
ColorRGBA Channels;
|
ColorRGBA Channels;
|
||||||
m_pEditor->EnvelopeEval(Source.m_PosEnvOffset, Source.m_PosEnv, Channels, m_pEditor);
|
CEditor::EnvelopeEval(Source.m_PosEnvOffset, Source.m_PosEnv, Channels, m_pEditor);
|
||||||
OffsetX = Channels.r;
|
OffsetX = Channels.r;
|
||||||
OffsetY = Channels.g;
|
OffsetY = Channels.g;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void CLayerSounds::Render(bool Tileset)
|
||||||
if(Source.m_PosEnv >= 0)
|
if(Source.m_PosEnv >= 0)
|
||||||
{
|
{
|
||||||
ColorRGBA Channels;
|
ColorRGBA Channels;
|
||||||
m_pEditor->EnvelopeEval(Source.m_PosEnvOffset, Source.m_PosEnv, Channels, m_pEditor);
|
CEditor::EnvelopeEval(Source.m_PosEnvOffset, Source.m_PosEnv, Channels, m_pEditor);
|
||||||
OffsetX = Channels.r;
|
OffsetX = Channels.r;
|
||||||
OffsetY = Channels.g;
|
OffsetY = Channels.g;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,10 +131,10 @@ void CLayerTiles::Render(bool Tileset)
|
||||||
ColorRGBA Color = ColorRGBA(m_Color.r / 255.0f, m_Color.g / 255.0f, m_Color.b / 255.0f, m_Color.a / 255.0f);
|
ColorRGBA Color = ColorRGBA(m_Color.r / 255.0f, m_Color.g / 255.0f, m_Color.b / 255.0f, m_Color.a / 255.0f);
|
||||||
Graphics()->BlendNone();
|
Graphics()->BlendNone();
|
||||||
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_OPAQUE,
|
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_OPAQUE,
|
||||||
m_pEditor->EnvelopeEval, m_pEditor, m_ColorEnv, m_ColorEnvOffset);
|
CEditor::EnvelopeEval, m_pEditor, m_ColorEnv, m_ColorEnvOffset);
|
||||||
Graphics()->BlendNormal();
|
Graphics()->BlendNormal();
|
||||||
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_TRANSPARENT,
|
m_pEditor->RenderTools()->RenderTilemap(m_pTiles, m_Width, m_Height, 32.0f, Color, LAYERRENDERFLAG_TRANSPARENT,
|
||||||
m_pEditor->EnvelopeEval, m_pEditor, m_ColorEnv, m_ColorEnvOffset);
|
CEditor::EnvelopeEval, m_pEditor, m_ColorEnv, m_ColorEnvOffset);
|
||||||
|
|
||||||
// Render DDRace Layers
|
// Render DDRace Layers
|
||||||
if(!Tileset)
|
if(!Tileset)
|
||||||
|
|
|
@ -58,7 +58,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
pEditor->m_PopupEventActivated = true;
|
pEditor->m_PopupEventActivated = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Load map", "Load", "maps", false, pEditor->CallbackOpenMap, pEditor);
|
pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Load map", "Load", "maps", false, CEditor::CallbackOpenMap, pEditor);
|
||||||
return CUI::POPUP_CLOSE_CURRENT;
|
return CUI::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
View.HSplitTop(12.0f, &Slot, &View);
|
View.HSplitTop(12.0f, &Slot, &View);
|
||||||
if(pEditor->DoButton_MenuItem(&s_AppendButton, "Append", 0, &Slot, 0, "Opens a map and adds everything from that map to the current one (ctrl+a)"))
|
if(pEditor->DoButton_MenuItem(&s_AppendButton, "Append", 0, &Slot, 0, "Opens a map and adds everything from that map to the current one (ctrl+a)"))
|
||||||
{
|
{
|
||||||
pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Append map", "Append", "maps", false, pEditor->CallbackAppendMap, pEditor);
|
pEditor->InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_MAP, "Append map", "Append", "maps", false, CEditor::CallbackAppendMap, pEditor);
|
||||||
return CUI::POPUP_CLOSE_CURRENT;
|
return CUI::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
pEditor->m_PopupEventActivated = true;
|
pEditor->m_PopupEventActivated = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", false, pEditor->CallbackSaveMap, pEditor);
|
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", false, CEditor::CallbackSaveMap, pEditor);
|
||||||
return CUI::POPUP_CLOSE_CURRENT;
|
return CUI::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
View.HSplitTop(12.0f, &Slot, &View);
|
View.HSplitTop(12.0f, &Slot, &View);
|
||||||
if(pEditor->DoButton_MenuItem(&s_SaveAsButton, "Save As", 0, &Slot, 0, "Saves the current map under a new name (ctrl+shift+s)"))
|
if(pEditor->DoButton_MenuItem(&s_SaveAsButton, "Save As", 0, &Slot, 0, "Saves the current map under a new name (ctrl+shift+s)"))
|
||||||
{
|
{
|
||||||
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, pEditor->CallbackSaveMap, pEditor);
|
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, CEditor::CallbackSaveMap, pEditor);
|
||||||
return CUI::POPUP_CLOSE_CURRENT;
|
return CUI::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
|
||||||
View.HSplitTop(12.0f, &Slot, &View);
|
View.HSplitTop(12.0f, &Slot, &View);
|
||||||
if(pEditor->DoButton_MenuItem(&s_SaveCopyButton, "Save Copy", 0, &Slot, 0, "Saves a copy of the current map under a new name (ctrl+shift+alt+s)"))
|
if(pEditor->DoButton_MenuItem(&s_SaveCopyButton, "Save Copy", 0, &Slot, 0, "Saves a copy of the current map under a new name (ctrl+shift+alt+s)"))
|
||||||
{
|
{
|
||||||
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, pEditor->CallbackSaveCopyMap, pEditor);
|
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, CEditor::CallbackSaveCopyMap, pEditor);
|
||||||
return CUI::POPUP_CLOSE_CURRENT;
|
return CUI::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1578,7 +1578,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupImage(void *pContext, CUIRect View,
|
||||||
View.HSplitTop(5.0f, nullptr, &View);
|
View.HSplitTop(5.0f, nullptr, &View);
|
||||||
View.HSplitTop(12.0f, &Slot, &View);
|
View.HSplitTop(12.0f, &Slot, &View);
|
||||||
}
|
}
|
||||||
else if(pEditor->IsVanillaImage(pImg->m_aName))
|
else if(CEditor::IsVanillaImage(pImg->m_aName))
|
||||||
{
|
{
|
||||||
if(pEditor->DoButton_MenuItem(&s_ExternalButton, "Make external", 0, &Slot, 0, "Removes the image from the map file."))
|
if(pEditor->DoButton_MenuItem(&s_ExternalButton, "Make external", 0, &Slot, 0, "Removes the image from the map file."))
|
||||||
{
|
{
|
||||||
|
|
|
@ -2860,7 +2860,7 @@ void CGameContext::ConTunes(IConsole::IResult *pResult, void *pUserData)
|
||||||
{
|
{
|
||||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||||
char aBuf[256];
|
char aBuf[256];
|
||||||
for(int i = 0; i < pSelf->Tuning()->Num(); i++)
|
for(int i = 0; i < CTuningParams::Num(); i++)
|
||||||
{
|
{
|
||||||
float Value;
|
float Value;
|
||||||
pSelf->Tuning()->Get(i, &Value);
|
pSelf->Tuning()->Get(i, &Value);
|
||||||
|
@ -2899,7 +2899,7 @@ void CGameContext::ConTuneDumpZone(IConsole::IResult *pResult, void *pUserData)
|
||||||
char aBuf[256];
|
char aBuf[256];
|
||||||
if(List >= 0 && List < NUM_TUNEZONES)
|
if(List >= 0 && List < NUM_TUNEZONES)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < pSelf->TuningList()[List].Num(); i++)
|
for(int i = 0; i < CTuningParams::Num(); i++)
|
||||||
{
|
{
|
||||||
float Value;
|
float Value;
|
||||||
pSelf->TuningList()[List].Get(i, &Value);
|
pSelf->TuningList()[List].Get(i, &Value);
|
||||||
|
|
|
@ -479,8 +479,8 @@ MapObject CreateMapObject(const CMapItemGroup *pLayerGroup, const int PosX, cons
|
||||||
|
|
||||||
for(int i = 0; i < 2; i++)
|
for(int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
Ob.m_aaScreenOffset[i][0] = -Ob.ms_aStandardScreen[i];
|
Ob.m_aaScreenOffset[i][0] = -MapObject::ms_aStandardScreen[i];
|
||||||
Ob.m_aaScreenOffset[i][1] = Ob.ms_aStandardScreen[i];
|
Ob.m_aaScreenOffset[i][1] = MapObject::ms_aStandardScreen[i];
|
||||||
if(Ob.m_aSpeed[i] < 0)
|
if(Ob.m_aSpeed[i] < 0)
|
||||||
std::swap(Ob.m_aaScreenOffset[i][0], Ob.m_aaScreenOffset[i][1]);
|
std::swap(Ob.m_aaScreenOffset[i][0], Ob.m_aaScreenOffset[i][1]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue