C++ 代码规范 cppcheck 样式修改

/*
 * 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 )
        ) 前后有空格

    14.Missing space before ( in if(
        if需有一个空格

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值