appwiz.cpl: Removed sign comparison warning
Nikolay Sivov
nsivov at codeweavers.com
Sat Aug 21 06:04:04 CDT 2010
On 8/21/2010 12:18, Marko Nikolic wrote:
> Nikolay Sivov wrote:
>
>> On 8/20/2010 20:04, Marko Nikolic wrote:
>>> Changed variable type to match function return type.
>>> ---
>>> dlls/appwiz.cpl/appwiz.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c
>>> index ffd2b24..1b3370b 100644
>>> --- a/dlls/appwiz.cpl/appwiz.c
>>> +++ b/dlls/appwiz.cpl/appwiz.c
>>> @@ -406,7 +406,7 @@ static void UpdateButtons(HWND hWnd)
>>> {
>>> APPINFO *iter;
>>> LVITEMW lvItem;
>>> - DWORD selitem = SendDlgItemMessageW(hWnd, IDL_PROGRAMS,
>>> LVM_GETNEXTITEM, -1,
>>> + LRESULT selitem = SendDlgItemMessageW(hWnd, IDL_PROGRAMS,
>>> LVM_GETNEXTITEM, -1,
>>> LVNI_FOCUSED | LVNI_SELECTED);
>>> BOOL enable_modify = FALSE;
>>>
>> There's no need for that, return value means integer item index. What
>> are you fixing with that?
> Hi Nikolay,
>
> The above change suppresses sign comparison warning in the line
>
> if (selitem != -1) ...
>
> and two more places below. selitem is declared as unsigned (DWORD), so
> comparing with -1 produces warning. Since SendDlgItemMessageW anyway return
> LRESULT which is signed integer, patch changes the variable type to match
> function result and removes sign warnings.
LRESULT is something that supposed to work anyway as I understand it,
for this case I think it's
better to cast function return value to INT and use INT as a local type.
> BR,
>
> Marko
>
>
More information about the wine-devel
mailing list