SDL: Allocate properly sized input maps
Jeffrey Pfau jeffrey@endrift.com
Wed, 06 May 2015 01:19:27 -0700
2 files changed,
4 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -44,6 +44,7 @@ - Debugger: Fix boundary conditions in tab completion
- Video: Fix an issue with very long filenames - SDL: Fix boundary conditions for joystick adjustments - Util: Fix a null-pointer issue when attempting to delete a key + - SDL: Allocate properly sized input maps Misc: - Qt: Show multiplayer numbers in window title - Qt: Handle saving input settings better
M
src/gba/input.c
→
src/gba/input.c
@@ -95,7 +95,7 @@ map->maps = malloc(sizeof(*map->maps));
map->numMaps = 1; impl = &map->maps[0]; impl->type = type; - impl->map = calloc(GBA_KEY_MAX, sizeof(enum GBAKey)); + impl->map = calloc(GBA_KEY_MAX, sizeof(int)); TableInit(&impl->axes, 2, free); } else { impl = _lookupMap(map, type);@@ -110,7 +110,7 @@ }
} if (impl) { impl->type = type; - impl->map = calloc(GBA_KEY_MAX, sizeof(enum GBAKey)); + impl->map = calloc(GBA_KEY_MAX, sizeof(int)); } else { map->maps = realloc(map->maps, sizeof(*map->maps) * map->numMaps * 2); for (m = map->numMaps * 2 - 1; m > map->numMaps; --m) {@@ -120,7 +120,7 @@ }
map->numMaps *= 2; impl = &map->maps[m]; impl->type = type; - impl->map = calloc(GBA_KEY_MAX, sizeof(enum GBAKey)); + impl->map = calloc(GBA_KEY_MAX, sizeof(int)); } TableInit(&impl->axes, 2, free); }