[GRASS5] Re: [NVIZ] Code for PPM dumps
Markus Neteler
neteler at geog.uni-hannover.de
Wed Sep 27 11:39:17 EDT 2000
Hi all,
now the endian problem is fixed.
On Wed, Sep 27, 2000 at 04:16:44PM +0100, Markus Neteler wrote:
> On Tue, Sep 26, 2000 at 12:56:48PM +0200, Andreas Lange wrote:
> > Markus,
> >
> > the big endian/little endian part of the code will give problems, as not
> > only sun machines are big-endian. There are more general solutions, have
> > a look at tifflib. There must be other code within grass where this
> > problem is solved, but i have currently no time to search. I don't know
> > exactly if a config-solution or a solution within the code is better,
I have searched the code and found a test in
./src.contrib/GMSL/NVIZ2.2/TOGL/apps/image.c
union {
int testWord;
char testByte[4];
} endianTest;
int swapFlag;
endianTest.testWord = 1;
if (endianTest.testByte[0] == 1) {
swapFlag = 1;
} else {
swapFlag = 0;
}
if (swapFlag) {
dothis; /*true: little endian */
}
else {
dothat; /* big endian */
}
It is implemented now in
src/libes/ogsf/gsd_img_ppm.c
Please report any problems.
Markus
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'
More information about the grass-dev
mailing list