UninterpretedBytes.st
author claus
Mon, 08 May 1995 05:31:14 +0200
changeset 339 e8658d38abfb
parent 308 f04744ef7b5d
child 379 5b5a130ccd09
permissions -rw-r--r--
.

"
 COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

ByteArray subclass:#UninterpretedBytes
       instanceVariableNames:''
       classVariableNames:''
       poolDictionaries:''
       category:'Kernel-Objects'
!

UninterpretedBytes comment:'
COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.10 1995-03-18 05:06:37 claus Exp $
'!

!UninterpretedBytes class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

version
"
$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.10 1995-03-18 05:06:37 claus Exp $
"
!

documentation
"
    this class has been added for ST-80 compatibility.
    Notice, that in ST/X all functionality is inherited from 
    ByteArray - have a look at this for more.
"
! !

!UninterpretedBytes class methodsFor:'queries'!

isBigEndian
    "return true, if words/shorts store the most-significant
     byte first (MSB), false if least-sign.-first (LSB). 
     I.e. false for vax, intel; true for m68k, sun."

%{  /* NOCONTEXT */

    /*
     * I dont like ifdefs - you always forget some ...
     * therefore we look into a structure at run-time
     */
    union {
	unsigned int   u_l;
	char           u_c[sizeof(int)];
    } u;

    u.u_l = 0x87654321;
    if (u.u_c[0] == 0x21) RETURN (false);
    RETURN (true);
%}
    "UninterpretedBytes isBigEndian"
! !