From f65026e2fbba52b88a2b6cb94c64ab699cd2b044 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Wed, 24 Nov 2021 09:57:08 -0800 Subject: [PATCH] mscms: Fix uninitialized variable warning. Signed-off-by: Daniel Lehman --- ../dlls/mscms/profile.c:1140:9: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (profile->data) ret = *valid = TRUE; ^~~~~~~~~~~~~ ../dlls/mscms/profile.c:1142:12: note: uninitialized use occurs here return ret; ^~~ ../dlls/mscms/profile.c:1140:5: note: remove the 'if' if its condition is always true if (profile->data) ret = *valid = TRUE; ^~~~~~~~~~~~~~~~~~~ ../dlls/mscms/profile.c:1128:13: note: initialize the variable 'ret' to silence this warning BOOL ret; --- dlls/mscms/profile.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index 523476269f19..83bfcb501430 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -1125,7 +1125,6 @@ BOOL WINAPI IsColorProfileTagPresent( HPROFILE handle, TAGTYPE type, PBOOL prese */ BOOL WINAPI IsColorProfileValid( HPROFILE handle, PBOOL valid ) { - BOOL ret; struct profile *profile = grab_profile( handle ); TRACE( "( %p, %p )\n", handle, valid ); @@ -1137,9 +1136,9 @@ BOOL WINAPI IsColorProfileValid( HPROFILE handle, PBOOL valid ) release_profile( profile ); return FALSE; } - if (profile->data) ret = *valid = TRUE; + *valid = !!profile->data; release_profile( profile ); - return ret; + return *valid; } /****************************************************************************** -- 2.27.0