blacksimit [off-list ref] writes:
-
+ int magic_num;
+
+ magic_num = strlen("tree "); /* magic_num is 5 */
if (!starts_with(buffer, "tree "))
Whitespace damage. It seems you have set your tab-width to something
other than 8, and indented with spaces. Please don't do either.
+ magic_num = strlen("committer"); /* magic_num is 7 */
Typical example of a counter-productive comment. A good comment usually
explains _why_ the code is as it is, and not _what_ it is doing. C is a
much better lanuage than english to describe algorithm, so if you want
magic_num to become equal to 7, then write "magic_num = 7" in code, not
in a comment.
Here, the reader has to spend time and energy to check the
correspondance between the code and the redundant comment ... and see
than they do not match!
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/