Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gamepad/source/gamepad/Gamepad_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void Gamepad_detectDevices() {
}

deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
deviceRecord->buttonStates = calloc(sizeof(true), deviceRecord->numButtons);

if (Gamepad_deviceAttachCallback != NULL) {
Gamepad_deviceAttachCallback(deviceRecord, Gamepad_deviceAttachContext);
Expand Down
2 changes: 1 addition & 1 deletion gamepad/source/gamepad/Gamepad_macosx.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void onDeviceMatched(void * context, IOReturn result, void * sender, IOHI
CFRelease(elements);

deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
deviceRecord->buttonStates = calloc(sizeof(true), deviceRecord->numButtons);

IOHIDDeviceRegisterInputValueCallback(device, onDeviceValueChanged, deviceRecord);

Expand Down
2 changes: 1 addition & 1 deletion gamepad/source/gamepad/Gamepad_windows_dinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ static BOOL CALLBACK enumDevicesCallback(const DIDEVICEINSTANCE * instance, LPVO
deviceRecord->numButtons = 0;
IDirectInputDevice_EnumObjects(di8Device, countButtonsCallback, deviceRecord, DIDFT_BUTTON);
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
deviceRecord->buttonStates = calloc(sizeof(true), deviceRecord->numButtons);
deviceRecordPrivate->axisInfo = calloc(sizeof(struct diAxisInfo), deviceRecord->numAxes);
deviceRecordPrivate->buttonOffsets = calloc(sizeof(DWORD), deviceRecord->numButtons);
deviceRecord->numAxes = 0;
Expand Down
2 changes: 1 addition & 1 deletion gamepad/source/gamepad/Gamepad_windows_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void Gamepad_detectDevices() {
deviceRecord->numAxes = caps.wNumAxes + ((caps.wCaps & JOYCAPS_HASPOV) ? 2 : 0);
deviceRecord->numButtons = caps.wNumButtons;
deviceRecord->axisStates = calloc(sizeof(float), deviceRecord->numAxes);
deviceRecord->buttonStates = calloc(sizeof(bool), deviceRecord->numButtons);
deviceRecord->buttonStates = calloc(sizeof(true), deviceRecord->numButtons);
devices = realloc(devices, sizeof(struct Gamepad_device *) * (numDevices + 1));
devices[numDevices++] = deviceRecord;

Expand Down