文件名称:spice_style.pdf
文件大小:166KB
文件格式:PDF
更新时间:2018-06-01 04:21:45
spice linux 远程桌面
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.