digideskio / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

structure with 64-bit field is decoded wrong #94

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Test value:
id=0xFFFFFFFF;
type=THREE;
time=1234567890;

1.
message DumpMessage
{
    required uint32 id=1;

    enum MessageType {
        ONE  = 0;
        TWO = 1;
        THREE = 2;
    }

    required MessageType type = 2;

    required uint32 time=3;
}

Unpack: id=4294967295 type=2 time=1234567890

2. uint64 instead uint32 for id:
message DumpMessage
{
    required uint64 id=1;

    enum MessageType {
        ONE  = 0;
        TWO = 1;
        THREE = 2;
    }

    required MessageType type = 2;

    required uint32 time=3;
}

Unpack: id=4294967295 type=0 time=2

Original issue reported on code.google.com by slpotape...@gmail.com on 25 Feb 2013 at 7:42