mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 17:44:18 +00:00
Rename variable aBuf
to pBuf
, use size_t
for buffer size
This commit is contained in:
parent
d551617c34
commit
6c8fa6b4f0
|
@ -175,9 +175,9 @@ const char *CBinds::Get(int KeyID, int ModifierCombination)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBinds::GetKey(const char *pBindStr, char *aBuf, unsigned BufSize)
|
void CBinds::GetKey(const char *pBindStr, char *pBuf, size_t BufSize)
|
||||||
{
|
{
|
||||||
aBuf[0] = 0;
|
pBuf[0] = 0;
|
||||||
for(int Mod = 0; Mod < MODIFIER_COMBINATION_COUNT; Mod++)
|
for(int Mod = 0; Mod < MODIFIER_COMBINATION_COUNT; Mod++)
|
||||||
{
|
{
|
||||||
for(int KeyId = 0; KeyId < KEY_LAST; KeyId++)
|
for(int KeyId = 0; KeyId < KEY_LAST; KeyId++)
|
||||||
|
@ -189,9 +189,9 @@ void CBinds::GetKey(const char *pBindStr, char *aBuf, unsigned BufSize)
|
||||||
if(str_comp(pBind, pBindStr) == 0)
|
if(str_comp(pBind, pBindStr) == 0)
|
||||||
{
|
{
|
||||||
if(Mod)
|
if(Mod)
|
||||||
str_format(aBuf, BufSize, "%s+%s", GetModifierName(Mod), Input()->KeyName(KeyId));
|
str_format(pBuf, BufSize, "%s+%s", GetModifierName(Mod), Input()->KeyName(KeyId));
|
||||||
else
|
else
|
||||||
str_copy(aBuf, Input()->KeyName(KeyId), BufSize);
|
str_copy(pBuf, Input()->KeyName(KeyId), BufSize);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
void SetDefaults();
|
void SetDefaults();
|
||||||
void UnbindAll();
|
void UnbindAll();
|
||||||
const char *Get(int KeyID, int ModifierCombination);
|
const char *Get(int KeyID, int ModifierCombination);
|
||||||
void GetKey(const char *pBindStr, char *aBuf, unsigned BufSize);
|
void GetKey(const char *pBindStr, char *pBuf, size_t BufSize);
|
||||||
int GetBindSlot(const char *pBindString, int *pModifierCombination);
|
int GetBindSlot(const char *pBindString, int *pModifierCombination);
|
||||||
static int GetModifierMask(IInput *pInput);
|
static int GetModifierMask(IInput *pInput);
|
||||||
static int GetModifierMaskOfKey(int Key);
|
static int GetModifierMaskOfKey(int Key);
|
||||||
|
|
Loading…
Reference in a new issue