From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26227 invoked by alias); 11 Aug 2007 13:47:54 -0000 Received: (qmail 26026 invoked by uid 22791); 11 Aug 2007 13:47:52 -0000 X-Spam-Check-By: sourceware.org Received: from caip.rutgers.edu (HELO caip.rutgers.edu) (128.6.236.16) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 11 Aug 2007 13:47:47 +0000 Received: from caipclassic.rutgers.edu (caipclassic.rutgers.edu [128.6.237.54]) by caip.rutgers.edu (8.13.8/8.13.5) with ESMTP id l7BDleho020267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 11 Aug 2007 09:47:44 -0400 Date: Sat, 11 Aug 2007 13:47:00 -0000 From: "Kaveh R. GHAZI" To: gcc-patches@gcc.gnu.org Subject: [Ada PATCH INSTALLED]: constifications Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-08/txt/msg00734.txt.bz2 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 * 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)); }