AugustoAngeletti / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

double generating DataFormat.TwosComplement instead of DataFormat.Fixed #169

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. optional double Foo = 1;

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

Expected:

[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"Foo", DataFormat = 
global::ProtoBuf.DataFormat.Fixed)]

Generated:

[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"Foo", DataFormat = 
global::ProtoBuf.DataFormat.TwosComplement)]

What version of the product are you using? On what operating system?
r282 on Windows Vista/7 64bit

Please provide any additional information below.

From http://code.google.com/apis/protocolbuffers/docs/encoding.html

"Non-varint numeric types are simple – double and fixed64 have wire type 1, 
which tells the parser to expect a fixed 64-bit lump of data"

I ran some tests and protobuf-net is indeed using wire type 1 so I'm assuming 
your code is ignoring the DataFormat or recognizing the double and spitting out 
a fixed field?

Original issue reported on code.google.com by doug.mar...@gmail.com on 20 Apr 2011 at 9:14