mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 18:07:40 +00:00
Fix additional calloc-transposed-args warnings
This commit is contained in:
parent
d2ef15d8e6
commit
a57f6c4af3
4 changed files with 6 additions and 6 deletions
|
@ -2710,7 +2710,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeFileDialog)(
|
||||||
|
|
||||||
// Convert fileList to string
|
// Convert fileList to string
|
||||||
size_t count = (*env)->GetArrayLength(env, fileList);
|
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) {
|
if (charFileList == NULL) {
|
||||||
mAndroidFileDialogData.callback(mAndroidFileDialogData.userdata, NULL, -1);
|
mAndroidFileDialogData.callback(mAndroidFileDialogData.userdata, NULL, -1);
|
||||||
|
|
|
@ -241,9 +241,9 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
||||||
|
|
||||||
kbd->shift_state = 0;
|
kbd->shift_state = 0;
|
||||||
|
|
||||||
kbd->accents = SDL_calloc(sizeof(accentmap_t), 1);
|
kbd->accents = SDL_calloc(1, sizeof(accentmap_t));
|
||||||
kbd->key_map = SDL_calloc(sizeof(keymap_t), 1);
|
kbd->key_map = SDL_calloc(1, sizeof(keymap_t));
|
||||||
kbd->kbInfo = SDL_calloc(sizeof(keyboard_info_t), 1);
|
kbd->kbInfo = SDL_calloc(1, sizeof(keyboard_info_t));
|
||||||
|
|
||||||
ioctl(kbd->console_fd, KDGKBINFO, kbd->kbInfo);
|
ioctl(kbd->console_fd, KDGKBINFO, kbd->kbInfo);
|
||||||
ioctl(kbd->console_fd, CONS_MOUSECTL, &mData);
|
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();
|
input->keyboardID = SDL_GetNextObjectID();
|
||||||
SDL_AddKeyboard(input->keyboardID, NULL, false);
|
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) {
|
if (!input->keymap.map) {
|
||||||
SDL_free(input);
|
SDL_free(input);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -123,7 +123,7 @@ static void CALLBACK GDK_InternalTextEntryCallback(XAsyncBlock *asyncBlock)
|
||||||
SDL_SetError("XGameUiShowTextEntryResultSize failure with HRESULT of %08X", hR);
|
SDL_SetError("XGameUiShowTextEntryResultSize failure with HRESULT of %08X", hR);
|
||||||
} else if (resultSize > 0) {
|
} else if (resultSize > 0) {
|
||||||
// +1 to be super sure that the buffer will be null terminated
|
// +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) {
|
if (resultBuffer) {
|
||||||
// still pass the original size that we got from ResultSize
|
// still pass the original size that we got from ResultSize
|
||||||
if (FAILED(hR = XGameUiShowTextEntryResult(
|
if (FAILED(hR = XGameUiShowTextEntryResult(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue