Symbian基本类型

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.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值