summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-12-03 15:27:32 +0100
committerAndrew Bartlett <abartlet@samba.org>2018-12-20 12:16:39 +0100
commit255117a14f117fa91fc68bf349962e3235a96acf (patch)
tree7dcf08bd37f488c88055708988b27abcbfa50295 /lib
parent9968217b88016c223ecae64f6790d6cfaa4bd340 (diff)
downloadsamba-255117a14f117fa91fc68bf349962e3235a96acf.tar.gz
replace: Cleanup comments for ZERO_*
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/replace.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index c66720b1765..36058ec35e9 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -805,32 +805,34 @@ typedef unsigned long long ptrdiff_t ;
#define __location__ __FILE__ ":" __LINESTR__
#endif
-/**
- * zero a structure
+/**
+ * Zero a structure.
*/
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
-/**
- * zero a structure given a pointer to the structure
+/**
+ * Zero a structure given a pointer to the structure.
*/
#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
-/**
- * zero a structure given a pointer to the structure - no zero check
+/**
+ * Zero a structure given a pointer to the structure - no zero check
*/
#define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
-/* zero an array - note that sizeof(array) must work - ie. it must not be a
- pointer */
+/**
+ * Zero an array - note that sizeof(array) must work - ie. it must not be a
+ * pointer
+ */
#define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x))
/**
- * work out how many elements there are in a static array
+ * Work out how many elements there are in a static array.
*/
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
-/**
- * pointer difference macro
+/**
+ * Pointer difference macro
*/
#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))