On Tue, Mar 14, 2006 at 12:21:40AM +0100, fons adriaensen wrote: > On Mon, Mar 13, 2006 at 11:59:15PM +0100, stefan kersten wrote: > > > as paul stated, network byte order is defined to be > > big-endian, so yes, you have to convert 32 bit floats (and > > doubles, for that matter) on intel, because they are stored > > lsb first. of course it would be perfectly valid for netjack > > to use little endian `on the wire'; but this would be like > > putting my powerbook in little endian mode when playing a > > wav file. sort of. > > OK, but for floats the situation could be more complex. On Intel, > the exponent/sign byte is the last one. Is it always the first > one on BE platforms ? If it isn't then using ntohl() or htonl() > wich are designed to work on 32-bit ints will not help.
the current netjack code for converting the floats is tested. it works. at least for PPC <-> intel i only added the packet header after that test, and robert did not yet test it again. > > For doubles, things are even more fuzzy. Can you just use ntohl() > and htonl() on both halves, or do these two have to be swapped as > well ? Will either rule produce consistent results on all > platforms ? i am happy, that i dont need to transfer doubles :) -- torben Hohn http://galan.sourceforge.net -- The graphical Audio language