static int
ValueOfNothing(afs_int32 nothing) {
- ...
- }
+ ...
+ }
Prototypes for functions which are shared within a module should go into the a header file named _module_ \_internal.h
- Use braces where it aids readability.
- Closing and opening braces go on the same line as the control statement
- if (foo) {
- ...
- } else {
- ...
- }
+ if (foo) {
+ ...
+ } else {
+ ...
+ }
- Code surrounded by brackets should have its continuation lines lined up with the relevant opening brace
- value = CostOfEverything(ValueOfNothing(0),
- fudge);
+ value = CostOfEverything(ValueOfNothing(0),
+ fudge);
- Loops with an empty body should have their trailing semicolon on the following line, to make the empty body explicit, and suppress a compiler warning
- for (...; ...; ...)
- ;
+ for (...; ...; ...)
+ ;
- Lines should be wrapped within 80 characters
- All calls to obtain a write lock have a unique reference number. This must be unique across the cache manager (lock numbers that are in a particular OS directory may be shared, but only between OS directories), and src/afs/lock.h must be updated with the highest number in use
- New locks should be registered in the list in afs\_callback.c, so their contents can be viewed via cmdebug
--- [[SimonWilkinson]] - 27 Jul 2009
+-- Simon Wilkinson - 27 Jul 2009