Fix warnings: calloc-transposed-args
This commit is contained in:
parent
0da2bd49c8
commit
d2ef15d8e6
@ -96,7 +96,7 @@ static void DBus_AppendFilter(SDL_DBusContext *dbus, DBusMessageIter *parent, co
|
||||
dbus->message_iter_open_container(&filter_array, DBUS_TYPE_STRUCT, NULL, &filter_array_entry);
|
||||
dbus->message_iter_append_basic(&filter_array_entry, DBUS_TYPE_UINT32, &zero);
|
||||
|
||||
glob_pattern = SDL_calloc(sizeof(char), max_len);
|
||||
glob_pattern = SDL_calloc(max_len, sizeof(char));
|
||||
if (!glob_pattern) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1086,7 +1086,7 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id)
|
||||
}
|
||||
|
||||
// Create and initialize the joystick
|
||||
joystick = (SDL_Joystick *)SDL_calloc(sizeof(*joystick), 1);
|
||||
joystick = (SDL_Joystick *)SDL_calloc(1, sizeof(*joystick));
|
||||
if (!joystick) {
|
||||
SDL_UnlockJoysticks();
|
||||
return NULL;
|
||||
|
@ -2335,7 +2335,7 @@ static bool LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping
|
||||
|
||||
/* We temporarily open the device to check how it's configured. Make
|
||||
a fake SDL_Joystick object to do so. */
|
||||
joystick = (SDL_Joystick *)SDL_calloc(sizeof(*joystick), 1);
|
||||
joystick = (SDL_Joystick *)SDL_calloc(1, sizeof(*joystick));
|
||||
if (!joystick) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1599,7 +1599,7 @@ static bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, int ex
|
||||
return false;
|
||||
}
|
||||
if (extensionCount > 0 ) {
|
||||
VkExtensionProperties *extensionProperties = (VkExtensionProperties *)SDL_calloc(sizeof(VkExtensionProperties), extensionCount);
|
||||
VkExtensionProperties *extensionProperties = (VkExtensionProperties *)SDL_calloc(extensionCount, sizeof(VkExtensionProperties));
|
||||
result = vkEnumerateDeviceExtensionProperties(rendererData->physicalDevice, NULL, &extensionCount, extensionProperties);
|
||||
if (result != VK_SUCCESS ) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkEnumerateDeviceExtensionProperties): %s.\n", SDL_Vulkan_GetResultString(result));
|
||||
@ -2356,8 +2356,8 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
||||
}
|
||||
SDL_free(rendererData->renderingFinishedSemaphores);
|
||||
}
|
||||
rendererData->imageAvailableSemaphores = (VkSemaphore *)SDL_calloc(sizeof(VkSemaphore), rendererData->swapchainImageCount);
|
||||
rendererData->renderingFinishedSemaphores = (VkSemaphore *)SDL_calloc(sizeof(VkSemaphore), rendererData->swapchainImageCount);
|
||||
rendererData->imageAvailableSemaphores = (VkSemaphore *)SDL_calloc(rendererData->swapchainImageCount, sizeof(VkSemaphore));
|
||||
rendererData->renderingFinishedSemaphores = (VkSemaphore *)SDL_calloc(rendererData->swapchainImageCount, sizeof(VkSemaphore));
|
||||
for (uint32_t i = 0; i < rendererData->swapchainImageCount; i++) {
|
||||
rendererData->imageAvailableSemaphores[i] = VULKAN_CreateSemaphore(rendererData);
|
||||
if (rendererData->imageAvailableSemaphores[i] == VK_NULL_HANDLE) {
|
||||
|
@ -321,7 +321,7 @@ SDL_Sensor *SDL_OpenSensor(SDL_SensorID instance_id)
|
||||
}
|
||||
|
||||
// Create and initialize the sensor
|
||||
sensor = (SDL_Sensor *)SDL_calloc(sizeof(*sensor), 1);
|
||||
sensor = (SDL_Sensor *)SDL_calloc(1, sizeof(*sensor));
|
||||
if (!sensor) {
|
||||
SDL_UnlockSensors();
|
||||
return NULL;
|
||||
|
@ -57,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
if (!SDLTest_CommonInit(state)) {
|
||||
goto onerror;
|
||||
}
|
||||
dialog = SDL_calloc(sizeof(dropfile_dialog), 1);
|
||||
dialog = SDL_calloc(1, sizeof(dropfile_dialog));
|
||||
if (!dialog) {
|
||||
goto onerror;
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ static int createInstance(VulkanVideoContext *context)
|
||||
{
|
||||
uint32_t extensionCount;
|
||||
if (context->vkEnumerateInstanceExtensionProperties(NULL, &extensionCount, NULL) == VK_SUCCESS && extensionCount > 0) {
|
||||
VkExtensionProperties *extensionProperties = SDL_calloc(sizeof(VkExtensionProperties), extensionCount);
|
||||
VkExtensionProperties *extensionProperties = SDL_calloc(extensionCount, sizeof(VkExtensionProperties));
|
||||
if (context->vkEnumerateInstanceExtensionProperties(NULL, &extensionCount, extensionProperties) == VK_SUCCESS) {
|
||||
for (uint32_t i = 0; i < SDL_arraysize(optional_extensions); ++i) {
|
||||
for (uint32_t j = 0; j < extensionCount; ++j) {
|
||||
@ -595,7 +595,7 @@ static int createDevice(VulkanVideoContext *context)
|
||||
{
|
||||
uint32_t extensionCount;
|
||||
if (context->vkEnumerateDeviceExtensionProperties(context->physicalDevice, NULL, &extensionCount, NULL) == VK_SUCCESS && extensionCount > 0) {
|
||||
VkExtensionProperties *extensionProperties = SDL_calloc(sizeof(VkExtensionProperties), extensionCount);
|
||||
VkExtensionProperties *extensionProperties = SDL_calloc(extensionCount, sizeof(VkExtensionProperties));
|
||||
if (context->vkEnumerateDeviceExtensionProperties(context->physicalDevice, NULL, &extensionCount, extensionProperties) == VK_SUCCESS) {
|
||||
for (uint32_t i = 0; i < SDL_arraysize(optional_extensions); ++i) {
|
||||
for (uint32_t j = 0; j < extensionCount; ++j) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user