Module: vkd3d Branch: master Commit: 5fe3c624d50b5a01badd70772cfe8fb24fab7157 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/5fe3c624d50b5a01badd70772cfe8f...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Jan 18 19:50:00 2024 +0100
vkd3d-common: Use vkd3d_atomic_increment_u32() in get_buffer().
---
libs/vkd3d-common/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-common/debug.c b/libs/vkd3d-common/debug.c index aa7df5bd..e12cd394 100644 --- a/libs/vkd3d-common/debug.c +++ b/libs/vkd3d-common/debug.c @@ -126,10 +126,10 @@ void vkd3d_dbg_set_log_callback(PFN_vkd3d_log callback) static char *get_buffer(void) { static char buffers[VKD3D_DEBUG_BUFFER_COUNT][VKD3D_DEBUG_BUFFER_SIZE]; - static LONG buffer_index; - LONG current_index; + static unsigned int buffer_index; + unsigned int current_index;
- current_index = InterlockedIncrement(&buffer_index) % ARRAY_SIZE(buffers); + current_index = vkd3d_atomic_increment_u32(&buffer_index) % ARRAY_SIZE(buffers); return buffers[current_index]; }