winedump: sign-compare fixes

richardvoigt at gmail.com richardvoigt at gmail.com
Wed Feb 7 20:44:36 CST 2007


On 2/7/07, Dmitry Timoshkov <dmitry at codeweavers.com> wrote:
> "Joris Huizer" <joris_huizer at yahoo.com> wrote:
>
> > -static const MINIDUMP_DIRECTORY* get_mdmp_dir(const MINIDUMP_HEADER* hdr, int str_idx)
> > +static const MINIDUMP_DIRECTORY* get_mdmp_dir(const MINIDUMP_HEADER* hdr,unsigned long int str_idx)
>
> Please keep white space unchanged.
>
> > -    while (ptr - (const unsigned char*)table < len)
> > +    while ((unsigned long)(ptr - (const unsigned char*)table) < len)
>
> > -    int     i, length;
> > +    unsigned long int     i, length;
>
> > -    while (file - (const char*)symbols < sizeof(PDB_SYMBOLS) + symbols->module_size)
> > +    while ((unsigned long int)(file - (const char*)symbols) < sizeof(PDB_SYMBOLS) + symbols->module_size)
>
> Your changes are inconsistent: sometimes you change 'int' to 'unsigned long int',
> sometimes to 'unsigned long'. Why not change 'int' simply to 'unsigned'?
>

Seeing int extended to unsigned long like this makes me question
whether the correct type wouldn't be size_t.... especially as it is
compared to sizeof(...)

> --
> Dmitry.
>
>
>



More information about the wine-devel mailing list