decl.c (compare_field_bitpos): Constify.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sat, 11 Aug 2007 13:34:32 +0000 (13:34 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 11 Aug 2007 13:34:32 +0000 (13:34 +0000)
* decl.c (compare_field_bitpos): Constify.
* utils2.c (compare_elmt_bitpos): Likewise.

From-SVN: r127358

gcc/ada/ChangeLog
gcc/ada/decl.c
gcc/ada/utils2.c

index a214544bfe8f1025e3b69641c24ff72eeb30f874..396a32ac5ce6a34f1e7c4a5409eeec70b1ac021c 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * decl.c (compare_field_bitpos): Constify.
+       * utils2.c (compare_elmt_bitpos): Likewise.
+
 2007-07-27  Aurelien Jarno  <aurelien@aurel32.net>
 
        * s-osinte-kfreebsd-gnu.ads ((sigset_t_ptr): Removed, replaced by 
index 86a8dd7a609a11be3876fd602097414d24773c13..5c202f0e7a756aabe15d38196066b9d2f740ce40 100644 (file)
@@ -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));
 }
 
index 29d8f0fbab52c2a3d84fd9b8637048e7e2b414d3..fe27288c5a5c3d23ce99561e44e490e1ec665ea6 100644 (file)
@@ -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));
 }