felipeprov / protoc-gen-docbook

Automatically exported from code.google.com/p/protoc-gen-docbook
0 stars 0 forks source link

Enum values are assumed to start at 0 and be sequential #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a .proto file containing an enum whose value starts at 1 then skips 
some values.  E.g.: 1,2,3,4,5,10,11,12,13,14,15

What is the expected output? I expect the Value column to show correct values.  
It does not.

What do you see instead?  I see the following in the Value column for my enum: 
0,1,2,3,4,5,6,7,8,9,10

What version of the product are you using? protoc-gen-docbook 0.3.1 full bundle 
- Windows Binary

On what operating system? Windows 7

Please provide any additional information below.

Original issue reported on code.google.com by prabo...@gmail.com on 6 Mar 2014 at 5:49

GoogleCodeExporter commented 9 years ago
Interesting. This is strange because I am using protobuf library to extract the 
enumeration. Didn't expect that there will be a problem.

I will look into it.

Thanks

... Alan

Original comment by askl...@gmail.com on 12 Mar 2014 at 4:30

GoogleCodeExporter commented 9 years ago
FYI, to fix this you just need to change WriteEnumFieldEntries to use:

enumDescriptor->value(i)->number()

instead of the index variable 'i'

Original comment by ahow...@gmail.com on 4 Nov 2014 at 12:40