Don't initialize QFlags<T> with 0 value
ClosedPublic

Authored by zzag on Sep 14 2019, 7:50 PM.

Details

Summary

clang-tidy has a check that converts all usages of null pointer literals
to nullptr keyword. However, there's a small issue related to QFlags<T>.

Apparently, QFlags<T> has a constructor that takes a pointer and if you
pass 0 to it, clang-tidy will replace 0 with nullptr, e.g.

NET::States(0) -> NET::States(nullptr)

Even though passing nullptr is totally correct, it looks very weird.

Test Plan

Complies.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Sep 14 2019, 7:50 PM
Restricted Application added a project: KWin. · View Herald TranscriptSep 14 2019, 7:50 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Sep 14 2019, 7:50 PM
gladhorn accepted this revision.Sep 14 2019, 8:10 PM
gladhorn added a subscriber: gladhorn.

Makes sense.

This revision is now accepted and ready to land.Sep 14 2019, 8:10 PM
This revision was automatically updated to reflect the committed changes.