appwiz.cpl: Removed sign comparison warning

Marko Nikolic grkoma at gmail.com
Sat Aug 21 03:18:38 CDT 2010


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.

BR,

Marko





More information about the wine-devel mailing list