[omniORB] marshaling/unmarshaling doubles on little endian xscale
Duncan Grisby
duncan at grisby.org
Fri Feb 3 12:22:14 GMT 2006
On Wednesday 1 February, Jeffrey Coffman wrote:
> I've come accross a problem on my xscale(little endian) port of
> omniOrb 4.0.6. I've noticed double(and floats) not marshalling
> properly. After some digging it appears the double precision values
> are word swapped. This appearantly has somthing todo with FPA float
> format. The result is doubles are not marshalled correctly between
> the xscale and other platforms.
First, try omniORB 4.0.7. That has a fix to do with strict type aliasing
which might fix your problem.
What do you mean by "word swapped"? Simply byte-swapped, or swapped at
some larger word size?
> Is there a way to tell omniOrb to check the platforms float format? I
> couldnt find any option for this in the platform specific files.
omniORB assumes that the platform uses IEEE floating point in the same
endianness as all the other types. If xscale doesn't, by bizarrely using
mixed endianness for example, it's going to be painful to support it.
> For the time being I have added word swaping to some of the methods in
> cdrstream.h which handle marshalling/unmarshalling doubles. This
> worked for doubles in general, but I am having trouble following the
> code for sequences of doubles. Can someone point to where the
> unmarshaling and marshaling of sequences of doubles takes place? I'm
> assuming in seqTemplateDefns.h, but I'm getting lost from there.
The marshalling code is in seqTemplateDecls.h. The problem you have is
that the code assumes you either byte swap or do nothing. It sounds like
perhaps on your platform you have to swap at some other word size. To do
that I think you'll have to implement template specialisations for
CORBA::Double to have different code for the other case.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list