From 4623a6f2d026b6b6dcd4c9b6f26e96cf5e52b4ac Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 20 May 2020 06:21:10 -0700 Subject: preprocessor: Replace some flags with a single enum _cpp_find_file has 3 bool arguments, at most one of which is ever set. Ripe for replacing with a 4-state enum. Also, this is C++, so 'typedef struct Foo Foo' is unnecessary. * internal.h (typedef _cpp_file): Delete, unnecessary in C++. (enum _cpp_find_file_kind): New. (_cpp_find_file): Use it, not 3 bools. * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not bools. (cpp_make_system_header): Break overly long line. (_cpp_stack_include, _cpp_fake_include) (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust. * init.c (cpp_read_main): Adjust _cpp_find_file call. --- libcpp/init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libcpp/init.c') diff --git a/libcpp/init.c b/libcpp/init.c index 1f8996af47f..63124c8161e 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -662,8 +662,6 @@ cpp_post_options (cpp_reader *pfile) const char * cpp_read_main_file (cpp_reader *pfile, const char *fname) { - const location_t loc = 0; - if (CPP_OPTION (pfile, deps.style) != DEPS_NONE) { if (!pfile->deps) @@ -675,8 +673,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname) pfile->main_file = _cpp_find_file (pfile, fname, &pfile->no_search_path, /*angle=*/0, - /*fake=*/false, /*preinclude=*/false, /*hasinclude=*/false, - loc); + _cpp_FFK_NORMAL, 0); if (_cpp_find_failed (pfile->main_file)) return NULL; -- cgit v1.2.1