Re: [PATCH v2] Rewrite fsck.c:fsck_commit() replace memcmp() with starts_with()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



blacksimit <cengoguzhanunlu@xxxxxxxxx> 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]