Fix warning about macro expansion
ClosedPublic

Authored by gengisdave on Sep 14 2019, 11:29 AM.

Details

Summary

As stated by the clang compiler, when the macro is expanded the not operator is applied only to the left side of the comparison.

Also, the macro in krpreviews.cpp can be deleted because it is not used.

Test Plan

The only critical point is in KrPreviewJob::slotStartJob(), where !(_job == 0) is not equal to !_job == 0. This method is used to show the file preview instead of the icon.

Diff Detail

Repository
R167 Krusader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
gengisdave requested review of this revision.Sep 14 2019, 11:29 AM
gengisdave created this revision.
abika accepted this revision.Sep 16 2019, 2:30 PM
abika added a subscriber: abika.

...where !(_job == 0) is not equal to !_job == 0.

Isn't the result always the same?

Replacing 0 by nullptr would also be good. I already did a global replacement with clang-tidy -fix a while ago but this one was missed due to the macro.

Anyway, safe to merge.

This revision is now accepted and ready to land.Sep 16 2019, 2:30 PM
This revision was automatically updated to reflect the committed changes.