[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Portable Code (am I dreaming? :))
From:       shaheed <srhaque () iee ! org>
Date:       2002-01-13 10:54:19
[Download RAW message or body]

Hi Clarence,

> Do I have to care about making filter code portable?

I think you should. The MS Word filter started off (consciously, see below) 
being little-endian and unaligned access dependent, and I soon found that 
Ihad both Sparc and Alpha users. The MS Word filter has hooks for both these 
platforms (see macro crap in mswordgenerated.h), but amazingly enough, there 
are platforms for which the appropriate compiler pragmas do not seem to exist 
(Irix and possibly HPUX).

I finally started work to fix this (it is "easy" in my case because I 
generated the code involved), but have not yet finished.

> With non-portable expressions like these, which make assumptions on data
> type sizes and byte ordering and bit ordering...

The first step is to use Q_{U,}INT{8,16,32} as I believe you can trust these 
to be set correctly on any platform. Then, QDataStream in little endian mode 
may be your friend. If only I had known about these when I started...

Thanks, Shaheed
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic