all repos — mgba @ 03db6b38336e4314bc4414c2e71fe3bac62005c9

mGBA Game Boy Advance Emulator

GBA Input: Fix warnings
Jeffrey Pfau jeffrey@endrift.com
Fri, 31 Jul 2015 16:52:18 -0700
commit

03db6b38336e4314bc4414c2e71fe3bac62005c9

parent

a8cbb100ea37df2599755450b59cb32737ce99ff

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M src/gba/input.csrc/gba/input.c

@@ -433,8 +433,9 @@ }

void GBAInputBindAxis(struct GBAInputMap* map, uint32_t type, int axis, const struct GBAAxis* description) { struct GBAInputMapImpl* impl = _guaranteeMap(map, type); - TableEnumerate(&impl->axes, _unbindAxis, &description->highDirection); - TableEnumerate(&impl->axes, _unbindAxis, &description->lowDirection); + struct GBAAxis d2 = *description; + TableEnumerate(&impl->axes, _unbindAxis, &d2.highDirection); + TableEnumerate(&impl->axes, _unbindAxis, &d2.lowDirection); struct GBAAxis* dup = malloc(sizeof(struct GBAAxis)); *dup = *description; TableInsert(&impl->axes, axis, dup);