Ignore:
Timestamp:
Aug 29, 2001, 8:52:22 PM (24 years ago)
Author:
umoeller
Message:

Misc changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CodingConventions.txt

    r31 r103  
    3030        as outlined below.
    3131
    32     3.  For all variables, use the usual OS/2 type prefixes.
     32    3.  Brackets style:
     33
     34                if (condition)
     35                {
     36                    // do this
     37                }
     38                else
     39                {
     40                    // do that
     41                }
     42
     43        You may leave out brackets if there's only one statement
     44        after if or else, of course, but with nested if statements,
     45        I usually add them even in that case since it's so easy
     46        to mismatch the nesting then.
     47
     48    4.  switch/case style:
     49
     50                switch (msg)
     51                {
     52                    case WM_CREATE:
     53                        // code
     54                    break;
     55
     56                    case WM_DESTROY:
     57                        // code
     58                    break;
     59                }
     60
     61    5.  For all variables, use the usual OS/2 type prefixes.
    3362        Here are some:
    3463
     
    5281        For pointers, prefix "p" (e.g. USHORT *pausThings[3]).
    5382
    54     4.  Prefix C++ class member variables with an underscore ("_").
     83    6.  Prefix C++ class member variables with an underscore ("_").
    5584        This allows people who are not familiar with the class
    5685        interface to identify member variables easily. Also, this
     
    5887        variables.
    5988
    60     5.  Prefix global variables with "G_" for the same reason.
     89    7.  Prefix global variables with "G_" for the same reason.
    6190        Global variables are potentially dangerous, so these
    6291        can be more easily identified.
    6392
    64     6.  Comment your functions in xdoc-style. See any function
     93    8.  Comment your functions in xdoc-style. See any function
    6594        in the sources for how this can be done. Basically, use
    6695        /* */-style comments before the function header and
     
    94123        to the CVS server.
    95124
    96     7.  When changing code, mark the code as changed in the
     125    9.  When changing code, mark the code as changed in the
    97126        xdoc comment by using something like the following:
    98127
     
    117146        version.
    118147
    119     8. When adding a new function, use the same, just use @@added
     148    10. When adding a new function, use the same, just use @@added
    120149        instead of @@changed.
    121150
Note: See TracChangeset for help on using the changeset viewer.