码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • C++ 代码规范 cppcheck 样式修改


    /*
     * style
     */
        1.Using C-style cast.  Use reinterpret_cast(...) instead  [readability/casting]

            const_cast(BT_VER)
            reinterpret_cast(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需有一个空格

  • 相关阅读:
    我的有趣的英语学习经历
    域名生意逆市火爆 BNS能否接棒ENS?
    Git在实际生产中的使用
    C++ Reference: Standard C++ Library reference: C Library: cmath: hypot
    物联网技术助力智慧城市安全建设:构建全方位、智能化的安全防护体系
    WPF几何绘图(2)
    git checkout到新的分支之后原来未提交的代码找回
    JUC系列(六) 线程池
    MySQL Linux服务器快照克隆引起的binlog日志无法正常删除导致文件系统满
    嵌入式物联网在医疗行业中的应用——案例分析
  • 原文地址:https://blog.csdn.net/xiaozhiwise/article/details/132909836
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号