Aijing Sun | 19 Oct 15:58 2014
Picon

can protobuf cost less bytes?

1.if a int value is -1,then through varint 128 serialze is 10 bytes.
2. a bool true is none 0,and false is 0,but it cost 1 byte .

I hope -1 just cost 1 byte,and bool cost no byte.
and it can cost less byte when serialize
and I suggest change wire type:
0(000) --- positive varint
1(001) --- negative  varint
2(010) ---- true
3(011) ---- false
4(100) ---- bit32
5(101) ---- bit64
6(110) ---- Length-delimited


 

--
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
protobuf | 20 Oct 03:54 2014

Issue 675 in protobuf: memory leak

Status: New
Owner: liujisi <at> google.com
Labels: Type-Defect Priority-Medium

New issue 675 by vxm... <at> gmail.com: memory leak
https://code.google.com/p/protobuf/issues/detail?id=675

A memory leak is detected by vld(visual leak detector).
I think the problem is caused by this function:
void InitEmptyString() {
   empty_string_ = new string;
}
empty_string_ will not be deleted later.

In previous version protobuf-2.5.0, empty string is a global std::string
const ::std::string kEmptyString;

protobuf version: protobuf-2.6.0
OS: windows 8.1
build env: visual studio 2013

Some output generated by vld:
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\generated_message_util.cc  
(55):  
ChatServerd.exe!google::protobuf::internal::InitEmptyString + 0x7  
bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\common.h (876):  
ChatServerd.exe!google::protobuf::internal::FunctionClosure0::Run + 0xA  
bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\once.cc (83):  
ChatServerd.exe!google::protobuf::GoogleOnceInitImpl + 0xF bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\stubs\once.h (127):  
ChatServerd.exe!google::protobuf::GoogleOnceInit + 0xD bytes
d:\sdk\protobuf\protobuf-2.6.0\src\google\protobuf\generated_message_util.h  
(84): ChatServerd.exe!google::protobuf::internal::GetEmptyString + 0xF bytes

-- 
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

protobuf | 18 Oct 21:45 2014

Issue 674 in protobuf: protoc: can't control output directory

Status: New
Owner: liujisi <at> google.com
Labels: Type-Defect Priority-Medium

New issue 674 by weegreen... <at> gmail.com: protoc: can't control output  
directory
https://code.google.com/p/protobuf/issues/detail?id=674

May be related to #693.

What steps will reproduce the problem?

1. unzip project

2. change dir
     $ cd protobuf_bug

3. execute expected use case:
     $ protoc -Isrc --cpp_out=. src/audacity/messages/pb/Emitter.proto

4. observe output is unexpected:
     $ find .
     .
     ./audacity
     ./audacity/messages
     ./audacity/messages/pb
     ./audacity/messages/pb/Emitter.pb.h
     ./audacity/messages/pb/Emitter.pb.cc
     ./src
     ./src/audacity
     ./src/audacity/messages
     ./src/audacity/messages/pb
     ./src/audacity/messages/pb/Type.proto
     ./src/audacity/messages/pb/Emitter.proto

5. clean up mess:
     $ rm -rf ./audacity

6. execute next expected use case:
     $ protoc -Isrc --cpp_out=src src/audacity/messages/pb/Emitter.proto

7. observe expected output:
     $ find .
     .
     ./src
     ./src/audacity
     ./src/audacity/messages
     ./src/audacity/messages/pb
     ./src/audacity/messages/pb/Emitter.pb.h
     ./src/audacity/messages/pb/Emitter.pb.cc
     ./src/audacity/messages/pb/Type.proto
     ./src/audacity/messages/pb/Emitter.proto

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

     From my learning experience with documenting issue #693, I thought  
--cpp_out=. would always work, but once I started getting more complicated,  
when using -Isrc, everything gets hosed.  It seems like -IDIR and  
--cpp_out=DIR must always occur in pairs, this is very unexpected as gcc  
and visual studio compilers have no such behavior.  If multiple -I flags  
are specified, I have no idea how to manipulate --cpp_out.

What version of the product are you using? On what operating system?
     See #693.

Please provide any additional information below.
     See #693.

Attachments:
	protobuf_bug.zip  1.6 KB

-- 
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

protobuf | 18 Oct 21:17 2014

Issue 673 in protobuf: protoc: can't control output directory

Status: New
Owner: liujisi <at> google.com
Labels: Type-Defect Priority-Medium

New issue 673 by weegreen... <at> gmail.com: protoc: can't control output  
directory
https://code.google.com/p/protobuf/issues/detail?id=673

I am working on integrating the protoc compiler to my build system, however  
I'm finding it difficult to control where the output files are saved.

What steps will reproduce the problem?

1. unzip project

2. change directories
     $ cd protobuf_bug

3. execute expected use case:
     $ protoc --cpp_out=src/audacity/messages/pb  
src/audacity/messages/pb/Type.proto

4. observe output files not placed in specified output directory:
     $ find .
     .
     ./src
     ./src/audacity
     ./src/audacity/messages
     ./src/audacity/messages/pb
     ./src/audacity/messages/pb/src
     ./src/audacity/messages/pb/src/audacity
     ./src/audacity/messages/pb/src/audacity/messages
     ./src/audacity/messages/pb/src/audacity/messages/pb
     ./src/audacity/messages/pb/src/audacity/messages/pb/Type.pb.h
     ./src/audacity/messages/pb/src/audacity/messages/pb/Type.pb.cc
     ./src/audacity/messages/pb/Type.proto

5. clean up the mess
     $ rm -rf src/audacity/messages/pb/src

6. execute next expected use case:
     $ protoc --cpp_out=. src/audacity/messages/pb/Type.proto

7. observe correct output:
     $ find .
     .
     ./src
     ./src/audacity
     ./src/audacity/messages
     ./src/audacity/messages/pb
     ./src/audacity/messages/pb/Type.pb.h
     ./src/audacity/messages/pb/Type.pb.cc
     ./src/audacity/messages/pb/Type.proto

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

     I expect the generated files to be placed in the directory specified,  
instead funny path manipulation is occurring.

What version of the product are you using? On what operating system?

     $ protoc --version
     libprotoc 2.5.0
     $ lsb_release -a
     No LSB modules are available.
     Distributor ID:	Ubuntu
     Description:	Ubuntu 14.04.1 LTS
     Release:	14.04
     Codename:	trusty

Please provide any additional information below.

     Please add some option to explicitly place the generated files to  
specified location, similar to how gcc -o works, as protoc is advertised as  
a compiler.
     The location where protoc places output files isn't explained in the  
documentation, if the default is to always place the output files next to  
the .proto file, then there should be a set of --cpp, --python, --java  
switches which does this, rather some --XXX_out=DIR switch.

Attachments:
	protobuf_buf.zip  1.2 KB

-- 
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Evan Fraser | 17 Oct 23:43 2014
Picon

seralizetostring and parsefromstring

protoc will not add these two methods to my class for some reason. Please let me know what I may be missing and
what's going wrong.

--

-- 
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

protobuf | 17 Oct 01:26 2014

Re: Issue 476 in protobuf: Officially support Maven protoc plugin

Updates:
	Summary: Officially support Maven protoc plugin
	Status: Accepted
	Owner: xiaof... <at> google.com

Comment #10 on issue 476 by xiaof... <at> google.com: Officially support Maven  
protoc plugin
https://code.google.com/p/protobuf/issues/detail?id=476

(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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Tamás Somhegyi | 15 Oct 12:01 2014
Picon

Message encoding question

Hello,

I am quite new to Protocol Buffers but I have read the tutorials. There is one part of the encoding which I don't understand.
How the message types are encoded? As I see the tutorial mentions the field encoding but the field id is unique only in the message.

Best regards,
Tamas

--
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Tamás Somhegyi | 15 Oct 12:05 2014
Picon

Message encoding question

Hello,

I am quite new to Protocol Buffers but I have read the tutorials. There is one part of the encoding which I don't understand.
How the message types are encoded? As I see the tutorial mentions the field encoding but the field id is unique only in the message.

Best regards,
Tamas

--
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Johannes Elgh | 14 Oct 19:55 2014
Picon

Null Nested Messages--whats expected?

Hello everyone,

Firstly I need to apologize for any misuse or misunderstand of terms and concepts. I'm mostly familiar with the Protocol Buffer implementations protostuff and protobuf-net.


I have a case that two different implementations (the C# one: protobuf-net and the Java one: protostuff) do differently and I'd like to know which way is the correct according to the Protocol Buffers specification.

I have these messages:

    message A {
        optional string someField = 2;
        optional Location location = 4;
    }

    message Location {
        optional Coordinate coordinate = 1;
        optional string city = 2;
    }   

    message Coordinate {
        ...
    }


In the following case we have an object A, with a populated Location with coordinate = null and city = "someCity".

When protobuf-net (a client) sends this object A (populated as described above) to protostuff (the backend) it sends 0x0 in the place of the coordinate. This results into that protostuff reads a 0 whilst populating Location, and therefore thinks that Location is done. When protostuff then reads the next field number it finds 2, city, which has the same number as someField in A and populates that field instead (city overwrites someField). 

So the problem is that protobuf-net sends 0x0 for a null nested messages whereas protostuff doesn't even expect it to be there (since it's null).

Best regards,
Johannes

--
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
williamkibira | 13 Oct 16:16 2014
Picon

Having Google Protocol Buffers in Qt Mobile Android and IOS project

Hello, i am new here , Mu name is William and i am trying to write a mobile application using Qt5.3.1 to build an Android Application and i was wondering how i can ensure that the project gets the C++ Google Protocol Buffers to be pre-packed and deployed with the application. I am have tried to add this to the projects .pro file but, it fails to package it with the APK.

Frankly i really do not know what to do so i was hoping that someone amongst you could help me pull this off. The end goal i have is to be able to build the same application at the end of the day for BlackBerry and IOS .

Thank you everyone :)

--
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Anthony Sampton | 14 Oct 18:47 2014
Picon

Message extensions cannot have required fields.

After the latest release (2.6.0) all my protos wouldn't compile.
Protoc gives me the following error: "Message extensions cannot have required fields."

Can anyone explain me why can't I use the required field in extention in the code below?

message MyMsgA {
    extensions
100 to max;
    required int32 i
= 1;
}
 
message
MyMsgB {
    extend
MyMsgA {
        required
MyMsgB b_data = 100;
   
}
    required
string s = 1;
}


Thanks in advance.

--
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+unsubscribe <at> googlegroups.com.
To post to this group, send email to protobuf <at> googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Gmane