emacs fucking sucks.

This commit is contained in:
Adam D. Moss 1999-05-31 17:06:53 +00:00
parent 4a13995205
commit 76d0fb2ccb
2 changed files with 44 additions and 2 deletions

View file

@ -66,6 +66,18 @@
*/
/* endianness guessing from wmf.c */
#define G_LITTLE_ENDIAN 1234
#define G_BIG_ENDIAN 4321
#if defined(__i386__)
#define G_BYTE_ORDER G_LITTLE_ENDIAN
#elif defined(__hppa) || defined(__sparc)
#define G_BYTE_ORDER G_BIG_ENDIAN
#else
#error set byte order by hand by adding your machine above
#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
@ -299,7 +311,16 @@ load_image (char *filename)
only have to fill in the alpha channel. */
for (i=(wwidth*wheight)-1; i>=0; i--)
{
data[i*4+3] = 255;
#if G_BYTE_ORDER == G_BIG_ENDIAN
unsigned char r,g,b;
r = data[i*4+3 ];
g = data[i*4+2 ];
b = data[i*4+1 ];
data[i*4+2]= b;
data[i*4+1]= g;
data[i*4 ] = r;
#endif
data[i*4+3] = 255;
}

View file

@ -66,6 +66,18 @@
*/
/* endianness guessing from wmf.c */
#define G_LITTLE_ENDIAN 1234
#define G_BIG_ENDIAN 4321
#if defined(__i386__)
#define G_BYTE_ORDER G_LITTLE_ENDIAN
#elif defined(__hppa) || defined(__sparc)
#define G_BYTE_ORDER G_BIG_ENDIAN
#else
#error set byte order by hand by adding your machine above
#endif
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
@ -299,7 +311,16 @@ load_image (char *filename)
only have to fill in the alpha channel. */
for (i=(wwidth*wheight)-1; i>=0; i--)
{
data[i*4+3] = 255;
#if G_BYTE_ORDER == G_BIG_ENDIAN
unsigned char r,g,b;
r = data[i*4+3 ];
g = data[i*4+2 ];
b = data[i*4+1 ];
data[i*4+2]= b;
data[i*4+1]= g;
data[i*4 ] = r;
#endif
data[i*4+3] = 255;
}