```c programs/explorer/desktop.c:104:16: warning: ‘hres’ may be used uninitialized in this function [-Wmaybe-uninitialized] 104 | return hres; | ^~~~ ```
From: Davide Beatrici git@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;