[PATCH 0/1] MR2863: explorer: Fix uninitialized variable warning.
```c programs/explorer/desktop.c:104:16: warning: ‘hres’ may be used uninitialized in this function [-Wmaybe-uninitialized] 104 | return hres; | ^~~~ ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2863
From: Davide Beatrici <git(a)davidebeatrici.dev> programs/explorer/desktop.c:104:16: warning: ‘hres’ may be used uninitialized in this function [-Wmaybe-uninitialized] 104 | return hres; | ^~~~ --- programs/explorer/desktop.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 81eb0d1d01b..6c190ca3bbf 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -96,17 +96,16 @@ static HRESULT load_typelib(void) static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) { - HRESULT hres; - - if (!typelib) - hres = load_typelib(); - if (!typelib) - return hres; + if (!typelib) { + const HRESULT hres = load_typelib(); + if (!typelib) + return hres; + } if (!typeinfos[tid]) { ITypeInfo *ti; - hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti); + const HRESULT hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti); if (FAILED(hres)) { ERR("GetTypeInfoOfGuid(%s) failed: %08lx\n", debugstr_guid(tid_ids[tid]), hres); return hres; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2863
participants (2)
-
Davide Beatrici -
Davide Beatrici (@davidebeatrici)