From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52387 invoked by alias); 29 Mar 2017 15:36:00 -0000 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 Received: (qmail 52378 invoked by uid 89); 29 Mar 2017 15:36:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=H*UA:Roundcube, H*u:Roundcube, HX-PHP-Originating-Script:rcube.php, Hx-languages-length:610 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Mar 2017 15:35:58 +0000 Received: by simark.ca (Postfix, from userid 33) id 893D91E80F; Wed, 29 Mar 2017 11:35:58 -0400 (EDT) To: Pedro Alves Subject: Re: [PATCH 3/5] dwarf2read.c: Make dir_index and file_name_index strong typedefs X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 29 Mar 2017 15:36:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <1490754298-9455-4-git-send-email-palves@redhat.com> References: <1490754298-9455-1-git-send-email-palves@redhat.com> <1490754298-9455-4-git-send-email-palves@redhat.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.4 X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00506.txt.bz2 On 2017-03-28 22:24, Pedro Alves wrote: > @@ -1169,7 +1179,7 @@ file_entry::include_dir (const line_header *lh) > const > { > /* lh->include_dirs is 0-based, but the directory index numbers in > the statement program are 1-based. */ > - return lh->include_dir_at (dir_index - 1); > + return lh->include_dir_at (to_underlying (d_index) - 1); Should include_dir_at's parameter be a dir_index? At this point, exposing a zero based index in the line_header interface is exposing its internal implementation. Same for file_name_at.