Re: Warnings compiling MessageLite.java in protobuf-2.2.0

2009-09-24 Thread Christopher Piggott

I should have been more specific about what compiler I'm using: open-
jdk-6 version 6b14-1.4.1, on a linux (ubuntu) development environment
from within netbeans.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



open jdk

2009-09-24 Thread Christopher Piggott

I have been having a lot of problems getting things to compile - the
java protobuf library, to begin with; and even after getting that to
compile, I couldn't get MyProtos.java (generated code) to compile.

Come to find out, if I switch to sun-jdk-6 everything builds.

Is this a known issue, or is it something with my particular compiler
setup?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: deserialized fixed length message into a contiguous memory buffer?

2009-09-24 Thread Kenton Varda
On Thu, Sep 24, 2009 at 8:38 AM, am aamir...@gmail.com wrote:


 Hello,

 I am working with scalar values and fixed-length arrays. I need to
 deserialize the entire message into a contiguous raw buffer in memory
 such that all members of the data structure can be accessed by using
 offsets against a pointer to the raw buffer. This is due to the need
 for certain devices to have having DMA access to the deserialized
 message contents in system memory. If I use Protocol Buffers can I
 make sure that the entire deserialized message (including arrays of
 known size) is in a contiguous buffer in memory?


Sorry, the C++ implementation does not support this, and I don't think we
can reasonably make it support this since it would mean replacing every
new with a call to a custom allocator, a pointer to which would have to be
maintained somewhere, etc.  You may need to write a custom implementation to
achieve this.  You could probably reuse a lot of code from the official
implementation, though, such as CodedInputStream / CodedOutputStream.

You might also look to see if protobuf-c comes closer to what you want.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Warnings compiling MessageLite.java in protobuf-2.2.0

2009-09-24 Thread Kenton Varda
I'm told that a new version of the JDK enforces some things more strictly
than slightly older versions did, which may be leading to these errors.
The solution presented to me was to cast the value returned by
internalGetResult()
to ExtendableMessage.  Note that through generics, we *already know* that
the type returned is a subclass of ExtendableMessage, but due to some sort
of obscure quirk of the Java language spec, you apparently aren't supposed
to be able to access private members of the class if the type is a generics
type parameter.  Or something.  So the work-around is to insert casts.

The next release will include this fix.  I think there's three places in the
file where you need to add the cast.

On Thu, Sep 24, 2009 at 7:40 AM, Christopher Piggott cpigg...@gmail.comwrote:


 I should have been more specific about what compiler I'm using: open-
 jdk-6 version 6b14-1.4.1, on a linux (ubuntu) development environment
 from within netbeans.

 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---