aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils2.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-08-11 13:34:32 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-08-11 13:34:32 +0000
commit39595763534dcdf037f4796faaf893516d8ad2e9 (patch)
treeaefc262670ad2678d02adaa90a83b83be65f0d1f /gcc/ada/utils2.c
parentea7c218e4605228d20539d8f6af4875623bb3127 (diff)
downloadgcc-39595763534dcdf037f4796faaf893516d8ad2e9.zip
gcc-39595763534dcdf037f4796faaf893516d8ad2e9.tar.gz
gcc-39595763534dcdf037f4796faaf893516d8ad2e9.tar.bz2
decl.c (compare_field_bitpos): Constify.
* decl.c (compare_field_bitpos): Constify. * utils2.c (compare_elmt_bitpos): Likewise. From-SVN: r127358
Diffstat (limited to 'gcc/ada/utils2.c')
-rw-r--r--gcc/ada/utils2.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 29d8f0f..fe27288c 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -1542,13 +1542,12 @@ build_call_raise (int msg, Node_Id gnat_node, char kind)
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));
}