mirror of git://git.sysmocom.de/ofono
coding-style: Use void if function has no parameters
This commit is contained in:
parent
e51e1243e3
commit
eddb058643
|
@ -279,6 +279,21 @@ memset(stuff, 0, sizeof(*stuff));
|
||||||
memset(stuff, 0, sizeof *stuff); // Wrong
|
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
|
O1: Shorten the name
|
||||||
====================
|
====================
|
||||||
Better to use abbreviation, rather than full name, to name a variable,
|
Better to use abbreviation, rather than full name, to name a variable,
|
||||||
|
|
Loading…
Reference in New Issue