author | Claus Gittinger <cg@exept.de> |
Thu, 23 Nov 1995 11:46:35 +0100 | |
changeset 620 | c7353f86a302 |
parent 530 | 07d0bce293c9 |
child 695 | 20ec350f92ca |
permissions | -rw-r--r-- |
1 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
300 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
ByteArray subclass:#UninterpretedBytes |
|
14 |
instanceVariableNames:'' |
|
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
308 | 17 |
category:'Kernel-Objects' |
1 | 18 |
! |
19 |
||
68 | 20 |
!UninterpretedBytes class methodsFor:'documentation'! |
1 | 21 |
|
88 | 22 |
copyright |
23 |
" |
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
300 | 25 |
All Rights Reserved |
88 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
version |
|
530
07d0bce293c9
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
37 |
^ '$Header: /cvs/stx/stx/libbasic/UninterpretedBytes.st,v 1.13 1995-11-11 15:28:03 cg Exp $' |
88 | 38 |
! |
39 |
||
68 | 40 |
documentation |
41 |
" |
|
42 |
this class has been added for ST-80 compatibility. |
|
300 | 43 |
Notice, that in ST/X all functionality is inherited from |
68 | 44 |
ByteArray - have a look at this for more. |
45 |
" |
|
46 |
! ! |
|
1 | 47 |
|
48 |
!UninterpretedBytes class methodsFor:'queries'! |
|
49 |
||
50 |
isBigEndian |
|
77 | 51 |
"return true, if words/shorts store the most-significant |
52 |
byte first (MSB), false if least-sign.-first (LSB). |
|
53 |
I.e. false for vax, intel; true for m68k, sun." |
|
1 | 54 |
|
55 |
%{ /* NOCONTEXT */ |
|
56 |
||
57 |
/* |
|
58 |
* I dont like ifdefs - you always forget some ... |
|
59 |
* therefore we look into a structure at run-time |
|
60 |
*/ |
|
61 |
union { |
|
300 | 62 |
unsigned int u_l; |
63 |
char u_c[sizeof(int)]; |
|
1 | 64 |
} u; |
65 |
||
66 |
u.u_l = 0x87654321; |
|
77 | 67 |
if (u.u_c[0] == 0x21) RETURN (false); |
68 |
RETURN (true); |
|
1 | 69 |
%} |
77 | 70 |
"UninterpretedBytes isBigEndian" |
1 | 71 |
! ! |