Spice project coding style and coding conventions Table of Contents 1.C and C++ style......................................................................................................................3 2.Source Files............................................................................................................................3 2.1.Names..............................................................................................................................3 2.2.Line width.........................................................................................................................3 2.3.Tabs.................................................................................................................................3 2.4.White spaces...................................................................................................................3 2.5.New Line..........................................................................................................................3 3.Comparing...............................................................................................................................3 4.TRUE, FALSE and NULL........................................................................................................3 5.Static storage initialization......................................................................................................4 6.Fixme and todo.......................................................................................................................4 7.ASSERT..................................................................................................................................4 8.sizeof ......................................................................................................................................4 9.const........................................................................................................................................4 10.goto.......................................................................................................................................4 11.Defining Constant values......................................................................................................4 12.void argument.......................................................................................................................5 13.Short functions......................................................................................................................5 14.Return on if............................................................................................................................5 15.Names...................................................................................................................................5 16.Optimization..........................................................................................................................6 17.Spacing.................................................................................................................................6 18.Function Indentation..............................................................................................................6 19.Branching indentation...........................................................................................................7 20.Types indentation .................................................................................................................8 21.Vertical indentation................................................................................................................8 22.Multi line macro indentation..................................................................................................9 23.Multi line array indentation....................................................................................................9 24.C++........................................................................................................................................9 24.1.One super......................................................................................................................9 24.2.Data members...............................................................................................................9 24.3.Object reference............................................................................................................9 24.4.Templates......................................................................................................................9 24.5. '*' and '&'.....................................................................................................................10 24.6.Class indentation.........................................................................................................10 24.7.Constructor indentation................................................................................................11 24.8.bool..............................................................................................................................11 24.9.Operator overloading...................................................................................................11 24.10.AutoRef and AutoPtr..................................................................................................11 25.Spice client..........................................................................................................................11 25.1.#ifdef PLATFORM.......................................................................................................11 25.2.Use standard macros...................................................................................................11 1.
- 粉丝: 52
- 资源: 13
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助