diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2011-01-11 23:39:30 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-01-11 14:48:11 -0800 |
commit | eddb058643a9878c98f87adfd4d3c30fdcb9d1cb (patch) | |
tree | 4c68656b4055a5f5489fa05eaca6500079600a25 /doc/coding-style.txt | |
parent | e51e1243e310764fba678933c24dea0403640b73 (diff) | |
download | ofono-eddb058643a9878c98f87adfd4d3c30fdcb9d1cb.tar.bz2 |
coding-style: Use void if function has no parameters
Diffstat (limited to 'doc/coding-style.txt')
-rw-r--r-- | doc/coding-style.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/coding-style.txt b/doc/coding-style.txt index 3bee2407..40bb36b9 100644 --- a/doc/coding-style.txt +++ b/doc/coding-style.txt @@ -279,6 +279,21 @@ memset(stuff, 0, sizeof(*stuff)); memset(stuff, 0, sizeof *stuff); // Wrong +M15: Use void if function has no parameters +=========================================================== +A function with no parameters must use void in the parameter list. + +Example: +1) +void foo(void) +{ +} + +2) +void foo() // Wrong +{ +} + O1: Shorten the name ==================== Better to use abbreviation, rather than full name, to name a variable, |