[Request] [+ ] D11445: dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()`

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Sep 17 00:07:02 UTC 2021


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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. I don't know if `return
  NULL` was the intent.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11445

AFFECTED FILES
  mercurial/cext/parsers.c

CHANGE DETAILS

diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c
+++ b/mercurial/cext/parsers.c
@@ -487,9 +487,11 @@
    to make sure it is correct. */
 static PyObject *dirstate_item_set_possibly_dirty(dirstateItemObject *self)
 {
-	if (self->flags |= dirstate_flag_possibly_dirty) {
+	self->flags |= dirstate_flag_possibly_dirty;
+	if (self->flags) {
 		Py_RETURN_NONE;
 	}
+	return NULL;
 }
 
 /* See docstring of the python implementation for details */



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210917/62e2bcc3/attachment.html>


More information about the Mercurial-patches mailing list