From: Józef Kucia jkucia@codeweavers.com
For consitency.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- include/vkd3d.h | 6 ++---- include/vkd3d_utils.h | 2 +- libs/vkd3d-utils/vkd3d_utils_main.c | 6 +++--- libs/vkd3d/command.c | 5 +++-- programs/vkd3d-compiler/main.c | 1 + tests/vkd3d_api.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/vkd3d.h b/include/vkd3d.h index 7c5f6441e9d9..d089ada56b72 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -28,8 +28,6 @@ # include <vulkan/vulkan.h> #endif /* VKD3D_NO_VULKAN_H */
-#include <stdbool.h> - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -45,12 +43,12 @@ enum vkd3d_structure_type VKD3D_FORCE_32_BIT_ENUM(VKD3D_STRUCTURE_TYPE), };
-typedef bool (*PFN_vkd3d_signal_event)(HANDLE event); +typedef HRESULT (*PFN_vkd3d_signal_event)(HANDLE event);
typedef void * (*PFN_vkd3d_thread)(void *data);
typedef void * (*PFN_vkd3d_create_thread)(PFN_vkd3d_thread thread_main, void *data); -typedef bool (*PFN_vkd3d_join_thread)(void *thread); +typedef HRESULT (*PFN_vkd3d_join_thread)(void *thread);
struct vkd3d_instance;
diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h index 06b01fc9bf80..676d3330ed5e 100644 --- a/include/vkd3d_utils.h +++ b/include/vkd3d_utils.h @@ -31,7 +31,7 @@ extern "C" { #define INFINITE (~0u)
HANDLE vkd3d_create_event(void); -bool vkd3d_signal_event(HANDLE event); +HRESULT vkd3d_signal_event(HANDLE event); unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds); void vkd3d_destroy_event(HANDLE event);
diff --git a/libs/vkd3d-utils/vkd3d_utils_main.c b/libs/vkd3d-utils/vkd3d_utils_main.c index adafb00bddc8..3c0d13971b6c 100644 --- a/libs/vkd3d-utils/vkd3d_utils_main.c +++ b/libs/vkd3d-utils/vkd3d_utils_main.c @@ -159,7 +159,7 @@ unsigned int vkd3d_wait_event(HANDLE event, unsigned int milliseconds) return WAIT_FAILED; }
-bool vkd3d_signal_event(HANDLE event) +HRESULT vkd3d_signal_event(HANDLE event) { struct vkd3d_event *impl = event; int rc; @@ -169,13 +169,13 @@ bool vkd3d_signal_event(HANDLE event) if ((rc = pthread_mutex_lock(&impl->mutex))) { ERR("Failed to lock mutex, error %d.\n", rc); - return false; + return E_FAIL; } impl->is_signaled = true; pthread_cond_signal(&impl->cond); pthread_mutex_unlock(&impl->mutex);
- return true; + return S_OK; }
void vkd3d_destroy_event(HANDLE event) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 39094c24e913..d9ad8f3460b8 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -288,6 +288,7 @@ HRESULT vkd3d_fence_worker_start(struct vkd3d_fence_worker *worker, HRESULT vkd3d_fence_worker_stop(struct vkd3d_fence_worker *worker, struct d3d12_device *device) { + HRESULT hr; int rc;
TRACE("worker %p.\n", worker); @@ -305,9 +306,9 @@ HRESULT vkd3d_fence_worker_stop(struct vkd3d_fence_worker *worker,
if (device->join_thread) { - if (!device->join_thread(worker->u.handle)) + if (FAILED(hr = device->join_thread(worker->u.handle))) { - ERR("Failed to join fence worker thread.\n"); + ERR("Failed to join fence worker thread, hr %#x.\n", hr); return E_FAIL; } } diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index 89778b8838bf..2e6566882a66 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -17,6 +17,7 @@ */
#include <fcntl.h> +#include <stdbool.h> #include <stdio.h> #include <sys/stat.h> #include <unistd.h> diff --git a/tests/vkd3d_api.c b/tests/vkd3d_api.c index 439cb6364eb8..e2d9d014125a 100644 --- a/tests/vkd3d_api.c +++ b/tests/vkd3d_api.c @@ -54,10 +54,10 @@ static ULONG resource_get_internal_refcount(ID3D12Resource *resource) return vkd3d_resource_decref(resource); }
-static bool signal_event(HANDLE event) +static HRESULT signal_event(HANDLE event) { trace("Signal event %p.\n", event); - return true; + return S_OK; }
static const struct vkd3d_instance_create_info instance_default_create_info =