Re: [PATCH 2/7] Remove vlang_unknown

Yao Qi
2013-10-04T08:31:56Z

On 10/02/2013 05:32 PM, Joel Brobecker wrote:
> I agree. I think the patch is OK to go with a quick comment added,
> explaining that we want to be able to index arrays using this enum,
> so we make its first enum explicitly zero (despite the fact that
> this is the default, this prevents someone else just accidently
> setting the first enum's value to nonzero for other reasons).

Comments are added in the patch below. It is obvious to me, and I'll
commit it.

--
Yao (é½å°§)

gdb:

2013-10-04 Yao Qi <yao@codesourcery.com>

* varobj.h: Add comments to enum varobj_languages.
---
gdb/varobj.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gdb/varobj.h b/gdb/varobj.h
index 5f6eb88..c794085 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -52,7 +52,8 @@ enum varobj_scope_status
/* String representations of gdb's format codes (defined in varobj.c). */
extern char *varobj_format_string[];

-/* Languages supported by this variable objects system. */
+/* Languages supported by this variable objects system. This enum is used
+ to index arrays so we make its first enum explicitly zero. */
enum varobj_languages
{
vlang_c = 0, vlang_cplus, vlang_java, vlang_ada, vlang_end
--
1.7.7.6