]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add Coccinelle patch for replacing NULL/non-NULL tt_assert().
authorAlexander Færøy <ahf@torproject.org>
Mon, 5 Jun 2017 15:54:21 +0000 (15:54 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 24 Aug 2017 19:22:20 +0000 (15:22 -0400)
This patch replaces tt_assert() checks for NULL/non-NULL values with
tt_ptr_op().

scripts/coccinelle/test_assert_null.cocci [new file with mode: 0644]

diff --git a/scripts/coccinelle/test_assert_null.cocci b/scripts/coccinelle/test_assert_null.cocci
new file mode 100644 (file)
index 0000000..3d66e1e
--- /dev/null
@@ -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)
+)