Make qsort invocations type independent
This commit is contained in:
parent
6a126fa18e
commit
d9f90ef077
2
glfw/linux_joystick.c
vendored
2
glfw/linux_joystick.c
vendored
@ -315,7 +315,7 @@ bool _glfwInitJoysticksLinux(void)
|
||||
|
||||
// Continue with no joysticks if enumeration fails
|
||||
|
||||
qsort(_glfw.joysticks, count, sizeof(_GLFWjoystick), compareJoysticks);
|
||||
qsort(_glfw.joysticks, count, sizeof(_glfw.joysticks[0]), compareJoysticks);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
2
glfw/monitor.c
vendored
2
glfw/monitor.c
vendored
@ -74,7 +74,7 @@ static bool refreshVideoModes(_GLFWmonitor* monitor)
|
||||
if (!modes)
|
||||
return false;
|
||||
|
||||
qsort(modes, modeCount, sizeof(GLFWvidmode), compareVideoModes);
|
||||
qsort(modes, modeCount, sizeof(modes[0]), compareVideoModes);
|
||||
|
||||
free(monitor->modes);
|
||||
monitor->modes = modes;
|
||||
|
||||
@ -131,7 +131,7 @@ apply_storage_quota(GraphicsManager *self, size_t storage_limit, id_type current
|
||||
remove_images(self, trim_predicate, currently_added_image_internal_id);
|
||||
if (self->used_storage < storage_limit) return;
|
||||
|
||||
qsort(self->images, self->image_count, sizeof(Image), oldest_last);
|
||||
qsort(self->images, self->image_count, sizeof(self->images[0]), oldest_last);
|
||||
while (self->used_storage > storage_limit && self->image_count > 0) {
|
||||
remove_image(self, self->image_count - 1);
|
||||
}
|
||||
@ -576,7 +576,7 @@ grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float scree
|
||||
}}
|
||||
if (!self->count) return false;
|
||||
// Sort visible refs in draw order (z-index, img)
|
||||
qsort(self->render_data, self->count, sizeof(ImageRenderData), cmp_by_zindex_and_image);
|
||||
qsort(self->render_data, self->count, sizeof(self->render_data[0]), cmp_by_zindex_and_image);
|
||||
// Calculate the group counts
|
||||
i = 0;
|
||||
while (i < self->count) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user