From: Robert K. <may...@us...> - 2001-06-06 21:49:07
|
Update of /cvsroot/bitcollider/bitcollider/image In directory usw-pr-cvs1:/tmp/cvs-serv21991/image Modified Files: image.c Log Message: Ooops, the last checkin didn't get my endian changes Index: image.c =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/image/image.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** image.c 2001/06/06 21:22:50 1.2 --- image.c 2001/06/06 21:49:04 1.3 *************** *** 61,64 **** --- 61,70 ---- #endif + #ifdef WORDS_BIGENDIAN + # define BIGENDIAN 1 + #else + # define BIGENDIAN 0 + #endif + /*--Plugin Info------------------------------------------------------------*/ *************** *** 192,201 **** fseek(file, 16L, SEEK_CUR); - *width = read_32_little_endian(file); *height = read_32_little_endian(file); - fseek(file, 2L, SEEK_CUR); *bpp = read_16_little_endian(file); return 0; --- 198,213 ---- fseek(file, 16L, SEEK_CUR); + #if BIGENDIAN + *width = read_32_big_endian(file); + *height = read_32_big_endian(file); + fseek(file, 2L, SEEK_CUR); + *bpp = read_16_big_endian(file); + #else + *width = read_32_little_endian(file); *height = read_32_little_endian(file); fseek(file, 2L, SEEK_CUR); *bpp = read_16_little_endian(file); + #endif return 0; *************** *** 212,218 **** fseek(file, 3L, SEEK_CUR); *width = (uint32) read_16_little_endian(file); - *height = (uint32) read_16_little_endian(file); /* packed byte: --- 224,234 ---- fseek(file, 3L, SEEK_CUR); + #if BIGENDIAN + *width = (uint32) read_16_big_endian(file); + *height = (uint32) read_16_big_endian(file); + #else *width = (uint32) read_16_little_endian(file); *height = (uint32) read_16_little_endian(file); + #endif /* packed byte: |