public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fortran: Rename TRUE/FALSE to true/false in *.cc files
@ 2023-08-25  8:26 Uros Bizjak
  2023-08-25  8:34 ` Tobias Burnus
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2023-08-25  8:26 UTC (permalink / raw)
  To: gcc-patches, Fortran List

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

gcc/fortran/ChangeLog:

    * match.cc (gfc_match_equivalence): Rename TRUE/FALSE to true/false.
    * module.cc (check_access): Ditto.
    * primary.cc (match_real_constant): Ditto.
    * trans-array.cc (gfc_trans_allocate_array_storage): Ditto.
    (get_array_ctor_strlen): Ditto.
    * trans-common.cc (find_equivalence): Ditto.
    (add_equivalences): Ditto.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

OK for master?

Uros.

[-- Attachment #2: r.diff.txt --]
[-- Type: text/plain, Size: 3090 bytes --]

diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index ba23bcd9692..c926f38058f 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -5788,7 +5788,7 @@ gfc_match_equivalence (void)
 	goto syntax;
 
       set = eq;
-      common_flag = FALSE;
+      common_flag = false;
       cnt = 0;
 
       for (;;)
@@ -5829,7 +5829,7 @@ gfc_match_equivalence (void)
 
 	  if (sym->attr.in_common)
 	    {
-	      common_flag = TRUE;
+	      common_flag = true;
 	      common_head = sym->common_head;
 	    }
 
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 95fdda6b2aa..c07e9dc9ba2 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -5744,9 +5744,9 @@ check_access (gfc_access specific_access, gfc_access default_access)
     return true;
 
   if (specific_access == ACCESS_PUBLIC)
-    return TRUE;
+    return true;
   if (specific_access == ACCESS_PRIVATE)
-    return FALSE;
+    return false;
 
   if (flag_module_private)
     return default_access == ACCESS_PUBLIC;
diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc
index 0bb440b85a9..d3aeeb89362 100644
--- a/gcc/fortran/primary.cc
+++ b/gcc/fortran/primary.cc
@@ -530,13 +530,13 @@ match_real_constant (gfc_expr **result, int signflag)
   seen_dp = 0;
   seen_digits = 0;
   exp_char = ' ';
-  negate = FALSE;
+  negate = false;
 
   c = gfc_next_ascii_char ();
   if (signflag && (c == '+' || c == '-'))
     {
       if (c == '-')
-	negate = TRUE;
+	negate = true;
 
       gfc_gobble_whitespace ();
       c = gfc_next_ascii_char ();
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 951cecfa5d5..90a7d4e9aef 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -1121,7 +1121,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
     {
       /* A callee allocated array.  */
       gfc_conv_descriptor_data_set (pre, desc, null_pointer_node);
-      onstack = FALSE;
+      onstack = false;
     }
   else
     {
@@ -2481,7 +2481,7 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor_base base, tree * len
   gfc_constructor *c;
   bool is_const;
 
-  is_const = TRUE;
+  is_const = true;
 
   if (gfc_constructor_first (base) == NULL)
     {
diff --git a/gcc/fortran/trans-common.cc b/gcc/fortran/trans-common.cc
index c83b6f930eb..91a98b30b8d 100644
--- a/gcc/fortran/trans-common.cc
+++ b/gcc/fortran/trans-common.cc
@@ -1048,7 +1048,7 @@ find_equivalence (segment_info *n)
   gfc_equiv *e1, *e2, *eq;
   bool found;
 
-  found = FALSE;
+  found = false;
 
   for (e1 = n->sym->ns->equiv; e1; e1 = e1->next)
     {
@@ -1083,7 +1083,7 @@ find_equivalence (segment_info *n)
 	    {
 	      add_condition (n, eq, e2);
 	      e2->used = 1;
-	      found = TRUE;
+	      found = true;
 	    }
 	}
     }
@@ -1102,11 +1102,11 @@ static void
 add_equivalences (bool *saw_equiv)
 {
   segment_info *f;
-  bool more = TRUE;
+  bool more = true;
 
   while (more)
     {
-      more = FALSE;
+      more = false;
       for (f = current_segment; f; f = f->next)
 	{
 	  if (!f->sym->equiv_built)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fortran: Rename TRUE/FALSE to true/false in *.cc files
  2023-08-25  8:26 [PATCH] fortran: Rename TRUE/FALSE to true/false in *.cc files Uros Bizjak
@ 2023-08-25  8:34 ` Tobias Burnus
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Burnus @ 2023-08-25  8:34 UTC (permalink / raw)
  To: Uros Bizjak, gcc-patches, Fortran List

On 25.08.23 10:26, Uros Bizjak via Gcc-patches wrote:
> gcc/fortran/ChangeLog:
>
>      * match.cc (gfc_match_equivalence): Rename TRUE/FALSE to true/false.
>      * module.cc (check_access): Ditto.
>      * primary.cc (match_real_constant): Ditto.
>      * trans-array.cc (gfc_trans_allocate_array_storage): Ditto.
>      (get_array_ctor_strlen): Ditto.
>      * trans-common.cc (find_equivalence): Ditto.
>      (add_equivalences): Ditto.
>
> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
> OK for master?

OK. Not really necessary but it makes the code more consistent.

(We already heavily use true/false (5000+ times) and the patch changes
the remaining 11 TRUE/FALSE.)

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-25  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25  8:26 [PATCH] fortran: Rename TRUE/FALSE to true/false in *.cc files Uros Bizjak
2023-08-25  8:34 ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).