Rename variable aBuf to pBuf, use size_t for buffer size

This commit is contained in:
Robert Müller 2022-10-27 22:21:08 +02:00
parent d551617c34
commit 6c8fa6b4f0
2 changed files with 5 additions and 5 deletions

View file

@ -175,9 +175,9 @@ const char *CBinds::Get(int KeyID, int ModifierCombination)
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 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(Mod)
str_format(aBuf, BufSize, "%s+%s", GetModifierName(Mod), Input()->KeyName(KeyId));
str_format(pBuf, BufSize, "%s+%s", GetModifierName(Mod), Input()->KeyName(KeyId));
else
str_copy(aBuf, Input()->KeyName(KeyId), BufSize);
str_copy(pBuf, Input()->KeyName(KeyId), BufSize);
return;
}
}

View file

@ -52,7 +52,7 @@ public:
void SetDefaults();
void UnbindAll();
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);
static int GetModifierMask(IInput *pInput);
static int GetModifierMaskOfKey(int Key);