mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Remove more redundant casts
Signed-off-by: Navid Fayezi navidfayezi.98@gmail.com Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -357,10 +357,10 @@ int ssh_connector_remove_event(ssh_connector connector);
|
|||||||
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
|
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
|
||||||
|
|
||||||
/** Zero a structure */
|
/** Zero a structure */
|
||||||
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
|
#define ZERO_STRUCT(x) memset(&(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)
|
#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((x), 0, sizeof(*(x))); } while(0)
|
||||||
|
|
||||||
/** Get the size of an array */
|
/** Get the size of an array */
|
||||||
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
|
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||||
|
|||||||
Reference in New Issue
Block a user