public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada PATCH INSTALLED]: constifications
@ 2007-08-11 13:47 Kaveh R. GHAZI
  2007-08-11 15:00 ` Richard Kenner
  0 siblings, 1 reply; 3+ messages in thread
From: Kaveh R. GHAZI @ 2007-08-11 13:47 UTC (permalink / raw)
  To: gcc-patches

This patch gets rid of a few easy -Wcast-qual warnings in the ada
directory.  Several remain though.

Tested ada on sparc-sun-solaris.10, no regressions.  Installed.

		--Kaveh


2007-08-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* decl.c (compare_field_bitpos): Constify.
	* utils2.c (compare_elmt_bitpos): Likewise.

diff -rup orig/egcc-SVN20070802/gcc/ada/decl.c egcc-SVN20070802/gcc/ada/decl.c
--- orig/egcc-SVN20070802/gcc/ada/decl.c	2007-06-10 23:03:07.000000000 -0400
+++ egcc-SVN20070802/gcc/ada/decl.c	2007-08-03 21:41:03.416332388 -0400
@@ -5847,11 +5847,10 @@ is_variable_size (tree type)
 static int
 compare_field_bitpos (const PTR rt1, const PTR rt2)
 {
-  tree field1 = * (tree *) rt1;
-  tree field2 = * (tree *) rt2;
-  int ret;
+  const_tree const field1 = * (const_tree const*) rt1;
+  const_tree const field2 = * (const_tree const*) rt2;
+  const int ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));

-  ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));
   return ret ? ret : (int) (DECL_UID (field1) - DECL_UID (field2));
 }

diff -rup orig/egcc-SVN20070802/gcc/ada/utils2.c egcc-SVN20070802/gcc/ada/utils2.c
--- orig/egcc-SVN20070802/gcc/ada/utils2.c	2007-06-16 23:02:50.000000000 -0400
+++ egcc-SVN20070802/gcc/ada/utils2.c	2007-08-03 21:38:36.911023954 -0400
@@ -1542,13 +1542,12 @@ build_call_raise (int msg, Node_Id gnat_
 static int
 compare_elmt_bitpos (const PTR rt1, const PTR rt2)
 {
-  tree elmt1 = * (tree *) rt1;
-  tree elmt2 = * (tree *) rt2;
-  tree field1 = TREE_PURPOSE (elmt1);
-  tree field2 = TREE_PURPOSE (elmt2);
-  int ret;
+  const_tree const elmt1 = * (const_tree const*) rt1;
+  const_tree const elmt2 = * (const_tree const*) rt2;
+  const_tree const field1 = TREE_PURPOSE (elmt1);
+  const_tree const field2 = TREE_PURPOSE (elmt2);
+  const int ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));

-  ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));
   return ret ? ret : (int) (DECL_UID (field1) - DECL_UID (field2));
 }

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

* Re: [Ada PATCH INSTALLED]: constifications
  2007-08-11 13:47 [Ada PATCH INSTALLED]: constifications Kaveh R. GHAZI
@ 2007-08-11 15:00 ` Richard Kenner
  2007-08-11 16:40   ` Kaveh R. GHAZI
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Kenner @ 2007-08-11 15:00 UTC (permalink / raw)
  To: ghazi; +Cc: gcc-patches

Thanks for doing this.  Two minor issues:

> +  const_tree const field1 = * (const_tree const*) rt1;
> +  const_tree const field2 = * (const_tree const*) rt2;

Please fix the missing blank before the second "*".

> +  const int ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));

Isn't this line too long?

The same problems are in utils2.c.

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

* Re: [Ada PATCH INSTALLED]: constifications
  2007-08-11 15:00 ` Richard Kenner
@ 2007-08-11 16:40   ` Kaveh R. GHAZI
  0 siblings, 0 replies; 3+ messages in thread
From: Kaveh R. GHAZI @ 2007-08-11 16:40 UTC (permalink / raw)
  To: Richard Kenner; +Cc: gcc-patches

On Sat, 11 Aug 2007, Richard Kenner wrote:

> Thanks for doing this.  Two minor issues:
>
> > +  const_tree const field1 = * (const_tree const*) rt1;
> > +  const_tree const field2 = * (const_tree const*) rt2;
>
> Please fix the missing blank before the second "*".
>
> > +  const int ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));
>
> Isn't this line too long?
>
> The same problems are in utils2.c.

Fixed.

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 127358)
+++ ChangeLog	(working copy)
@@ -1,5 +1,9 @@
 2007-08-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

+	* decl.c, utils2.c: Fix whitespace in last change.
+
+2007-08-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
 	* decl.c (compare_field_bitpos): Constify.
 	* utils2.c (compare_elmt_bitpos): Likewise.

Index: decl.c
===================================================================
--- decl.c	(revision 127358)
+++ decl.c	(working copy)
@@ -5847,9 +5847,10 @@
 static int
 compare_field_bitpos (const PTR rt1, const PTR rt2)
 {
-  const_tree const field1 = * (const_tree const*) rt1;
-  const_tree const field2 = * (const_tree const*) rt2;
-  const int ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));
+  const_tree const field1 = * (const_tree const *) rt1;
+  const_tree const field2 = * (const_tree const *) rt2;
+  const int ret
+    = tree_int_cst_compare (bit_position (field1), bit_position (field2));

   return ret ? ret : (int) (DECL_UID (field1) - DECL_UID (field2));
 }
Index: utils2.c
===================================================================
--- utils2.c	(revision 127358)
+++ utils2.c	(working copy)
@@ -1542,11 +1542,12 @@
 static int
 compare_elmt_bitpos (const PTR rt1, const PTR rt2)
 {
-  const_tree const elmt1 = * (const_tree const*) rt1;
-  const_tree const elmt2 = * (const_tree const*) rt2;
+  const_tree const elmt1 = * (const_tree const *) rt1;
+  const_tree const elmt2 = * (const_tree const *) rt2;
   const_tree const field1 = TREE_PURPOSE (elmt1);
   const_tree const field2 = TREE_PURPOSE (elmt2);
-  const int ret = tree_int_cst_compare (bit_position (field1), bit_position (field2));
+  const int ret
+    = tree_int_cst_compare (bit_position (field1), bit_position (field2));

   return ret ? ret : (int) (DECL_UID (field1) - DECL_UID (field2));
 }

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

end of thread, other threads:[~2007-08-11 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-11 13:47 [Ada PATCH INSTALLED]: constifications Kaveh R. GHAZI
2007-08-11 15:00 ` Richard Kenner
2007-08-11 16:40   ` Kaveh R. GHAZI

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).