winedump: Add initial version of old (SLTG) typelib dumper.

Alexandre Julliard julliard at winehq.org
Fri Dec 25 02:02:19 CST 2015


Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Alexandre Julliard <julliard at winehq.org> wrote:
>
>> > +static int _isprint(unsigned char c)
>> >  {
>> > -    int i;
>> > +    return c >= 32 ? 1 : 0;
>> 
>> Please don't do that.
>
> Could you please be more specific?

The ? 1 : 0 is just noise.

>> > +    assert(print_hex("magic") == 0x47544c53);
>> 
>> Please don't do that.
>
> Once again please be more verbose, I can't read your mind. But as a guess
> you didn't like the assert()? What's wrong with this one in comparison to
> many others in this file?

There's a fundamental difference, think about it for a while (hint:
consider what happens with -DNDEBUG).

>> > +#if 0
>> > +    print_short_hex("unknown");
>> > +    print_short_hex("byte order mark");
>> > +    i = tlb_read_short();
>> > +    printf("version = %u.%u\n", i & 0xff, i >> 8);
>> > +    print_short_hex("system identifier");
>> > +    print_hex("unknown");
>> > +    printf("\n");
>> > +#else
>> > +    printf("skipping 12 bytes\n");
>> > +    dump_binary(12);
>> > +    printf("\n");
>> > +#endif
>> 
>> Same here.
>
> Since this is a work in progress the intent was to show that the format of
> this block is unknown and there is at least another source of information
> that treats it differently. I'd prefer to leave this as a self documenting
> explanation.

A #if 0 doesn't really explain anything. If you are not sure about the
format, a FIXME comment instead would be better.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list