青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

牽著老婆滿街逛

嚴以律己,寬以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

OGRE Code Review HOWTO

http://temas.obelisk.net/ogre/CR/docs/howto.html

OGRE Code Review HOWTO

Thomas Muldowney


Introduction

The time has come for all good men to come to the aid of their favorite rendering engine. The OGRE Project needs you to help with an ongoing code review. This document will outline how everyone will be able to participate and what guidelines need to be followed. It will also outline what will need to be looked for during the review process.

The Process

The code review will center around this website and use a fairly simple voting process to decide when a file has passed review. Here is a quickstart guide to understanding the process:

  1. Create a normal user account on the website.
  2. Pick a file that needs more reviewers and flag that you are beginning to review it.
  3. With the other reviewers leave comments and/or patches to make the file compliant with the process.
  4. When you are done reviewing a file flag your review complete.
  5. When an administrator has decided you have been helpful in the review process they will promote you to a voter.
  6. Once a voter you can still continue the normal process of commenting and submitting patches, but you can now vote on the completion of a file.
  7. When a file has received a set number of votes it will be flagged for an administrator to finalize.
  8. When an administrator finalizes a file it is considered to be fully satisfying the reveiw rules, and may be reopened when major changes are made.

What to Look For

The following areas are where the focus of the review should be directed. Many will have very specific criteria to be considered complete, but others will be more open to a general concensus of the reviewers. The current list of review points is fairly short and will be updated as the review develops. Many of the review points come from the Effective C++, More Effective C++ and Effective STL by Scotty Meyers. If you don't already have these books, you really want to get them. Other points come from decisions by the core team and practical experience. If you feel there should be additions or changes, please contact .

Style

These rules deal with the general look of the files, including issues such as indenting, bracket placement, variable naming, etc.

  • All indentation is done using 4 spaces, no tabs.

  • Braces are placed under any line that needs a new logical block. This includes if, else, for, while, class defnitions, function definitions, and most others.

    Example?1.?Normal Brace Usage

                  while (expr)
                  {
                      // This is the logical block. It spans multiple lines,
                      // and is surrounded by braces.
                  }
                
  • The primary namespace declaration for a file should have the brace placed on the same line as the declaration.

    Example?2.?Namespace Brace Usage

                  namespace Ogre {
                
  • Logical blocks that are only one line do not need braces, but should be on a new line and indented. If a previous and connected block statement (else to an if) has braces then the connected block must have braces, even if it is one line long.

    Example?3.?One Line Logical Blocks

                  if (expr)
                      // One line block
                  else
                      // else may be handled the same.
                

    Example?4.?Connected Blocks

                  if (expr)
                  {
                      // This part is multi line and with braces.
                      // So we must have braces on any connected parts now.
                  }
                  else
                  {
                      // Even though this is on line, it has braces.
                  }
                
  • Control and looping statements that are followed by a "(" should have a space before the open-parenthesis.

    Example?5.?Parenthesis Space

                  if (expr)
                      // Space after the if
                  while (expr)
                      // Space after the while
                  for (expr)
                      // Space after the for
                
  • Control and looping expressions inside parentheses should not have a space before or after the expression.

    Example?6.?Expression Spaces

                  if (expr) // This acceptable, no space before or after expr
                  if ( expr ) // UNACCEPTABLE, spaces should not be before or after expr
                
  • The "else if" control block should always be on a single line.

    Example?7.?Else If Control Block

                  // Acceptable, else if on one line
                  else if
                  // UNACCEPTABLE else if on multiple lines
                  else
                      if
                
  • Switch statements abide by all the previous control block rules, and must have their case statements on the same indentation level as the actual switch statement. Statements inside a case should be indented one level.

    Example?8.?Switch Statements

                  // Acceptable
                  switch (expr)
                  {
                  case CASE1:
                      // The case statement is on the same indentation level
                      // with the switch, and it's statements are indented
                      // one level.
                      break;
                  };
    
                  // UNACCEPTABLE
                  switch( expr )
                  {
                      case CASE1:
                          // The case statement should be on the same
                          // indentation level of the switch statement
                          break;
                  };
                
  • All names should be written in English.

  • Method and function names should be verbs that clearly state what they will do. The name should use a mixed case format, starting with a lower case letter. Methods not intended for general API usage, rather for internal engine usage, it should be prefixed with an underscore.

  • Variables should clearly state what information they contain and use a mixed case format, starting with a lower case letter. Private and protected member variables should be prefixed with a lower case "m" and be followed by an upper case letter. The names may use limited abbreviation, but should be quickly understandable. An exception to this is looping variables (such as in afor loop), this may be a simple single letter variable such as "i".

    Example?9.?Variable Naming

                    loggingLevel // Most clear
                    logLvl // Acceptable, still quickly clear
                    ll // unacceptable
    
                    for (int i = 0; i < max; ++i) // Acceptable
                  

    Are we sure about the "m" for those member vars?

  • Each class should be contained in its won file, unless the class is directly relevant (supporting) to another and is small.

Design Guidelines

  • Prefer initialization to assignment in constructors.

    This one needs a lot of improvement in our code.

  • Use const when it is possible. This includes variables and method declaration.

  • Use pass-by-reference over pass-by-value when possible.

  • Prefix calls to standard library functions with "::".

  • Strongly prefer C++ style casts to C style casts.

  • For STL containers, use empty() instead of checking size() against zero.

  • When advancing iterators and variables prefer ++var to var++.

  • If a base class has virtual functions, derived classes should have the "virtual" keyword repeated for those functions.

    Note

    There are differing reports on whether this might break some compilations for platforms we still wish to maintain. If that is the case, we need to reevaluate this.

  • Base type names should not use any abbreviations.

    Example?10.?Type Names

                  unsigned int // Acceptable
                  uint // UNACCEPTABLE
                
  • C++ style headers should be preferred over C style.

    Example?11.?C++ Style Headers

                  #inclue <cstring> // Acceptable
                  #include <string.h> // UNACCEPTABLE
                
  • Prefer standard C++ library and STL functions over C stdlib functions.

    Example?12.?Functions

                  // Acceptable
                  ifstream fil;
                  fil.open("filename.txt");
                  fil.close();
    
                  // UNACCEPTABLE
                  FILE* fil = fopen("filename.txt", "w");
                  fclose(fil);
                
  • All class variables should be initialized to a sane value in the constructor.

  • It is not necessary to check that a pointer value is not NULL before deleting it in a destructor, or elsewhere. C++ guarantees that delete on a NULL value is safe.

    Example?13.?Deleting Pointers

                    // Acceptable, delete NULL is safe
                    Val* ptrValue = 0;
                    delete ptrValue;
                    // UNACCEPTABLE
                    if (ptrValue != NULL)
                        delete ptrValue;
                
  • 0 should be preferred over NULL.

    Example?14.?Prefer 0

                  Val* ptrValue = 0; // Acceptable
                  Val* ptrValue = NULL; // UNACCEPTABLE
                
  • When a member value pointer is deleted, it should be set to 0.

OGRE Specific Guidelines

  • Prefer Ogre::String over std::string or other string types.

posted on 2007-01-29 21:59 楊粼波 閱讀(268) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            伊人色综合久久天天| 亚洲美女视频| 欧美在线观看视频在线| 一区二区av| 国产精品毛片大码女人| 亚洲欧美日本视频在线观看| 一区二区三区精品视频在线观看| 国产精品www.| 欧美在线播放| 久久久噜噜噜久久人人看| 一区二区在线看| 欧美激情一区二区三区蜜桃视频| 欧美国产精品日韩| 一区二区三区欧美亚洲| 亚洲视频999| 国产日产欧美精品| 女仆av观看一区| 欧美日韩国产成人在线观看| 亚洲女同精品视频| 午夜精品偷拍| 亚洲精品四区| 亚洲一级二级| 在线观看视频欧美| 99pao成人国产永久免费视频| 国产精品电影观看| 美国成人毛片| 欧美日韩一本到| 久久理论片午夜琪琪电影网| 欧美.com| 久久福利电影| 欧美激情综合色| 久久精品国产77777蜜臀| 久久综合电影| 亚洲欧美影院| 欧美va天堂va视频va在线| 亚洲综合视频在线| 久久色中文字幕| 亚洲欧美日韩精品久久久| 久久亚洲精品一区二区| 亚洲女人天堂成人av在线| 久久亚洲春色中文字幕久久久| 99精品视频网| 久久久午夜精品| 午夜精品久久久久久久99热浪潮| 久久亚洲高清| 久久电影一区| 欧美日韩裸体免费视频| 欧美成人午夜影院| 国产欧美91| 一区二区三区精品在线| 亚洲国产精品一区制服丝袜 | 午夜国产一区| 欧美国产日韩一区二区三区| 久久高清国产| 国产精品日韩欧美大师| 亚洲日本va午夜在线影院| 国产综合色产在线精品| 亚洲色图自拍| 亚洲一二三区精品| 欧美久久影院| 亚洲精品精选| 99国内精品久久| 欧美激情片在线观看| 亚洲国产高清一区二区三区| 激情综合亚洲| 久久看片网站| 农夫在线精品视频免费观看| 好吊日精品视频| 欧美在线免费视屏| 久久久久久综合| 激情久久一区| 久久久久久精| 欧美第一黄网免费网站| 亚洲国产精品t66y| 免费日韩av片| 亚洲精品久久久久久下一站| 亚洲人成在线播放网站岛国| 老色批av在线精品| 亚洲激情另类| 一区二区三区回区在观看免费视频| 欧美成人tv| 亚洲免费激情| 性做久久久久久久免费看| 国产精品视频在线观看| 亚洲欧美三级在线| 久久亚洲视频| 亚洲人成毛片在线播放| 欧美激情第1页| 中日韩高清电影网| 欧美一区二区三区四区在线观看地址| 国产女人精品视频| 久久久精品国产免大香伊| 欧美96在线丨欧| av成人免费观看| 国产精品久久一区主播| 久久成人精品视频| 亚洲电影激情视频网站| 在线一区亚洲| 韩国av一区二区| 欧美激情一区二区三级高清视频| 亚洲毛片av| 久久精品日产第一区二区三区 | 欧美精品自拍| 亚洲在线一区二区三区| 老色鬼久久亚洲一区二区| 最近中文字幕日韩精品| 国产精品进线69影院| 久久本道综合色狠狠五月| 欧美激情一区二区三区全黄| 亚洲男女自偷自拍图片另类| 一色屋精品亚洲香蕉网站| 欧美日韩播放| 久久精品一区二区国产| 在线综合亚洲| 欧美夫妇交换俱乐部在线观看| 亚洲专区国产精品| 亚洲国产精品t66y| 国产欧美日韩一区二区三区| 免费观看成人www动漫视频| 亚洲天堂黄色| 亚洲精品九九| 欧美成人激情在线| 欧美一区亚洲一区| 亚洲一级电影| 亚洲精品乱码久久久久久黑人| 国产色综合天天综合网| 欧美日韩精品一区二区三区| 久久裸体艺术| 欧美在线观看日本一区| 一本色道久久88精品综合| 欧美激情综合| 免费毛片一区二区三区久久久| 欧美亚洲网站| 亚洲一区二区免费看| 亚洲麻豆国产自偷在线| 亚洲国产精品成人精品| 国产在线视频欧美| 国产精品视频精品视频| 欧美特黄a级高清免费大片a级| 免费短视频成人日韩| 久久久久国色av免费看影院| 亚洲欧美日韩精品| 亚洲一区免费网站| 亚洲手机成人高清视频| 夜夜精品视频| 一区二区三区.www| 日韩亚洲不卡在线| 99视频一区二区三区| 亚洲精品一线二线三线无人区| 亚洲电影第三页| 欧美高清视频www夜色资源网| 久久综合网色—综合色88| 久久激情一区| 久久综合九色综合欧美就去吻| 久久久久久久久一区二区| 久久精品五月| 久久男人资源视频| 农夫在线精品视频免费观看| 老色鬼精品视频在线观看播放| 玖玖玖免费嫩草在线影院一区| 久久久久这里只有精品| 免费成人你懂的| 亚洲国产精品成人综合色在线婷婷 | 国产精品高潮在线| 国产精品色网| 一区免费在线| 亚洲激情视频网站| 一本色道久久综合狠狠躁篇的优点| 中文精品视频一区二区在线观看| 亚洲一区二区三区成人在线视频精品| 亚洲欧美日韩一区在线观看| 久久精品国产亚洲高清剧情介绍| 久久国产精品高清| 欧美ab在线视频| 91久久综合亚洲鲁鲁五月天| 一区二区三区日韩欧美精品| 亚洲欧美激情一区| 久久久久久综合| 欧美日韩天堂| 国产一区二区三区av电影| 亚洲成色精品| 亚洲免费一在线| 久久综合久久综合这里只有精品| 亚洲国产精品va在线看黑人| 一区二区欧美视频| 久久精品一区二区三区不卡| 欧美日韩国产成人| 国产精品久久久久久久久免费| 韩国成人福利片在线播放| 一区二区欧美精品| 久久一区亚洲| 中文精品视频| 欧美电影免费观看高清完整版| 国产精品福利在线观看| 亚洲电影成人| 欧美一区二区视频97| 亚洲激情第一页| 久久精品一区二区三区不卡牛牛| 欧美日韩中文在线| 亚洲第一久久影院|