Code comment

zhaozj2021-02-16  98

I just started thinking of code comments, nothing special, but now, my idea is really wrong.

Code comments, there are also very special places, the following is a few special comments.

1 Plus / * FallthRough * / annotation before the CASE statement.

Case 10: / * yy * / lt-> TM_Year = ATOI2 (P); if (lt-> tm_year <69) / * Hack for 2000; -} * / lt-> tm_year = 100; / * FallthRough * / Case 8: / * mm * / lt-> TM_MON = ATOI2 (P); 2, with NotReached Comments. This annotation is used in places that never perform.

SIZE_T STRCSPN (Const Char * S1, Const Char * S2) {Register Const Char * P, * Spanp; Register Char C, SC; / * * Stop as Soon as We Find Any Character from S2. Note * That There Must Be A NUL INS2; IT Suffices To Stop * When We Find That, TOO. * / For (P = S1 ;;) {c = * p ; spanp = S2; DO {IF ((SC = * spanp ) == c) Return (p - 1 - s1);} while (sc! = 0);} / * notreached * /} 3, using XXX in the comment, this situation is used to mark those incorrect, but can run normally.

/ * XXX IS this Correct? * / V_evaluate (VQ, S, FALSE); 4, tag fixme is used to comment on blocks that have been determined and modified.

Switch (* regParse ) {/ * fixme: these Chars Only Have meaning at beg / end of pat? * / case '^':

5, the last, TODO is used to mark blocks that need to enhance function.

/ * * Todo - Sort Output * / Int Aliascmd (Argc, Argv)

The above is seen from "code recation", the book is really good. The things you have learned are really much.

转载请注明原文地址:https://www.9cbs.com/read-11738.html

New Post(0)