Skip to content
Snippets Groups Projects
Commit fbf6812d authored by Andrew Cooks's avatar Andrew Cooks
Browse files

add cleanup to remove dead code comments

Remove comments like
 /* foo(bar); */
and
 /* foo->bar = baz; */
and
 /* foo = bar->baz; */

This doesn't get rid of all dead code. As usual the result was visually
checked for false positives to ensure that no accidental content
removals occurred.

(cherry picked from commit f2d0a35a)
parent 3ea47f42
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,15 @@ sed -i 's|\(\s\+\)RET(\(.*\));|\1return \2;|' *.c
sed -i 's|.*#define\s\+RET\(.*\).*||' *.h
# remove dead code disguised as comments
# weed out function calls first
sed -i 's|/\*\s*.*(.*);.*\*/||g' *.c *.h
# weed out assignments involving struct members
sed -i 's|/\*\s*.*\..*=.*;.*\*/||g' *.c *.h
sed -i 's|/\*\s*.*->.*=.*;.*\*/||g' *.c *.h
sed -i 's|/\*\s*.*=.*->.*;.*\*/||g' *.c *.h
# Insert new cleanup steps above this comment.
# Keep Lindent as the last step.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment