From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30099 invoked by alias); 2 Oct 2013 00:19:23 -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 30084 invoked by uid 89); 2 Oct 2013 00:19:23 -0000 Received: from mail-vb0-f50.google.com (HELO mail-vb0-f50.google.com) (209.85.212.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 02 Oct 2013 00:19:23 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-vb0-f50.google.com Received: by mail-vb0-f50.google.com with SMTP id x14so57107vbb.9 for ; Tue, 01 Oct 2013 17:19:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8cyyEEC9ytl3zAAhYE0/8/QPA4YHll/JglKYFdwbVqE=; b=YmbSL5rcAbPnWk9HcJ32MBLghMtNwsaRJdCHeVxtUyfhfQhroARGwCB0p7Xh1PBTwI hSQZI/aYw3lViwGd+1Mf8svb95M85phvIXROjjG1Ho/dTGyoASl+CEclbw50NluWVvhx egQB7coCmFig5mzb+dh4Q8RfXwv/68OsVUxtXr9WT3bwZGwFaxCY8mslUQsC4H2nBzoF Rlg6hdjyLQSNYjBGLq/CsK8QVBi6H99rAemb4V5JSOEUZzoYVO3choDsEEeCSLaQMCzY SIUY+Elc6ZrDKaiCxwHVI2QE6nuv4wBrOhXVPg1VUMDfU7rwFQg480E9t/bBLKa1rVev FARQ== X-Gm-Message-State: ALoCoQmfm6z6BEg1Mm6pGX4VNYpzf5OZqQNJevcOT0Q3xNcTMTk8qXaucL7Q0KcgrzM5lhPkp6Ts57nZCg5mGA/8WKgFwn0QOzDTAyE4ZogZGHaMf1Em3H4ZiJqrCJmP0ocbeGfOz+TSTTJy8OmeLkOWqbpf+qy88KFyTJk8M1BqOcEME1fvawsHNo+9WAEW1LuqIIj5pvcSjayEHB31LFr1V5jglizq1Q== MIME-Version: 1.0 X-Received: by 10.52.230.35 with SMTP id sv3mr2887862vdc.27.1380673160253; Tue, 01 Oct 2013 17:19:20 -0700 (PDT) Received: by 10.52.37.138 with HTTP; Tue, 1 Oct 2013 17:19:20 -0700 (PDT) In-Reply-To: <524ACF04.2050904@codesourcery.com> References: <1379512482-31773-1-git-send-email-yao@codesourcery.com> <1379512482-31773-3-git-send-email-yao@codesourcery.com> <20131001100742.GC2840@adacore.com> <524ACF04.2050904@codesourcery.com> Date: Wed, 02 Oct 2013 00:19:00 -0000 Message-ID: Subject: Re: [PATCH 2/7] Remove vlang_unknown From: Doug Evans To: Yao Qi Cc: Joel Brobecker , gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00076.txt.bz2 On Tue, Oct 1, 2013 at 6:32 AM, Yao Qi wrote: > On 10/01/2013 06:07 PM, Joel Brobecker wrote: >> >> I am not really sure why the first enum would need to be zero. >> If we cannot find an answer to that question, I propose you leave >> the "= 0" out of this patch. > > > In varobj.c:varobj_create, variable_language returns > 'enum varobj_languages', and use it as an index to array > languages. > > /* Set language info */ > lang = variable_language (var); > var->root->lang = &languages[lang]; > > that is the reason the first enum should be zero. While we know enums begin at zero, making it explicit is fine with me. But if there's a reason that needed explaining, a comment in the code explaining "Why things are the way they are" is most welcome.