Pointer as bool (libsdl-org#7214)
This commit is contained in:
@@ -293,7 +293,7 @@ static void findPhysicalDevice(void)
|
||||
quit(2);
|
||||
}
|
||||
physicalDevices = (VkPhysicalDevice *)SDL_malloc(sizeof(VkPhysicalDevice) * physicalDeviceCount);
|
||||
if (physicalDevices == NULL) {
|
||||
if (!physicalDevices) {
|
||||
SDL_OutOfMemory();
|
||||
quit(2);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ static void findPhysicalDevice(void)
|
||||
SDL_free(queueFamiliesProperties);
|
||||
queueFamiliesPropertiesAllocatedSize = queueFamiliesCount;
|
||||
queueFamiliesProperties = (VkQueueFamilyProperties *)SDL_malloc(sizeof(VkQueueFamilyProperties) * queueFamiliesPropertiesAllocatedSize);
|
||||
if (queueFamiliesProperties == NULL) {
|
||||
if (!queueFamiliesProperties) {
|
||||
SDL_free(physicalDevices);
|
||||
SDL_free(deviceExtensions);
|
||||
SDL_OutOfMemory();
|
||||
@@ -389,7 +389,7 @@ static void findPhysicalDevice(void)
|
||||
SDL_free(deviceExtensions);
|
||||
deviceExtensionsAllocatedSize = deviceExtensionCount;
|
||||
deviceExtensions = SDL_malloc(sizeof(VkExtensionProperties) * deviceExtensionsAllocatedSize);
|
||||
if (deviceExtensions == NULL) {
|
||||
if (!deviceExtensions) {
|
||||
SDL_free(physicalDevices);
|
||||
SDL_free(queueFamiliesProperties);
|
||||
SDL_OutOfMemory();
|
||||
@@ -918,7 +918,7 @@ static void initVulkan(void)
|
||||
SDL_Vulkan_LoadLibrary(NULL);
|
||||
|
||||
vulkanContexts = (VulkanContext *)SDL_calloc(state->num_windows, sizeof(VulkanContext));
|
||||
if (vulkanContexts == NULL) {
|
||||
if (!vulkanContexts) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!");
|
||||
quit(2);
|
||||
}
|
||||
@@ -1079,7 +1079,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
|
||||
if (state == NULL) {
|
||||
if (!state) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user