git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ee890a6
)
CodingStyle: Mention that "free" functions should accept a null pointer.
author
Ben Pfaff
<blp@nicira.com>
Thu, 4 Nov 2010 00:07:33 +0000
(17:07 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 4 Nov 2010 00:15:39 +0000
(17:15 -0700)
I've always written OVS code this way, so this just codifies it so that
others know.
CodingStyle
patch
|
blob
|
history
diff --git
a/CodingStyle
b/CodingStyle
index
bbb492e
..
2ee189f
100644
(file)
--- a/
CodingStyle
+++ b/
CodingStyle
@@
-156,6
+156,12
@@
parameters and their corresponding size parameters should be paired.
...
}
...
}
+Functions that destroy an instance of a dynamically-allocated type
+should accept and ignore a null pointer argument. Code that calls
+such a function (including the C standard library function free())
+should omit a null-pointer check. We find that this usually makes
+code easier to read.
+
FUNCTION PROTOTYPES
FUNCTION PROTOTYPES