tools/gn: Fix errors found by Facebook's flint tool.
commitdc6279e30a3549ecb2fcab0596e05dc59d355d52
authortfarina <tfarina@chromium.org>
Mon, 2 Mar 2015 03:07:15 +0000 (1 19:07 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 2 Mar 2015 03:08:02 +0000 (2 03:08 +0000)
tree43b3b4821d645f1690a16348560202275e23a40c
parentd62d851ee66c30eb639d9309b7e17631bbbfd354
tools/gn: Fix errors found by Facebook's flint tool.

Example of warnings/errors/advices:
tools/gn/exec_process.h:5: Missing include guard. If you are ABSOLUTELY
sure that you don't want an include guard, then include a comment
containing override-include-guard in lieu of an include guard.
tools/gn/ninja_binary_target_writer.cc:50: Single-argument constructor
'IncludeWriter(PathOutput& path_output)' may inadvertently be used as a
type conversion constructor. Prefix the function with the 'explicit'
keyword to avoid this, or add an /* implicit */ comment to suppress this
warning.
tools/gn/standard_out.cc:98: Advice: Prefer `nullptr' to `NULL' in new
C++ code.  Unlike `NULL', `nullptr' can't accidentally be used in
arithmetic or as an integer. See
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf for
details.
tools/gn/tutorial/hello.cc:7: The associated header file of .cpp files
should be included before any other includes.
tools/gn/target_generator.h:16: Warning: Base class TargetGenerator has
virtual functions but a public non-virtual destructor.

The errors were found with the following command line:

$ flint --recusive tools/gn

And cleaned up until silenced with:
$ gn gen out-gn
$ ninja -C out-gn gn gn_unittests

BUG=None
TEST=see above
R=scottmg@chromium.org,brettw@chromium.org

Review URL: https://codereview.chromium.org/964203002

Cr-Commit-Position: refs/heads/master@{#318639}
25 files changed:
tools/gn/action_target_generator.h
tools/gn/binary_target_generator.h
tools/gn/builder.h
tools/gn/c_include_iterator.h
tools/gn/commands.cc
tools/gn/config_values_extractors.cc
tools/gn/copy_target_generator.h
tools/gn/exec_process.h
tools/gn/group_target_generator.h
tools/gn/input_file.h
tools/gn/input_file_manager.h
tools/gn/loader.h
tools/gn/ninja_binary_target_writer.cc
tools/gn/parse_tree.h
tools/gn/pattern.h
tools/gn/scope.cc
tools/gn/scope.h
tools/gn/scope_per_file_provider.h
tools/gn/setup.h
tools/gn/standard_out.cc
tools/gn/substitution_pattern.h
tools/gn/target_generator.h
tools/gn/test_with_scope.h
tools/gn/tutorial/hello.cc
tools/gn/unique_vector.h