From d87fc699839f068bc14ea189bc2aba4afc986a9c Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 22 Sep 2014 21:43:02 +0200 Subject: [PATCH] charset.c (conversion): Rename to ... * charset.c (conversion): Rename to ... (cpp_conversion): ... this one; update. * files.c (file_hash_entry): Rename to ... (cpp_file_hash_entry): ... this one ; update. From-SVN: r215482 --- libcpp/ChangeLog | 7 +++++++ libcpp/charset.c | 4 ++-- libcpp/files.c | 52 ++++++++++++++++++++++++------------------------ 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 77713476d4c..a1c117a02bf 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2014-09-17 Jan Hubicka + + * charset.c (conversion): Rename to ... + (cpp_conversion): ... this one; update. + * files.c (file_hash_entry): Rename to ... + (cpp_file_hash_entry): ... this one ; update. + 2014-09-17 Marek Polacek PR c/61854 diff --git a/libcpp/charset.c b/libcpp/charset.c index 07a594d4db4..b766eec8b22 100644 --- a/libcpp/charset.c +++ b/libcpp/charset.c @@ -608,13 +608,13 @@ convert_using_iconv (iconv_t cd, const uchar *from, size_t flen, #define APPLY_CONVERSION(CONVERTER, FROM, FLEN, TO) \ CONVERTER.func (CONVERTER.cd, FROM, FLEN, TO) -struct conversion +struct cpp_conversion { const char *pair; convert_f func; iconv_t fake_cd; }; -static const struct conversion conversion_tab[] = { +static const struct cpp_conversion conversion_tab[] = { { "UTF-8/UTF-32LE", convert_utf8_utf32, (iconv_t)0 }, { "UTF-8/UTF-32BE", convert_utf8_utf32, (iconv_t)1 }, { "UTF-8/UTF-16LE", convert_utf8_utf16, (iconv_t)0 }, diff --git a/libcpp/files.c b/libcpp/files.c index 91bc9dd0782..a442783f1d1 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -50,7 +50,7 @@ along with this program; see the file COPYING3. If not see /* This structure represents a file searched for by CPP, whether it exists or not. An instance may be pointed to by more than one - file_hash_entry; at present no reference count is kept. */ + cpp_file_hash_entry; at present no reference count is kept. */ struct _cpp_file { /* Filename as given to #include or command line switch. */ @@ -140,9 +140,9 @@ struct _cpp_file have to do more work re-preprocessing the file, and/or comparing its contents against earlier once-only files. */ -struct file_hash_entry +struct cpp_file_hash_entry { - struct file_hash_entry *next; + struct cpp_file_hash_entry *next; cpp_dir *start_dir; source_location location; union @@ -152,10 +152,10 @@ struct file_hash_entry } u; }; -/* Number of entries to put in a file_hash_entry pool. */ +/* Number of entries to put in a cpp_file_hash_entry pool. */ #define FILE_HASH_POOL_SIZE 127 -/* A file hash entry pool. We allocate file_hash_entry object from +/* A file hash entry pool. We allocate cpp_file_hash_entry object from one of these. */ struct file_hash_entry_pool { @@ -164,7 +164,7 @@ struct file_hash_entry_pool /* Next pool in the chain; used when freeing. */ struct file_hash_entry_pool *next; /* The memory pool. */ - struct file_hash_entry pool[FILE_HASH_POOL_SIZE]; + struct cpp_file_hash_entry pool[FILE_HASH_POOL_SIZE]; }; static bool open_file (_cpp_file *file); @@ -179,13 +179,13 @@ static struct cpp_dir *search_path_head (cpp_reader *, const char *fname, int angle_brackets, enum include_type); static const char *dir_name_of_file (_cpp_file *file); static void open_file_failed (cpp_reader *pfile, _cpp_file *file, int); -static struct file_hash_entry *search_cache (struct file_hash_entry *head, +static struct cpp_file_hash_entry *search_cache (struct cpp_file_hash_entry *head, const cpp_dir *start_dir); static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname); static void destroy_cpp_file (_cpp_file *); static cpp_dir *make_cpp_dir (cpp_reader *, const char *dir_name, int sysp); static void allocate_file_hash_entries (cpp_reader *pfile); -static struct file_hash_entry *new_file_hash_entry (cpp_reader *pfile); +static struct cpp_file_hash_entry *new_file_hash_entry (cpp_reader *pfile); static int report_missing_guard (void **slot, void *b); static hashval_t file_hash_hash (const void *p); static int file_hash_eq (const void *p, const void *q); @@ -498,7 +498,7 @@ _cpp_file * _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake, int angle_brackets, bool implicit_preinclude) { - struct file_hash_entry *entry; + struct cpp_file_hash_entry *entry; void **hash_slot; _cpp_file *file; bool invalid_pch = false; @@ -515,7 +515,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, htab_hash_string (fname), INSERT); /* First check the cache before we resort to memory allocation. */ - entry = search_cache ((struct file_hash_entry *) *hash_slot, start_dir); + entry = search_cache ((struct cpp_file_hash_entry *) *hash_slot, start_dir); if (entry) return entry->u.file; @@ -588,7 +588,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, else continue; - entry = search_cache ((struct file_hash_entry *) *hash_slot, file->dir); + entry = search_cache ((struct cpp_file_hash_entry *) *hash_slot, file->dir); if (entry) { found_in_cache = file->dir; @@ -612,7 +612,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, /* Store this new result in the hash table. */ entry = new_file_hash_entry (pfile); - entry->next = (struct file_hash_entry *) *hash_slot; + entry->next = (struct cpp_file_hash_entry *) *hash_slot; entry->start_dir = start_dir; entry->location = pfile->line_table->highest_location; entry->u.file = file; @@ -625,7 +625,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, && found_in_cache != pfile->bracket_include) { entry = new_file_hash_entry (pfile); - entry->next = (struct file_hash_entry *) *hash_slot; + entry->next = (struct cpp_file_hash_entry *) *hash_slot; entry->start_dir = pfile->bracket_include; entry->location = pfile->line_table->highest_location; entry->u.file = file; @@ -636,7 +636,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, && found_in_cache != pfile->quote_include) { entry = new_file_hash_entry (pfile); - entry->next = (struct file_hash_entry *) *hash_slot; + entry->next = (struct cpp_file_hash_entry *) *hash_slot; entry->start_dir = pfile->quote_include; entry->location = pfile->line_table->highest_location; entry->u.file = file; @@ -1058,8 +1058,8 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets) /* Search in the chain beginning at HEAD for a file whose search path started at START_DIR != NULL. */ -static struct file_hash_entry * -search_cache (struct file_hash_entry *head, const cpp_dir *start_dir) +static struct cpp_file_hash_entry * +search_cache (struct cpp_file_hash_entry *head, const cpp_dir *start_dir) { while (head && head->start_dir != start_dir) head = head->next; @@ -1114,10 +1114,10 @@ destroy_all_cpp_files (cpp_reader *pfile) static cpp_dir * make_cpp_dir (cpp_reader *pfile, const char *dir_name, int sysp) { - struct file_hash_entry *entry, **hash_slot; + struct cpp_file_hash_entry *entry, **hash_slot; cpp_dir *dir; - hash_slot = (struct file_hash_entry **) + hash_slot = (struct cpp_file_hash_entry **) htab_find_slot_with_hash (pfile->dir_hash, dir_name, htab_hash_string (dir_name), INSERT); @@ -1156,7 +1156,7 @@ allocate_file_hash_entries (cpp_reader *pfile) } /* Return a new file hash entry. */ -static struct file_hash_entry * +static struct cpp_file_hash_entry * new_file_hash_entry (cpp_reader *pfile) { unsigned int idx; @@ -1186,9 +1186,9 @@ free_file_hash_entries (cpp_reader *pfile) bool cpp_included (cpp_reader *pfile, const char *fname) { - struct file_hash_entry *entry; + struct cpp_file_hash_entry *entry; - entry = (struct file_hash_entry *) + entry = (struct cpp_file_hash_entry *) htab_find_with_hash (pfile->file_hash, fname, htab_hash_string (fname)); while (entry && (entry->start_dir == NULL || entry->u.file->err_no)) @@ -1204,9 +1204,9 @@ bool cpp_included_before (cpp_reader *pfile, const char *fname, source_location location) { - struct file_hash_entry *entry; + struct cpp_file_hash_entry *entry; - entry = (struct file_hash_entry *) + entry = (struct cpp_file_hash_entry *) htab_find_with_hash (pfile->file_hash, fname, htab_hash_string (fname)); while (entry && (entry->start_dir == NULL || entry->u.file->err_no @@ -1221,7 +1221,7 @@ cpp_included_before (cpp_reader *pfile, const char *fname, static hashval_t file_hash_hash (const void *p) { - struct file_hash_entry *entry = (struct file_hash_entry *) p; + struct cpp_file_hash_entry *entry = (struct cpp_file_hash_entry *) p; const char *hname; if (entry->start_dir) hname = entry->u.file->name; @@ -1235,7 +1235,7 @@ file_hash_hash (const void *p) static int file_hash_eq (const void *p, const void *q) { - struct file_hash_entry *entry = (struct file_hash_entry *) p; + struct cpp_file_hash_entry *entry = (struct cpp_file_hash_entry *) p; const char *fname = (const char *) q; const char *hname; @@ -1339,7 +1339,7 @@ struct report_missing_guard_data static int report_missing_guard (void **slot, void *d) { - struct file_hash_entry *entry = (struct file_hash_entry *) *slot; + struct cpp_file_hash_entry *entry = (struct cpp_file_hash_entry *) *slot; struct report_missing_guard_data *data = (struct report_missing_guard_data *) d; -- 2.30.2