From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24436 invoked by alias); 19 Jan 2012 12:01:14 -0000 Received: (qmail 24426 invoked by uid 22791); 19 Jan 2012 12:01:13 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,TO_NO_BRKTS_DIRECT X-Spam-Check-By: sourceware.org Received: from gbenson.demon.co.uk (HELO gbenson.demon.co.uk) (80.177.220.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Jan 2012 12:00:55 +0000 Date: Thu, 19 Jan 2012 12:38:00 -0000 From: Gary Benson To: gdb-patches@sourceware.org Subject: RFC: fix hardwired constants Message-ID: <20120119120052.GA7798@redhat.com> Mail-Followup-To: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00693.txt.bz2 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 204 Hi all, This is a cleanup I made while poking around in the blockvector code. I think it's obvious but I wanted to check; I've not invoked the obvious rule before. Thanks, Gary -- http://gbenson.net/ --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Content-length: 961 2012-01-19 Gary Benson * mdebugread.c (sort_blocks): Replace integer constants with ones derived from FIRST_LOCAL_BLOCK. diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index c95c09b..e6d3b8c 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -4713,7 +4713,7 @@ sort_blocks (struct symtab *s) { struct blockvector *bv = BLOCKVECTOR (s); - if (BLOCKVECTOR_NBLOCKS (bv) <= 2) + if (BLOCKVECTOR_NBLOCKS (bv) <= FIRST_LOCAL_BLOCK) { /* Cosmetic */ if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) == 0) @@ -4728,7 +4728,7 @@ sort_blocks (struct symtab *s) * are very different. It would be nice to find a reliable test * to detect -O3 images in advance. */ - if (BLOCKVECTOR_NBLOCKS (bv) > 3) + if (BLOCKVECTOR_NBLOCKS (bv) > FIRST_LOCAL_BLOCK + 1) qsort (&BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK), BLOCKVECTOR_NBLOCKS (bv) - FIRST_LOCAL_BLOCK, sizeof (struct block *), --Qxx1br4bt0+wmkIi--