[dfu-util] New dfu-suffix manipulation tool

Patryk Benderz Patryk.Benderz at esp.pl
Thu Mar 1 17:09:40 CET 2012


[cut]
> Well, good practices is in the eye of the beholder. :)
To quote Sheldon's mother from "Big Bang Theory": "And that is your opinion." ;)

> Why should they be in a define? The compiler detects if the variables
> are constant and optimizes this case anyway.
I take that argument. I was not aware that present compilers do such
job. It was long ago (20 years) when was interested how compilers work,
and it was Pascal compilers at the beginning.

[cut]
>  For the case that one
> should avoid magic values like 16 here with a named constant I would
> agree. I was just to lazy for doing it here. :)
In fact you were the hard-working one. Lazy was I, who just wrote a
comment instead of writing a code itself.

[cut]
> "The offsets are negative. This is a file suffix, and the negative
> offsets indicate that the last byte of the file is specified in the dwCRC field"
OK, now I get the negative offsets idea, thanks :)

> Other tools have been able to decode a suffix I added with this code.
...well, since you say so, I have no more concern.

[cut]
> Maybe I'm biased due to some kernel work here but in my opinion it
> looks cleaner and is easier to understand instead of repeating the
> failure code all the time.
I understand. Probably compiler also takes care of that, right?

-- 
Patryk "LeadMan" Benderz
Linux Registered User #377521
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments




More information about the devel mailing list