Changeset 1cc1d3 in git for doc


Ignore:
Timestamp:
Jun 5, 2009, 1:01:19 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b21a664aa22dc6e196223af8a74ad4885e83547c')
Children:
4a1b60420152435946af3135039a7ff853ed43ae
Parents:
d29df83d83b7d3fdced5d5e22d54eb4c2e757468
Message:
macros/inline


git-svn-id: file:///usr/local/Singular/svn/trunk@11884 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/C-STYLEGUIDE

    rd29df8 r1cc1d3  
    1212- C/C++ files - structure
    1313  - TODO: What about Copyright note?
     14    (Contained in COPYING unless otherwise specified).
    1415  - each C/C++ file (abc.c/abc.cc/abc.h) should start with a short comment
    1516    about its purpose in doxygen format (TODO: see file templates) giving
    1617    at least the filename and a brief description of the contents.
    17     TODO: should not contain CVS $Id: C-STYLEGUIDE,v 1.4 2009-06-05 02:34:06 motsak Exp $ tag!?
     18    (Each header of a file should contain an Id/Rev field)
     19    TODO: should not contain CVS $Id: C-STYLEGUIDE,v 1.5 2009-06-05 11:01:19 Singular Exp $ tag!?
    1820  - order "#include" statements from global to local scope:
    1921      i. first: all system include files:
    2022        #include <iostream>, #include <boost/shred_ptr.h>
     23       (remember to include optional include files in #ifdef ... #end)
    2124     ii. only source files: #include "mod2.h"
    2225    iii. at last: all other files (which you really need):
     
    6467    visibility scope
    6568  - avoid using "goto", "continue", "break" statements
    66     (save for "switch/case" blocks)
     69    (save for "switch/case" blocks and error handling)
    6770  - compiler warnings should be enabled and regarded as errors
    6871  - whenever possible, constants should be defined as "const variables"
    69     not via "#define"
    70   - macroses should be avoided. Use "inline" functions instead
     72    not via "#define".
     73    Non pure C++ parts must use #define.
     74  - Consider the choice between macros and inline function very careful,
     75    prefer inline functions:
     76    - macros are not type safe
     77    + macros are allways inlined
     78    - arguments to macros can be multiply computed
    7179
     80    - "inline" is only a hint for the optimizer (especially in the C parts):
     81      in non-optimzed code these functions are NOT inlined.
     82    -/+ inline functions are not generic (requires the defined types)
    7283
    7384- Naming conventions:
Note: See TracChangeset for help on using the changeset viewer.