/*
* style
*/
1.Using C-style cast. Use reinterpret_cast<char*>(...) instead [readability/casting]
const_cast<char*>(BT_VER)
reinterpret_cast<char*>(BT_VER)
2.Do not use namespace using-directives. Use using-declarations instead.
(不要使用命名空间using指令。请改用using声明)
使用 using std::thread 替代 using namespace std;
3.Should have a space between // and comment [whitespace/comments] [4]
注释后面加一个空格
4. { should almost always be at the end of the previous line
把函数的括号移到函数参数 ) 后面,即不要换行;
5.Redundant blank line at the start of a code block should be deleted.
(应删除代码块开头的多余空行)
空函数{}之间不能有空行
6.Line ends in whitespace.
删除结尾空格
7.Missing space before ( in for(
for需有一个空格
8.Missing spaces around = [whitespace/operators]
等号两边有空格
9.Weird number of spaces at line-start. Are you using a 2-space indent?
行起始处有空格
10.At least two spaces is best between code and comments
注释前最少有两个空格
11.Missing space after , [whitespace/comma] [3]
参数之间要有空格
12.If/else bodies with multiple statements require braces
具有多个语句的If/else实体需要大括号
13.Extra space before )
) 前后有空格文章来源:https://www.toymoban.com/news/detail-733620.html
14.Missing space before ( in if(
if需有一个空格文章来源地址https://www.toymoban.com/news/detail-733620.html
到了这里,关于C++ 代码规范 cppcheck 样式修改的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!