Merge pull request #652 from sebholt/fix_array_size_computation

Fix two array size computations
This commit is contained in:
Louis Gombert 2024-12-05 22:03:42 +01:00 committed by GitHub
commit 0bdca225e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -392,7 +392,7 @@ static int16_t key_binding_indices[] = {
KEY_PADPERIOD, KEY_PADENTER, KEY_RCTRL, KEY_PADDIVIDE, KEY_RALT, KEY_HOME, KEY_UP, KEY_PAGEUP, KEY_PADPERIOD, KEY_PADENTER, KEY_RCTRL, KEY_PADDIVIDE, KEY_RALT, KEY_HOME, KEY_UP, KEY_PAGEUP,
KEY_LEFT, KEY_RIGHT, KEY_END, KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, 0xff}; KEY_LEFT, KEY_RIGHT, KEY_END, KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, 0xff};
#define NUM_KEYBINDSTRINGS (sizeof(Ctltext_KeyBindings) / sizeof(char *)) #define NUM_KEYBINDSTRINGS (sizeof(Ctltext_KeyBindings) / sizeof(Ctltext_KeyBindings[0]))
#define F_ELEM_HILITE 0x1 #define F_ELEM_HILITE 0x1
#define F_ELEM_ACTIVE 0x2 #define F_ELEM_ACTIVE 0x2

View File

@ -537,7 +537,7 @@ const char *ddio_MouseGetBtnText(int btn) {
} }
const char *ddio_MouseGetAxisText(int axis) { const char *ddio_MouseGetAxisText(int axis) {
if (axis >= (sizeof(Ctltext_MseAxisBindings) / sizeof(char *)) || axis < 0) if (axis >= static_cast<int>(sizeof(Ctltext_MseAxisBindings) / sizeof(Ctltext_MseAxisBindings[0])) || axis < 0)
return (""); return ("");
return Ctltext_MseAxisBindings[axis]; return Ctltext_MseAxisBindings[axis];
} }