From: Alexander Færøy Date: Mon, 5 Jun 2017 15:54:21 +0000 (+0000) Subject: Add Coccinelle patch for replacing NULL/non-NULL tt_assert(). X-Git-Tag: tor-0.3.2.1-alpha~145^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e1fa959201611b764ac90ce59485d33b8ea975b;p=thirdparty%2Ftor.git Add Coccinelle patch for replacing NULL/non-NULL tt_assert(). This patch replaces tt_assert() checks for NULL/non-NULL values with tt_ptr_op(). --- diff --git a/scripts/coccinelle/test_assert_null.cocci b/scripts/coccinelle/test_assert_null.cocci new file mode 100644 index 0000000000..3d66e1ee0b --- /dev/null +++ b/scripts/coccinelle/test_assert_null.cocci @@ -0,0 +1,11 @@ +@@ +expression * e; +@@ + +( +- tt_assert(e != NULL) ++ tt_ptr_op(e, OP_NE, NULL) +| +- tt_assert(e == NULL) ++ tt_ptr_op(e, OP_EQ, NULL) +)