From 9eb272eea40c2c5c212574ad4f4bcf3116102492 Mon Sep 17 00:00:00 2001 From: ghazi Date: Sat, 11 Aug 2007 13:34:32 +0000 Subject: [PATCH] * decl.c (compare_field_bitpos): Constify. * utils2.c (compare_elmt_bitpos): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127358 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/decl.c | 7 +++---- gcc/ada/utils2.c | 11 +++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a214544..396a32a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2007-08-11 Kaveh R. Ghazi + + * decl.c (compare_field_bitpos): Constify. + * utils2.c (compare_elmt_bitpos): Likewise. + 2007-07-27 Aurelien Jarno * s-osinte-kfreebsd-gnu.ads ((sigset_t_ptr): Removed, replaced by diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 86a8dd7..5c202f0e 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -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 --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index 29d8f0f..fe27288 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)); } -- 2.7.4