From: "Kaveh R. GHAZI" <ghazi@caip.rutgers.edu>
To: gcc-patches@gcc.gnu.org
Subject: [Ada PATCH INSTALLED]: constifications
Date: Sat, 11 Aug 2007 13:47:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.58.0708110945380.20555@caipclassic.rutgers.edu> (raw)
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));
}
next reply other threads:[~2007-08-11 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-11 13:47 Kaveh R. GHAZI [this message]
2007-08-11 15:00 ` Richard Kenner
2007-08-11 16:40 ` Kaveh R. GHAZI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.58.0708110945380.20555@caipclassic.rutgers.edu \
--to=ghazi@caip.rutgers.edu \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).