( )⚙ D11445 dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()`

This is an archive of the discontinued Mercurial Phabricator instance.

dirstate: fix compilation warnings in `dirstate_item_set_possibly_dirty()`
ClosedPublic

Authored by martinvonz on Sep 16 2021, 8:06 PM.

Details

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.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Sep 16 2021, 8:06 PM

@marmoute You should have a look at this (also pinging to fix the CI today for the minisprint)

We should just drop the if :

self->flags |= dirstate_flag_possibly_dirty;
Py_RETURN_NONE
marmoute requested changes to this revision.Sep 17 2021, 8:39 AM
This revision now requires changes to proceed.Sep 17 2021, 8:39 AM
martinvonz edited the summary of this revision. (Show Details)Sep 17 2021, 10:55 AM
martinvonz updated this revision to Diff 30288.

We should just drop the if :

self->flags |= dirstate_flag_possibly_dirty;
Py_RETURN_NONE

Done

Alphare accepted this revision.Sep 17 2021, 10:58 AM

Thanks

marmoute accepted this revision.Sep 17 2021, 11:00 AM

Thanks for catching this.

This revision is now accepted and ready to land.Sep 17 2021, 11:00 AM