[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Updates: Status: WontFix Owner: xiaof...@google.com Comment #6 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition https://code.google.com/p/protobuf/issues/detail?id=269 (No comment was entered for this change.) -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Comment #5 on issue 269 by slic...@gmail.com: Would like to have byte or int8 type for the message definition https://code.google.com/p/protobuf/issues/detail?id=269 when it come to embeded programing,it's convenient to have int8,such like arm Cortex-M0/M3/M4, the ram is some how wasting if you only want a byte value and declare a int. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Comment #4 on issue 269 by thecodem...@gmail.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 I don't need a fixed length string; I want to encode RGB or RGBA data as 3 or 4 bytes. I could pack them into an int32, but it seems like a byte type is a perfectly reasonable request. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
The simple answer would be use the existing oversized types, and cast at the caller. Varint data in particular will either be 1 byte or 2 (50% each) for byte values. For longer sequences (rgba etc) there are existing fixed-32 and bytes. If the intent is to add a wire type to precisely represent a byte: that is hugely problematic. Adding a wire type is a significant thing, as: - the numbers of wire types is strictly limited, and there isn't much spare (unless the next wire type somehow means check the next byte for the longer wire type, or something) - all existing clients, libraries and deployments would need updating to even touch data with that wire type - it isn't even possible to ignore the data if you don't understand the wire type. Marc On 30 Jun 2014 18:20, proto...@googlecode.com wrote: Comment #4 on issue 269 by thecodem...@gmail.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 I don't need a fixed length string; I want to encode RGB or RGBA data as 3 or 4 bytes. I could pack them into an int32, but it seems like a byte type is a perfectly reasonable request. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
+1 for int8 and uint8 sizes -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
No you cant, on C++ bytes translates to string, wont allow for null. Regards, Sumit Kumar On 14 Mar, 2013, at 2:39 AM, Feng Xiao xiaof...@google.com wrote: You can just use bytes field. On Wed, Mar 13, 2013 at 5:38 AM, Giri Guntipalli giri.guntipa...@gmail.com wrote: we need similar thing to hold binary data in proto message, where i can not use string because binary data may have the null character in middle On Tuesday, 29 January 2013 14:30:31 UTC+5:30, prot...@googlecode.com wrote: Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 Re kumar.sumit: How are you going to use the byte field to implement a fixed length string? If byte can, why can't int32? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Int32 and such will see endianness issues when exchanging messages in-between cross-endian platforms hence only byte type suffices. On how we achieve fixed length string support once byte type is supported - Just create a message with specific number of byte elements and can name it like fixed8String instead. Accessors can be added via simple plugin that uses protoc insert point. Regards, Sumit Kumar On 13 Mar, 2013, at 8:38 PM, Giri Guntipalli giri.guntipa...@gmail.com wrote: we need similar thing to hold binary data in proto message, where i can not use string because binary data may have the null character in middle On Tuesday, 29 January 2013 14:30:31 UTC+5:30, prot...@googlecode.com wrote: Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 Re kumar.sumit: How are you going to use the byte field to implement a fixed length string? If byte can, why can't int32? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Really? AFAIK C++ strings handle null's just fine... they're pascal-style strings, not c-style strings. $ cat test.cc #include string #include iostream int main() { std::string a(a\0b, 3); std::cout a.size() std::endl; return 0; } $ g++ -o test test.cc $ ./test 3 Or are you saying that the decoder is buggy and somehow doesn't actually populate the string object correctly? On Wed, Mar 13, 2013 at 10:37 PM, Sumit Kumar kumar.su...@hotmail.com wrote: No you cant, on C++ bytes translates to string, wont allow for null. Regards, Sumit Kumar On 14 Mar, 2013, at 2:39 AM, Feng Xiao xiaof...@google.com wrote: You can just use bytes field. On Wed, Mar 13, 2013 at 5:38 AM, Giri Guntipalli giri.guntipa...@gmail.com wrote: we need similar thing to hold binary data in proto message, where i can not use string because binary data may have the null character in middle On Tuesday, 29 January 2013 14:30:31 UTC+5:30, prot...@googlecode.com wrote: Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 Re kumar.sumit: How are you going to use the byte field to implement a fixed length string? If byte can, why can't int32? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
On Thu, Mar 14, 2013 at 2:37 AM, Sumit Kumar kumar.su...@hotmail.comwrote: No you cant, on C++ bytes translates to string, wont allow for null. std::string handles NULs just fine, and protobuf's use of it for bytes fields also works fine. (I have code that's been in production for a few years that relies on this) Oliver -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
we need similar thing to hold binary data in proto message, where i can not use string because binary data may have the null character in middle On Tuesday, 29 January 2013 14:30:31 UTC+5:30, prot...@googlecode.com wrote: Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 Re kumar.sumit: How are you going to use the byte field to implement a fixed length string? If byte can, why can't int32? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
You can just use bytes field. On Wed, Mar 13, 2013 at 5:38 AM, Giri Guntipalli giri.guntipa...@gmail.comwrote: we need similar thing to hold binary data in proto message, where i can not use string because binary data may have the null character in middle On Tuesday, 29 January 2013 14:30:31 UTC+5:30, prot...@googlecode.comwrote: Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/**protobuf/issues/detail?id=269http://code.google.com/p/protobuf/issues/detail?id=269 Re kumar.sumit: How are you going to use the byte field to implement a fixed length string? If byte can, why can't int32? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 Re kumar.sumit: How are you going to use the byte field to implement a fixed length string? If byte can, why can't int32? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Comment #2 on issue 269 by kumar.su...@hotmail.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 This is something I have been looking for as well. I need it for a different use-case though, want to support fixed length strings through this. I suppose int32 can’t be used in this case. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition
Updates: Owner: --- Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-Low Comment #1 on issue 269 by jas...@google.com: Would like to have byte or int8 type for the message definition http://code.google.com/p/protobuf/issues/detail?id=269 Assigning to low priority for now: this is the first time I've heard this feature request. I think we'd want to have a pretty compelling use case before making a change of this size. For messages that have a handful of byte fields, using a standard int32 seems sufficient: there is some wasted space for the in-memory representation, but the encoding will be compact. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.