The fundamental Symbian OS types are as follows.
• TIntX and TUintX (where X = 8, 16 and 32) are used for 8-, 16-
and 32-bit signed and unsigned integers respectively. Unless there is
a good reason to do so, such as for size optimization or compatibility,
the non-specific TInt or TUint types should be used, corresponding
to signed and unsigned 32-bit integers, respectively.
• TInt64: Releases of Symbian OS prior to v8.0 had no built-in
support for 64-bit arithmetic on hardware builds, so the TInt64 class
implemented a 64-bit integer as two 32-bit values. On Symbian OS
v8.0 and later, TInt64 and TUInt64 are typedef’d to long long
and use the available native 64-bit support.
• TReal32 and TReal64 (and TReal, which equates to TReal64)
should be used for single- and double-precision floating-point numbers,
equivalent to float and double respectively. Operations on
these types are likely to be slower than those on integers, so they
should be avoided unless they are absolutely necessary.
• TAny* should be used in preference to void*, effectively replacing
it with a typedef’d ‘‘pointer to anything’’. TAny is thus equivalent
to void but, in the context where void means ‘‘nothing’’, it is not
necessary to replace the native void type. Thus a function taking
a void* pointer (to anything) and returning void (nothing) will on
Symbian OS have a signature as follows:
void TypicalFunction(TAny* aPointerParameter);
and not
TAny TypicalFunction(TAny* aPointerParameter);
• TBool should be used for Boolean types. For historical reasons TBool
is equivalent to int and the Symbian OS typedef’d values of ETrue
(= 1) and EFalse (= 0) should be used. However, since C++ will
interpret any non-zero value as true, direct comparisons with ETrue
should not be made.