From 5433e40109e4d846c93a156160ec08edba34fed1 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 25 Sep 2018 09:13:59 +0200 Subject: [PATCH] Fix small coding style issues (PR fortran/87394). 2018-09-25 Martin Liska PR fortran/87394 * dbgcnt.c (dbg_cnt_process_single_pair): Return false instead of NULL. * dumpfile.c (dump_enable_all): Remove extra parenthesis. * gcov-tool.c: Declare the function with ATTRIBUTE_NORETURN. * godump.c (go_format_type): Remove extra parenthesis. 2018-09-25 Martin Liska PR fortran/87394 * decl.c (add_hidden_procptr_result): Simplify condition as we are in branch witch 'case1 || case2'. From-SVN: r264562 --- gcc/ChangeLog | 9 +++++++++ gcc/dbgcnt.c | 2 +- gcc/dumpfile.c | 4 ++-- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/decl.c | 2 +- gcc/gcov-tool.c | 2 +- gcc/godump.c | 2 +- 7 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5dcd16a1d4..e5891f6b7c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-09-25 Martin Liska + + PR fortran/87394 + * dbgcnt.c (dbg_cnt_process_single_pair): Return false + instead of NULL. + * dumpfile.c (dump_enable_all): Remove extra parenthesis. + * gcov-tool.c: Declare the function with ATTRIBUTE_NORETURN. + * godump.c (go_format_type): Remove extra parenthesis. + 2018-09-25 Martin Liska * alias.c (set_dest_equal_p): Remove unused function. diff --git a/gcc/dbgcnt.c b/gcc/dbgcnt.c index ddb0e8e76d9..1eea65889a8 100644 --- a/gcc/dbgcnt.c +++ b/gcc/dbgcnt.c @@ -138,7 +138,7 @@ dbg_cnt_process_single_pair (const char *arg) int high, low; if (value1 == NULL) - return NULL; + return false; if (value2 == NULL) { diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 5655e460a5a..b4faeaa45ff 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -1511,7 +1511,7 @@ dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename) for (i = TDI_none + 1; i < (size_t) TDI_end; i++) { - if ((dump_files[i].dkind == dkind)) + if (dump_files[i].dkind == dkind) { const char *old_filename = dump_files[i].pfilename; dump_files[i].pstate = -1; @@ -1532,7 +1532,7 @@ dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename) for (i = 0; i < m_extra_dump_files_in_use; i++) { - if ((m_extra_dump_files[i].dkind == dkind)) + if (m_extra_dump_files[i].dkind == dkind) { const char *old_filename = m_extra_dump_files[i].pfilename; m_extra_dump_files[i].pstate = -1; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7e1546f93fe..86d0a3ee969 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-09-25 Martin Liska + + PR fortran/87394 + * decl.c (add_hidden_procptr_result): Simplify condition + as we are in branch witch 'case1 || case2'. + 2018-09-25 Martin Liska * trans.c (remove_suffix): Remove diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 91a1f34d7f1..7f79811d152 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -6463,7 +6463,7 @@ add_hidden_procptr_result (gfc_symbol *sym) gfc_symtree *stree; if (case1) gfc_get_sym_tree ("ppr@", gfc_current_ns, &stree, false); - else if (case2) + else { gfc_symtree *st2; gfc_get_sym_tree ("ppr@", gfc_current_ns->parent, &stree, false); diff --git a/gcc/gcov-tool.c b/gcc/gcov-tool.c index 88539f9647f..173ed5e5af2 100644 --- a/gcc/gcov-tool.c +++ b/gcc/gcov-tool.c @@ -438,7 +438,7 @@ static const struct option overlap_options[] = /* Print overlap usage and exit. */ -static void +static void ATTRIBUTE_NORETURN overlap_usage (void) { fnotice (stderr, "Overlap subcomand usage:"); diff --git a/gcc/godump.c b/gcc/godump.c index 88e1a7782f1..baf21e27eec 100644 --- a/gcc/godump.c +++ b/gcc/godump.c @@ -961,7 +961,7 @@ go_format_type (struct godump_container *container, tree type, unions. */ if (!is_anon_substructure) { - if ((DECL_NAME (field) == NULL)) + if (DECL_NAME (field) == NULL) *p_art_i = go_append_artificial_name (ob, *p_art_i); else go_append_decl_name -- 2.30.2