-
Notifications
You must be signed in to change notification settings - Fork 63
Coding conventions
Michael Frey edited this page Jun 29, 2018
·
1 revision
tbd
Absolute values must be specified as macros or enums, not as literals, i.e. instead of
int timeout = 42 * 1000000;
write
int timeout = TIMEOUT_INTERVAL * USEC_PER_SEC;
Avoid using forward declarations where possible. Just #include the headers you need. For further information on this rationale please check the Google Style Guide on C++.
All header files should have #define guards to prevent multiple inclusion. The format of the symbol name should be <PROJECT>_<MODULE>_<FILE>_H_.
, e.g. CCNL_CORE_FWD.H
. For example, the file ccn-lite/src/ccnl-core/include/ccnl_fwd.h in our project should have the following guard:
#ifndef CCNL_CORE_FWD
#define CCNL_CORE_FWD
...
#endif
- Make one commit per change.
- The first line of the commit message describes the main feature of the commit.
If the CI tests fail due to errors these errors need to be addressed.