dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()`
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 16 Sep 2021 16:42:16 -0700
changeset 47976 2018753014be
parent 47975 ec178161a8d1
child 47981 d1d9510f73f0
dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()` Since https://phab.mercurial-scm.org/D11387 (i.e. the same patch as mentioned in my previous patch), Clang has also started warning about `dirstate_item_set_possibly_dirty()` missing an explicit return, and about its use of the result of an assignment as a condition without using parentheses. This patch fixes that. Differential Revision: https://phab.mercurial-scm.org/D11445
mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c	Thu Sep 16 16:29:55 2021 -0700
+++ b/mercurial/cext/parsers.c	Thu Sep 16 16:42:16 2021 -0700
@@ -488,9 +488,8 @@
    to make sure it is correct. */
 static PyObject *dirstate_item_set_possibly_dirty(dirstateItemObject *self)
 {
-	if (self->flags |= dirstate_flag_possibly_dirty) {
-		Py_RETURN_NONE;
-	}
+	self->flags |= dirstate_flag_possibly_dirty;
+	Py_RETURN_NONE;
 }
 
 /* See docstring of the python implementation for details */