[PATCH v2 3/5] windows.media.speech: Initialize HRESULT variables consistently.

Rémi Bernon wine at gitlab.winehq.org
Wed Apr 27 14:14:38 CDT 2022


From: Rémi Bernon <rbernon at codeweavers.com>

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/windows.media.speech/async.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/dlls/windows.media.speech/async.c b/dlls/windows.media.speech/async.c
index bc5d4fa40ed..3b532502ea2 100644
--- a/dlls/windows.media.speech/async.c
+++ b/dlls/windows.media.speech/async.c
@@ -176,16 +176,13 @@ static HRESULT WINAPI async_operation_get_Completed( IAsyncOperation_IInspectabl
                                                      IAsyncOperationCompletedHandler_IInspectable **handler )
 {
     struct async_operation *impl = impl_from_IAsyncOperation_IInspectable(iface);
-    HRESULT hr;
+    HRESULT hr = S_OK;
 
     FIXME("iface %p, handler %p semi stub!\n", iface, handler);
 
     EnterCriticalSection(&impl->cs);
     if (impl->status == Closed)
         hr = E_ILLEGAL_METHOD_CALL;
-    else
-        hr = S_OK;
-
     *handler = (impl->handler != HANDLER_NOT_SET) ? impl->handler : NULL;
     LeaveCriticalSection(&impl->cs);
 
@@ -249,16 +246,13 @@ static HRESULT WINAPI async_operation_info_get_Id( IAsyncInfo *iface, UINT32 *id
 static HRESULT WINAPI async_operation_info_get_Status( IAsyncInfo *iface, AsyncStatus *status )
 {
     struct async_operation *impl = impl_from_IAsyncInfo(iface);
-    HRESULT hr;
+    HRESULT hr = S_OK;
 
     TRACE("iface %p, status %p.\n", iface, status);
 
     EnterCriticalSection(&impl->cs);
     if (impl->status == Closed)
         hr = E_ILLEGAL_METHOD_CALL;
-    else
-        hr = S_OK;
-
     *status = impl->status;
     LeaveCriticalSection(&impl->cs);
 
@@ -285,10 +279,9 @@ static HRESULT WINAPI async_operation_info_get_ErrorCode( IAsyncInfo *iface, HRE
 static HRESULT WINAPI async_operation_info_Cancel( IAsyncInfo *iface )
 {
     struct async_operation *impl = impl_from_IAsyncInfo(iface);
-    HRESULT hr;
+    HRESULT hr = S_OK;
 
     TRACE("iface %p.\n", iface);
-    hr = S_OK;
 
     EnterCriticalSection(&impl->cs);
     if (impl->status == Closed)
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/5



More information about the wine-devel mailing list