mirror of
https://github.com/shadps4-emu/ext-SDL.git
synced 2024-11-27 12:00:35 +00:00
Fix additional calloc-transposed-args warnings
This commit is contained in:
parent
d2ef15d8e6
commit
a57f6c4af3
@ -2710,7 +2710,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeFileDialog)(
|
||||
|
||||
// Convert fileList to string
|
||||
size_t count = (*env)->GetArrayLength(env, fileList);
|
||||
char **charFileList = SDL_calloc(sizeof(char*), count + 1);
|
||||
char **charFileList = SDL_calloc(count + 1, sizeof(char*));
|
||||
|
||||
if (charFileList == NULL) {
|
||||
mAndroidFileDialogData.callback(mAndroidFileDialogData.userdata, NULL, -1);
|
||||
|
@ -241,9 +241,9 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
||||
|
||||
kbd->shift_state = 0;
|
||||
|
||||
kbd->accents = SDL_calloc(sizeof(accentmap_t), 1);
|
||||
kbd->key_map = SDL_calloc(sizeof(keymap_t), 1);
|
||||
kbd->kbInfo = SDL_calloc(sizeof(keyboard_info_t), 1);
|
||||
kbd->accents = SDL_calloc(1, sizeof(accentmap_t));
|
||||
kbd->key_map = SDL_calloc(1, sizeof(keymap_t));
|
||||
kbd->kbInfo = SDL_calloc(1, sizeof(keyboard_info_t));
|
||||
|
||||
ioctl(kbd->console_fd, KDGKBINFO, kbd->kbInfo);
|
||||
ioctl(kbd->console_fd, CONS_MOUSECTL, &mData);
|
||||
|
@ -435,7 +435,7 @@ static SDL_WSCONS_input_data *SDL_WSCONS_Init_Keyboard(const char *dev)
|
||||
input->keyboardID = SDL_GetNextObjectID();
|
||||
SDL_AddKeyboard(input->keyboardID, NULL, false);
|
||||
|
||||
input->keymap.map = SDL_calloc(sizeof(struct wscons_keymap), KS_NUMKEYCODES);
|
||||
input->keymap.map = SDL_calloc(KS_NUMKEYCODES, sizeof(struct wscons_keymap));
|
||||
if (!input->keymap.map) {
|
||||
SDL_free(input);
|
||||
return NULL;
|
||||
|
@ -123,7 +123,7 @@ static void CALLBACK GDK_InternalTextEntryCallback(XAsyncBlock *asyncBlock)
|
||||
SDL_SetError("XGameUiShowTextEntryResultSize failure with HRESULT of %08X", hR);
|
||||
} else if (resultSize > 0) {
|
||||
// +1 to be super sure that the buffer will be null terminated
|
||||
resultBuffer = (char *)SDL_calloc(sizeof(*resultBuffer), 1 + (size_t)resultSize);
|
||||
resultBuffer = (char *)SDL_calloc(1 + (size_t)resultSize, sizeof(*resultBuffer));
|
||||
if (resultBuffer) {
|
||||
// still pass the original size that we got from ResultSize
|
||||
if (FAILED(hR = XGameUiShowTextEntryResult(
|
||||
|
Loading…
Reference in New Issue
Block a user