CSS Parser and Qt/e 2.
Luciano Montanaro
mikelima at cirulla.net
Fri Jan 27 14:20:03 GMT 2006
On Friday 27 January 2006 14:47, Stefan Eilers wrote:
> Am Freitag, 27. Januar 2006 11:00 schrieb Luciano Montanaro:
> > Actually, what I don't understand is why doing a (conditional, if the
> > arch endiannes requires it) byte swapping does not work.
>
> Manual byte swapping is easy but will force me to change the code at many
> other positions as long as all conversion from unsigned short back to
> QChar will fail. I would have to find all conversions and change them by
> hand. I tried it and had several problems as they are implicit and
> therefore hard to find. And the compiler doesn't help here..
> The problem is, that every conversion from QChar to ushort and vice versa
> has to be reordered manually, which is no fun.
>
> > Or changing the memcpy()s with something like:
> > for (int i = 0; i < length; i++) {
> > data[i] = string[i].unicode();
> > }
>
> "string[i].unicode()" returns unsigned short with big endian order, too:
>
> ushort unicode() const { return (rw << 8) | cl; }
This is the right code to return a ushort regardless of endiannes.
if cl is the cell and rw is the row, you get the correct ushort regardless
of the host endiannes.
Are you sure you configured qt-embedded for the right endiannes for your
host? You have to use the correct flag when configuring qt when cross
compiling, it is not guessed for you.
--
Luciano Montanaro //
\\ //
\x/ www.cirulla.net
More information about the kfm-devel
mailing list