From 7cf3f604fb102ba67ce3abe7e97440b4ed0da92e Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 19 May 2020 13:20:32 -0700 Subject: preprocessor: Random cleanups This fixes a bunch of poorly formatted decls, marks some getters as PURE, deletes some C-relevant bool hackery, and finally uses a passed-in location rather than deducing a closely-related but not necessarily the same location. * include/cpplib.h (cpp_get_otions, cpp_get_callbacks) (cpp_get_deps): Mark as PURE. * include/line-map.h (get_combined_adhoc_loc) (get_location_from_adhoc_loc, get_pure_location): Reformat decls. * internal.h (struct lexer_state): Clarify comment. * system.h: Remove now-unneeded bool hackery. * files.c (_cpp_find_file): Store LOC not highest_location. --- libcpp/files.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libcpp/files.c') diff --git a/libcpp/files.c b/libcpp/files.c index 260e787..f25b58d 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -635,7 +635,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, entry = new_file_hash_entry (pfile); entry->next = (struct cpp_file_hash_entry *) *hash_slot; entry->start_dir = start_dir; - entry->location = pfile->line_table->highest_location; + entry->location = loc; entry->u.file = file; *hash_slot = (void *) entry; @@ -648,7 +648,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, entry = new_file_hash_entry (pfile); entry->next = (struct cpp_file_hash_entry *) *hash_slot; entry->start_dir = pfile->bracket_include; - entry->location = pfile->line_table->highest_location; + entry->location = loc; entry->u.file = file; *hash_slot = (void *) entry; } @@ -659,7 +659,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, entry = new_file_hash_entry (pfile); entry->next = (struct cpp_file_hash_entry *) *hash_slot; entry->start_dir = pfile->quote_include; - entry->location = pfile->line_table->highest_location; + entry->location = loc; entry->u.file = file; *hash_slot = (void *) entry; } -- cgit v1.1