From e369d800ba64a4047787afd0b416f7d26cfd33f4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 8 Nov 2016 09:18:52 +0100 Subject: [PATCH] pyldb: protect PyErr_LDB_ERROR_IS_ERR_RAISE() with do {} while(0) This should avoid the following warning: CID 1394274: Control flow issues (DEADCODE) Execution cannot reach this statement: ";". Signed-off-by: Stefan Metzmacher Reviewed-by: Stefan Metzmacher --- lib/ldb/pyldb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ldb/pyldb.h b/lib/ldb/pyldb.h index e0cce1e89d2..4fc89ec4814 100644 --- a/lib/ldb/pyldb.h +++ b/lib/ldb/pyldb.h @@ -95,11 +95,12 @@ typedef struct { struct ldb_control *data; } PyLdbControlObject; -#define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) \ +#define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) do { \ if (ret != LDB_SUCCESS) { \ PyErr_SetLdbError(err, ret, ldb); \ return NULL; \ - } + } \ +} while(0) /* Picked out of thin air. To do this properly, we should probably have some part of the * errors in LDB be allocated to bindings ? */ -- 2.11.4.GIT