QUSIR / staff

Automatically exported from code.google.com/p/staff
Apache License 2.0
0 stars 0 forks source link

According to *.proto file, Generate the enum type is wrong #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Creating the proto-file:
  message OneKeyControl {
    enum Type{
       LOCK = 0;    
       UNLOCK = 1;
    }
    required Type type = 1; 
    required string new_password = 2;
  }
2.Generate the staff interface:
  staff_codegen -tinterface -pprotobuf -drootns=test ProtoCalc.proto
3.The interface file ProtoCale.h as follow:
  struct OneKeyControl
  {
    enum Type
    {
      LOCK = _0,
      UNLOCK = _1
    };

    Type type;  
    std::string new_password;
  };

What is the expected output? What do you see instead?

The result of compile is wrong, becanse  it define the enum type is wrong. The 
right define is "LOCK = 0". 

What version of the product are you using? On what operating system?
 staff_codegen version 1.99.1-r686 ; windows xp ;

Please provide any additional information below.

Original issue reported on code.google.com by bingqing...@gmail.com on 10 Aug 2012 at 2:06

GoogleCodeExporter commented 9 years ago
Accepted

Original comment by loentar on 10 Aug 2012 at 5:20

GoogleCodeExporter commented 9 years ago
fixed in r697

Original comment by loentar on 10 Aug 2012 at 5:29