From 2fa03e0163e48d3ccbff9d953900250b52787968 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Wed, 7 Jun 2017 18:38:26 +0200 Subject: [PATCH] Removes reference to NULL in includes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I94b2d57b8234f607167488afd24364920f9624f0 Signed-off-by: José Bollo --- include/afb/afb-event-itf.h | 2 +- include/afb/afb-req-common.h | 6 +++--- include/afb/afb-req-v1.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/afb/afb-event-itf.h b/include/afb/afb-event-itf.h index 3d66a893..b1776ea0 100644 --- a/include/afb/afb-event-itf.h +++ b/include/afb/afb-event-itf.h @@ -52,7 +52,7 @@ struct afb_event */ static inline int afb_event_is_valid(struct afb_event event) { - return event.itf != NULL; + return !!event.itf; } /* diff --git a/include/afb/afb-req-common.h b/include/afb/afb-req-common.h index 8ff1b39b..df37739f 100644 --- a/include/afb/afb-req-common.h +++ b/include/afb/afb-req-common.h @@ -90,7 +90,7 @@ struct afb_req */ static inline int afb_req_is_valid(struct afb_req req) { - return req.itf != NULL; + return !!req.itf; } /* @@ -253,7 +253,7 @@ static inline void afb_req_context_set(struct afb_req req, void *context, void ( static inline void *afb_req_context(struct afb_req req, void *(*create_context)(), void (*free_context)(void*)) { void *result = afb_req_context_get(req); - if (result == NULL) { + if (!result) { result = create_context(); afb_req_context_set(req, result, free_context); } @@ -268,7 +268,7 @@ static inline void *afb_req_context(struct afb_req req, void *(*create_context)( */ static inline void afb_req_context_clear(struct afb_req req) { - afb_req_context_set(req, NULL, NULL); + afb_req_context_set(req, 0, 0); } /* diff --git a/include/afb/afb-req-v1.h b/include/afb/afb-req-v1.h index 03b4ee68..db231352 100644 --- a/include/afb/afb-req-v1.h +++ b/include/afb/afb-req-v1.h @@ -29,7 +29,7 @@ static inline struct afb_req *afb_req_store_v1(struct afb_req req) { struct afb_req *result = (struct afb_req*)malloc(sizeof *result); - if (result != NULL) { + if (result) { *result = req; afb_req_addref(req); } -- 2.16.6