![]() ![]() ![]()
|
BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1 |
#undef bool #define bool boolean SFMTYPEDEFALIAS(bool, Bool) #undef true #define true (TRUE) #undef false #define false (FALSE)
Related Information : SFMTYPEDEFALIAS
if (SFXAscii::IsDigit(ch) == true) { ... } // wrong usage if (SFXAscii::IsDigit(ch)) { ... } // correct usage
![]() |
Note |
|---|---|
| The function with return value of Bool type dose not necessarily return "1" as logical true value. Like C language, the values other than 0 are considered as logical true value in SophiaFramework. | |
Bool MyFunction(SIntN flag) {
return (flag & 0x4000); // wrong usage
}
![]() |
Note |
|---|---|
|
In SophiaFramework, Bool type dose not necessarily equal int type although the logical value is of int type in C language. If Bool type is defined as unsigned char type, the return value is always false (=0). | |
Bool MyFunction(int flag) {
return (flag & 0x4000 != 0); // correct usage
}
// or
Bool MyFunction(int flag) {
return !!(flag & 0x4000); // correct usage
}
typedef void Void, *VoidPtr, **VoidHandle; typedef void volatile VoidVolatile, *VoidVolatilePtr, **VoidVolatileHandle; typedef void const VoidConst, *VoidConstPtr, **VoidConstHandle; typedef void volatile const VoidVolatileConst, *VoidVolatileConstPtr, **VoidVolatileConstHandle; SFMTYPEDEFPACK(VoidPtr) SFMTYPEDEFPACK(VoidHandle)
typedef char &Ref, *Ptr, **Handle; typedef char volatile &VolatileRef, *VolatilePtr, **VolatileHandle; typedef char const &ConstRef, *ConstPtr, **ConstHandle; typedef char volatile const &VolatileConstRef, *VolatileConstPtr, **VolatileConstHandle; SFMTYPEDEFPACK(Ptr) SFMTYPEDEFPACK(Handle)
// signed integer SFMTYPEDEFALIAS(signed int, SIntN) // unsigned integer SFMTYPEDEFALIAS(unsigned int, UIntN) // 8-bit signed integer SFMTYPEDEFALIAS(signed char, SInt08) // 8-bit unsigned integer SFMTYPEDEFALIAS(unsigned char, UInt08) // 16-bit signed integer SFMTYPEDEFALIAS(signed short, SInt16) // 16-bit unsigned integer SFMTYPEDEFALIAS(unsigned short, UInt16) // 32-bit signed integer SFMTYPEDEFALIAS(signed long, SInt32) // 32-bit unsigned integer SFMTYPEDEFALIAS(unsigned long, UInt32) // 64-bit signed integer #if defined TARGET_COMPILER_MSVCPP SFMTYPEDEFALIAS(signed __int64, SInt64) #else SFMTYPEDEFALIAS(signed long long, SInt64) #endif // 64-bit unsigned integer #if defined TARGET_COMPILER_MSVCPP SFMTYPEDEFALIAS(unsigned __int64, UInt64) #else SFMTYPEDEFALIAS(unsigned long long, UInt64) #endif
SFMTYPEDEFALIAS(float, Float32) SFMTYPEDEFALIAS(double, Float64)
![]() |
Note |
|---|---|
| Since the C/C++ floating point arithmetic operations can be used in SophiaFramework, the BREW helper functions are unnecessary. | |
![]() |
Using floating point arithmetic operations |
|---|---|
The application size increases depending on the kinds of floating point arithmetic operations used, since linked with the floating point libraries. | |
Float64 num1(255);
Float64 num2(123.5);
Float64 num3;
num3 = (num1 + num2) / (num1 - num3);
if (num3 < num1) {
...
}
![]() |
Note |
|---|---|
|
Trigonometric, exponential, and logarithmic functions not included in the BREW API are available. The SFXTrigonometric class for fast trigonometric operations can be also used. Detailed Information: Mathematical functions of RealView Compilation Tools for BREW V1.2 | |
SFMTYPEDEFALIAS(char, AChar) SFMTYPEDEFALIAS(AECHAR, WChar)
![]() |
AChar and WChar |
|---|---|
|
AChar is the type for the ANSI character (multi byte character). WChar is the type for the BREW wide character. | |
|
Copyright (C) 2002 - 2008 Sophia Cradle, Inc. All Rights Reserved. |
![]() ![]() ![]()
|