It might help in debugging this to notice that 9999 == 0x270F, and 30064781071 == 0x70000270F. I suspect the corruption is happening to the data in the object, and not to the data in serialized form, because while those numbers only differ in a single bit, their varint encodings differ in many places.
-- Jeremy Leader [email protected] The_Glu wrote: > Hello, > > I use the following prototype : > > message Find { > required uint64 tag = 1; > required Common.Hash peerID = 2; > required string pattern = 3; > } > > Now: > > Protos::Core::Find findProto; > findProto.set_tag(9999); > > (findProto.tag() == 9999) is true. > > findProto.DebugString() return > > tag: 9999 > peerID { > hash: "323655354" > } > pattern: "coucou" > ) > > Great isn't it ? > > But now, if I serialize and unserialize the prototype > > std::string output; > findProto.SerializeToString(&output); > > Protos::Core::Find findMessage; > findMessage.ParseFromString(output); > > What do I get ? > > tag: 30064781071 > peerID { > hash: "323655354" > } > pattern: "coucou" > ) > > Why my tag changed oO ? It's not a random value, and it's works for > small numbers. > > I tried to change the type of tag to uint32, int32, etc. always the > same problem. > > Thanks for your help, > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---
