Skip to content

Commit 7846bb3

Browse files
committed
fix check-clan-tidy
1 parent f2e3a1b commit 7846bb3

35 files changed

Lines changed: 124 additions & 119 deletions

src/base/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,4 +1395,4 @@ void net_unix_close(UNIXSOCKET sock)
13951395
{
13961396
close(sock);
13971397
}
1398-
#endif
1398+
#endif

src/base/system.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// E-Client
2-
31
#include "system.h"
2+
3+
#include "str.h"
4+
45
#include <cctype> // std::toupper
56
#include <cstdlib> // std::malloc, std::free
67

@@ -46,4 +47,4 @@ void SetFlag(int32_t &Flags, int n, bool Value)
4647
bool IsFlagSet(int32_t Flags, int n)
4748
{
4849
return (Flags & (1 << n)) != 0;
49-
}
50+
}

src/base/system.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#include "time.h"
1212
#include "types.h"
1313

14-
#endif
15-
1614
// E-Client
1715
const char *str_to_uppercase(const char *src);
1816
bool str_isalluppercase(const char *str);
1917

2018
void SetFlag(int32_t &Flags, int n, bool Value);
2119
bool IsFlagSet(int32_t Flags, int n);
20+
21+
#endif // BASE_SYSTEM_H

src/engine/client/backend_sdl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ class CAutoreleasePool
3030
Class NSAutoreleasePoolClass = (Class)objc_getClass("NSAutoreleasePool");
3131
m_Pool = class_createInstance(NSAutoreleasePoolClass, 0);
3232
SEL selector = sel_registerName("init");
33-
((id(*)(id, SEL))objc_msgSend)(m_Pool, selector);
33+
((id (*)(id, SEL))objc_msgSend)(m_Pool, selector);
3434
}
3535

3636
~CAutoreleasePool()
3737
{
3838
SEL selector = sel_registerName("drain");
39-
((id(*)(id, SEL))objc_msgSend)(m_Pool, selector);
39+
((id (*)(id, SEL))objc_msgSend)(m_Pool, selector);
4040
}
4141
};
4242
#endif

src/engine/textrender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#include "kernel.h"
66

77
#include <base/color.h>
8-
#include <string>
98

109
#include <engine/graphics.h>
1110

1211
#include <cstdint>
1312
#include <memory>
13+
#include <string>
1414

1515
enum
1616
{

src/game/client/components/binds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CBinds : public CComponent
5656
public:
5757
CBindSlot GetBindSlot(const char *pBindString) const;
5858

59-
const char *GetKeyBinding(int modifierMask, int key) const { return m_aapKeyBindings[modifierMask][key]; } // E-Client
59+
const char *GetKeyBinding(int ModifierMask, int Key) const { return m_aapKeyBindings[ModifierMask][Key]; } // E-Client
6060

6161
CBinds();
6262
~CBinds() override;

src/game/client/components/chat.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
#include "chat.h"
55

6-
#include <base/io.h>
7-
#include <base/time.h>
8-
96
#include "entity/entity.h"
107
#include "tclient/bindchat.h"
118
#include "tclient/warlist.h"
129

10+
#include <base/io.h>
11+
#include <base/time.h>
12+
1313
#include <engine/client/client.h>
1414
#include <engine/editor.h>
1515
#include <engine/graphics.h>
@@ -684,15 +684,15 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
684684
if(ClientId >= 0 && GameClient()->m_Snap.m_LocalClientId != ClientId)
685685
{
686686
if(g_Config.m_ClShowChatFriends && !GameClient()->m_aClients[ClientId].m_Friend)
687-
{
687+
{
688688
char Message[MAX_LINE_LENGTH];
689689
str_format(Message, sizeof(Message), "%s", GameClient()->m_aClients[ClientId].m_aName);
690690
if(Team == 3)
691691
str_format(Message, sizeof(Message), "← %s", GameClient()->m_aClients[ClientId].m_aName);
692692
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, Message, pLine, Color);
693693
return;
694694
}
695-
else if(GameClient()->m_WarList.m_WarPlayers[ClientId].IsMuted)
695+
else if(GameClient()->m_WarList.m_WarPlayers[ClientId].m_IsMuted)
696696
{
697697
char Message[MAX_LINE_LENGTH];
698698
str_format(Message, sizeof(Message), "%s", GameClient()->m_aClients[ClientId].m_aName);
@@ -710,7 +710,7 @@ void CChat::AddLine(int ClientId, int Team, const char *pLine)
710710
char Message[MAX_LINE_LENGTH];
711711
str_format(Message, sizeof(Message), "%s", GameClient()->m_aClients[ClientId].m_aName);
712712
if(Team == 3)
713-
str_format(Message, sizeof(Message), "← %s",GameClient()->m_aClients[ClientId].m_aName);
713+
str_format(Message, sizeof(Message), "← %s", GameClient()->m_aClients[ClientId].m_aName);
714714

715715
if(g_Config.m_ClMutedConsoleColor)
716716
Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClMutedColor));
@@ -1069,7 +1069,7 @@ void CChat::OnPrepareLines(float y)
10691069
{
10701070
TextRender()->TextEx(&MeasureCursor, g_Config.m_ClSpecPrefix);
10711071
}
1072-
if(g_Config.m_ClWarList && g_Config.m_ClWarlistPrefixes && GameClient()->m_WarList.GetAnyWar(Line.m_ClientId) && !Line.m_Whisper && !GameClient()->m_WarList.m_WarPlayers[Line.m_ClientId].IsMuted) // E-Client
1072+
if(g_Config.m_ClWarList && g_Config.m_ClWarlistPrefixes && GameClient()->m_WarList.GetAnyWar(Line.m_ClientId) && !Line.m_Whisper && !GameClient()->m_WarList.m_WarPlayers[Line.m_ClientId].m_IsMuted) // E-Client
10731073
{
10741074
TextRender()->TextEx(&MeasureCursor, g_Config.m_ClWarlistPrefix);
10751075
}
@@ -1581,7 +1581,7 @@ bool CChat::ChatDetection(int ClientId, int Team, const char *pLine)
15811581
GameClient()->ClientMessage(aBuf);
15821582
}
15831583
}
1584-
if(Cache.IsMuted)
1584+
if(Cache.m_IsMuted)
15851585
{
15861586
GameClient()->m_WarList.AddMute(aNewName, true, true);
15871587
str_format(aBuf, sizeof(aBuf), "Auto Added \"%s\" to Temp Mute list", aNewName);

src/game/client/components/entity/anti_spawn_block.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class CAntiSpawnBlock : public CComponent
1818

1919
void Reset(int Stat);
2020

21-
virtual int Sizeof() const override { return sizeof(*this); }
22-
virtual void OnRender() override;
23-
virtual void OnSelfDeath() override { Reset(STATE_NONE); }
24-
virtual void OnStateChange(int NewState, int OldState) override;
21+
int Sizeof() const override { return sizeof(*this); }
22+
void OnRender() override;
23+
void OnSelfDeath() override { Reset(STATE_NONE); }
24+
void OnStateChange(int NewState, int OldState) override;
2525
};
2626

2727
#endif

src/game/client/components/entity/chat_bubbles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void CChatBubbles::AddBubble(int ClientId, int Team, const char *pText)
9090
return;
9191
if(GameClient()->m_aClients[ClientId].m_Foe)
9292
return;
93-
if(GameClient()->m_WarList.m_WarPlayers[ClientId].IsMuted)
93+
if(GameClient()->m_WarList.m_WarPlayers[ClientId].m_IsMuted)
9494
return;
9595
else if(g_Config.m_ClWarList && g_Config.m_ClHideEnemyChat && GameClient()->m_WarList.GetWarData(ClientId).m_WarGroupMatches[1])
9696
return;

src/game/client/components/entity/chat_bubbles.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <game/client/components/chat.h>
1212

1313
#include <cstdint>
14+
#include <utility>
1415
#include <vector>
1516

1617
class CBubble
@@ -31,7 +32,7 @@ class CBubble
3132
CBubble(const char *pText, CTextCursor pCursor, int64_t pTime)
3233
{
3334
str_copy(m_aText, pText, sizeof(m_aText));
34-
m_Cursor = pCursor;
35+
m_Cursor = std::move(pCursor);
3536
m_Time = pTime;
3637
m_OffsetY = 0.0f;
3738
m_TargetOffsetY = 0.0f;
@@ -72,12 +73,12 @@ class CChatBubbles : public CComponent
7273
void SetupTextcontainer(CBubble &Bubble);
7374

7475
public:
75-
virtual void OnMessage(int MsgType, void *pRawMsg) override;
76-
virtual int Sizeof() const override { return sizeof(*this); }
77-
virtual void OnRender() override;
78-
virtual void OnStateChange(int NewState, int OldState) override;
76+
void OnMessage(int MsgType, void *pRawMsg) override;
77+
int Sizeof() const override { return sizeof(*this); }
78+
void OnRender() override;
79+
void OnStateChange(int NewState, int OldState) override;
7980

80-
virtual void OnWindowResize() override; // so it resets when font is changed
81+
void OnWindowResize() override; // so it resets when font is changed
8182
};
8283

8384
#endif

0 commit comments

Comments
 (0)