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

牽著老婆滿街逛

嚴以律己,寬以待人. 三思而后行.
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 楊粼波 閱讀(254) 評論(0)  編輯 收藏 引用

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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| 欧美激情久久久久久| 欧美日韩黄视频| 国产伦一区二区三区色一情| 精品动漫av| 蜜臀av国产精品久久久久| 在线一区欧美| 性久久久久久久久| 久久人91精品久久久久久不卡| 欧美不卡视频一区| 999亚洲国产精| 午夜精品福利在线| 欧美不卡激情三级在线观看| 欧美日韩精品一区| 国产综合精品一区| 亚洲午夜久久久久久久久电影网| 久久九九热免费视频| 亚洲三级免费电影| 一区二区欧美日韩| 鲁大师成人一区二区三区| 国产精品美女久久久| 亚洲第一级黄色片| 欧美一区二区大片| 亚洲国产美女精品久久久久∴| 亚洲中午字幕| 欧美人与性动交α欧美精品济南到| 国产欧美一区二区三区国产幕精品| 91久久精品www人人做人人爽| 亚洲欧美日本日韩| 欧美ed2k| 欧美在线播放| 国产精品视屏| 在线亚洲国产精品网站| 欧美国产大片| 久久久久久国产精品一区| 国产精品免费网站在线观看| 99精品欧美| 牛人盗摄一区二区三区视频| 午夜精品久久久久影视 | 欧美肥婆在线| 羞羞答答国产精品www一本| 欧美日韩一区二区三| 亚洲欧洲精品一区二区三区| 裸体素人女欧美日韩| 午夜精品在线| 国产精品日韩电影| 亚洲免费一区二区| 一本一本a久久| 欧美视频亚洲视频| 亚洲天堂成人在线观看| 亚洲精品一二区| 欧美美女福利视频| 一区二区三区国产精华| 亚洲人成在线观看网站高清| 欧美精品v日韩精品v韩国精品v| 亚洲第一精品久久忘忧草社区| 久久综合九色综合欧美就去吻 | 欧美韩日一区二区三区| 亚洲国产成人porn| 亚洲福利视频一区二区| 欧美电影美腿模特1979在线看| 亚洲美女精品一区| 久久久久久噜噜噜久久久精品| 国产日韩欧美精品在线| 久久激情网站| 久久综合久久久| 亚洲伦理精品| 亚洲精品一区二区三区av| 欧美日韩综合网| 欧美一区二区三区视频在线观看| 亚洲在线一区二区三区| 国产一区日韩二区欧美三区| 免费高清在线一区| 欧美人成免费网站| 久久国产婷婷国产香蕉| 裸体一区二区| 亚洲欧美日韩一区二区在线| 欧美一区二区三区视频免费| 1024亚洲| 国产精品99久久久久久有的能看| 国产亚洲人成网站在线观看| 欧美成人综合| 欧美性事在线| 玖玖精品视频| 欧美日本乱大交xxxxx| 欧美怡红院视频一区二区三区| 久久精品女人| 亚洲自拍偷拍色片视频| 久久精品99| 在线中文字幕一区| 欧美怡红院视频| 一区二区三区视频在线| 欧美在线首页| 亚洲一区黄色| 男女av一区三区二区色多| 亚洲女同在线| 欧美aa在线视频| 久久精品99久久香蕉国产色戒| 欧美不卡视频一区| 久久久久九九九| 国产精品xxxxx| 亚洲高清在线观看| 国产精品午夜在线观看| 亚洲欧洲三级| 在线欧美日韩国产| 午夜精品成人在线| 亚洲小说春色综合另类电影| 久久一区二区三区超碰国产精品| 亚洲女同同性videoxma| 欧美激情第六页| 免费高清在线视频一区·| 国产精品一卡二| 夜夜精品视频一区二区| 亚洲激情电影中文字幕| 久久激情综合| 久久久久久久91| 国产乱肥老妇国产一区二| 亚洲美女性视频| 日韩一级精品视频在线观看| 美女图片一区二区| 免费的成人av| 在线欧美日韩| 久久视频在线免费观看| 久久久久亚洲综合| 国产人妖伪娘一区91| 亚洲视频一区在线| 亚洲另类自拍| 久久久久久久网| 国产精品爱久久久久久久| 亚洲国产日韩欧美在线99 | 国产精品久久久一区麻豆最新章节| 欧美激情1区| 亚洲精品资源美女情侣酒店| 欧美激情第三页| 亚洲精品裸体| 一区二区三区偷拍| 欧美色图天堂网| 亚洲午夜一区二区| 久久成人免费日本黄色| 国产一区二区三区四区| 久久久久久综合网天天| 欧美激情精品久久久久久大尺度| 亚洲黄色小视频| 欧美激情亚洲视频| 一本大道av伊人久久综合| 午夜精品一区二区三区四区| 国产一区二区三区直播精品电影 | 久久精品久久99精品久久| 久久久久久九九九九| 在线精品国产欧美| 欧美黄色视屏| 亚洲小说欧美另类社区| 久久精品水蜜桃av综合天堂| 亚洲第一免费播放区| 欧美全黄视频| 欧美一级一区| 亚洲激情欧美| 欧美在线精品免播放器视频| 亚洲国产二区| 国产精品久久二区| 久久美女艺术照精彩视频福利播放| 亚洲第一中文字幕在线观看| 亚洲私拍自拍| 在线精品福利| 国产精品久久国产精品99gif| 欧美在线视频一区| 日韩亚洲精品电影| 美女爽到呻吟久久久久| 一本久久精品一区二区| 国产一区日韩一区| 欧美日韩在线一区二区三区| 欧美主播一区二区三区| 亚洲麻豆国产自偷在线| 玖玖精品视频| 销魂美女一区二区三区视频在线| 在线欧美不卡| 国产日韩一区二区三区| 欧美日韩免费观看一区| 久久一区中文字幕| 羞羞视频在线观看欧美| 亚洲人成绝费网站色www| 久久精品二区三区| 亚洲一区3d动漫同人无遮挡| 亚洲国产天堂网精品网站| 国产啪精品视频| 欧美日韩一本到| 欧美高清视频在线观看| 久久久久女教师免费一区| 亚洲男女自偷自拍| 99视频一区| 亚洲美女诱惑| 亚洲日本中文字幕| 亚洲国产精品精华液2区45| 麻豆成人av|