AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
September 1994

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



1994.09.20 12:29 "MSB vs. LSB. (Was: TIFF Bit Ordering Versus Fill Order)", by Thomas Kinsman

> From owner-tiff@cthulhu.engr.sgi.com Mon Sep 19 20:14:04 1994
> Date: Mon, 19 Sep 94 19:31:24 EDT
> From: jqa@allegra.att.com (Jim Arnold)
> To: tiff@sgi.com
> Subject: Re: TIFF Bit Ordering Versus Fill Order
#include <stdio.h>

union
{
	long	field1;
	char	field2[4];
}  var;

main()
{
    var.field2[0] = 0;
    var.field2[1] = 1;
    var.field2[2] = 2;
    var.field2[3] = 3;
    
    if (var.field1 == (1 << 16) + (2<<8) + 3)
	    puts("Big-endian");
    else if (var.field1 == (3 << 24) + (2<<16) + (1 << 8))
	    puts("Little-endian");
    else
	    puts("unknown-endian");
}