warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
2015-01-19 14:15
567 查看
//原函数为FF->CallBack(KK_DATA_OK);
//出现警告:warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
//解决办法:FF->CallBack(KK_DATA_OK!=0);
==================================================
bool 与 BOOL 的区别
BOOL型在windef.h头文件中被定义,其实际类型为int,换句话说,BOOL其实就是int型变量,与布尔型bool没有什么关系。
至于true和TRUE,同样的,true和false是都是布尔值,而TRUE是一个int值(其值为1),FALSE也是int值(其值为0)。
//出现警告:warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
//解决办法:FF->CallBack(KK_DATA_OK!=0);
==================================================
bool 与 BOOL 的区别
BOOL型在windef.h头文件中被定义,其实际类型为int,换句话说,BOOL其实就是int型变量,与布尔型bool没有什么关系。
至于true和TRUE,同样的,true和false是都是布尔值,而TRUE是一个int值(其值为1),FALSE也是int值(其值为0)。
相关文章推荐
- warning C4800: 'VARIANT_BOOL' : forcing value to bool 'true' or 'false' (performance warning)
- 编译提示: warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
- warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
- warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
- Optional int parameter 'id' is present but cannot be translated into a null value due to being decla
- Unable to get value of the property '2': object is null or undefined
- spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper
- Optional int parameter 'page' is present but cannot be translated into a null value due to being dec
- spring mvc 数据绑定报错 Failed to convert property value of type 'java.lang.String' to required type 'int'
- 'POPUP_TO_GET_ONE_VALUE'
- Cannot open include file: 'inttypes.h': No such file or directory
- Cannot insert explicit value for identity column in table 'settings' when IDENTITY_INSERT is set to OFF.
- error C2664: 'cvSetMouseCallback' : cannot convert parameter 2 from 'void (__cdecl *)(int,int,int,int)' to 'CvMouseCallback' 的解决
- error C2664: 'cvSetMouseCallback' : cannot convert parameter 2 from 'void (__cdecl *)(int,int,int,int)' to 'CvMouseCallback' 的解决
- Unable to create a constant value of type 'Closure type'.异常
- error C2664: 'RtCreateTimer' : cannot convert parameter 3 from 'int (void *)' to 'void (__stdcall *)(void *)'问题解决办法
- fedora 15 安装opencv2.2时出现undefined reference to `cvCreateCameraCapture_V4L(int)'问题及其解决方法
- tcc88xx/android配置linux内核(make tcc88xx_defconfig)时gcc:error trying to exec 'cc1':execvp:No such file or directory
- Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key
- arm-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory