handoutz / protobuf-net

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

Both sint32 / int32 field at a .proto file makes an 'int' property #172

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a .proto message
2. Add field (for example) optional int32 speed = 1;
3. Save (so it generates the cs code)

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

Expected: Property 'speed' of type 'uint'
 - Actual result: Property 'speed' of type 'int'

What version of the product are you using? On what operating system?
 - Latest installer available

Please provide any additional information below.
A very annoying issue indeed.

Original issue reported on code.google.com by tim@mylemans.com on 8 May 2011 at 11:38

GoogleCodeExporter commented 9 years ago
Never mind... I actually missed the fact that you can define int32, sint32 AND 
uint32 as well.. meh

Original comment by tim@mylemans.com on 8 May 2011 at 11:39

GoogleCodeExporter commented 9 years ago
As per comment 1, uint32 is the correct marker for unsigned. sint32 and int32 
both refer to signed data - the difference being that sint32 is *more 
efficient* (than int32) when dealing with negative values.

Original comment by marc.gravell on 9 May 2011 at 6:15