FILLZERO is a macro for memset(&foo,0,sizeof(foo)). It eliminates the
possiblity to make the error memset(&foo,0,sizeof(&foo)).
No callers yet, but document it in CODING_STYLE. (In accordance with
existing libxl policy, I haven't gone through all existing possible
call sites.)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: New in this version of the series.
libxl__ctx_[un]lock CTX_LOCK, CTX_UNLOCK
gc=...; ao=...; EGC_GC, AO_GC, STATE_AO_GC
explicit gc creation GC_INIT, GC_FREE
+ memset(..,0,sizeof..) FILLZERO
ERROR HANDLING
})
+#define FILLZERO LIBXL_FILLZERO
+
+
/*
* All of these assume (or define)
* libxl__gc *gc;
void libxl_string_copy(libxl_ctx *ctx, char **dst, char **src);
+
+#define LIBXL_FILLZERO(object) (memset(&(object), 0, sizeof((object))))
+
#endif
/*