Alexandre Julliard : ntdll: Fixed a compiler warning for size_t/ unsigned int mismatch.

Alexandre Julliard julliard at winehq.org
Sat Mar 10 10:45:03 CST 2007


Francois Gouget <fgouget at free.fr> writes:

> On Fri, 9 Mar 2007, Alexandre Julliard wrote:
> [...]
>>  void * __cdecl _lfind( const void *key, const void *base, unsigned int *nmemb,
>> -                       unsigned int size, int(*compar)(const void *, const void *) )
>> +                       size_t size, int(*compar)(const void *, const void *) )
>>  {
>> -    return lfind( key, base, nmemb, size, compar );
>> +    size_t n = *nmemb;
>> +    return lfind( key, base, &n, size, compar );
>>  }
>
> The problem is that Microsoft's _lfind() takes an 'unsigned int' and not 
> a size_t. Or, more precisely, the msvcrt one declared in search.h does. 
> There's no official prototype for the ntdll implementation that I 
> know of, but I'd expect it to have the same prototype.
>
> So my understanding is that replacing this parameter type with a size_t 
> could be a problem on 64bit systems.

Yes, that's why I left *nmemb as an unsigned int. For parameters
passed by value it doesn't matter, the compiler will expand things as
needed.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list