Fix additional calloc-transposed-args warnings

This commit is contained in:
Petar Popovic 2024-09-09 03:09:33 +02:00 committed by Sam Lantinga
parent d2ef15d8e6
commit a57f6c4af3
4 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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(