"john" <email@example.com> wrote:
>I much prefer the convention of
>SInt8, SInt16, SInt32, SInt64, SInt128...
>UInt8, UInt16, UInt32, UInt64, UInt128...
>SChar8, SChar16, SChar32...
>UChar8, UChar16, UChar32...
>so that whether the thing is signed or unsigned is explicit and
>tightly bound, as it were.
Whether they are named "SInt8", "S_INT_8", "sint8_t" depends on
personal taste, coding style and conventions. ISO C provides
"uintXX_t" for unsigned integers. I agree that it would be better also
to denote the signedness explicitly. But I have to deal with it.
Redefining (renaming) all identifiers that do not conform to my taste
is a fight I can't win.
These data types unambigously define the size of the integer in bits.
But for data interchange between different systems the byte order is
also an issue. So "int16_t" should have two variants "int16be_t" and
"int16le_t" and maybe "int16_t" is only the default of the actual
processor architecture. That would require special compiler support.
Does Java specify the byte order of the primitive data types? I don't
know. But I would guess no, for performance reasons.
This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:06 EDT