From 30149060db243d268c440655b87f87190dae4a16 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 18 Nov 2024 01:44:38 +0000 Subject: [PATCH] cleanup: Use `true`/`false` instead of `0`/`1` for boolean literals. clang-tidy: modernize-use-bool-literals --- .clang-tidy | 1 + src/core/toxfile.h | 4 ++-- src/model/conference.cpp | 4 ++-- src/model/exiftransform.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 3ca3497a9d..64f4678149 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,4 +1,5 @@ Checks: "-* +, modernize-use-bool-literals , modernize-use-emplace , readability-named-parameter , readability-inconsistent-declaration-parameter-name diff --git a/src/core/toxfile.h b/src/core/toxfile.h index a3c4c1f6e8..b4a9f9a283 100644 --- a/src/core/toxfile.h +++ b/src/core/toxfile.h @@ -33,8 +33,8 @@ struct ToxFile // current form (can add fields though as db representation is an int) enum FileDirection : bool { - SENDING = 0, - RECEIVING = 1, + SENDING = false, + RECEIVING = true, }; ToxFile(); diff --git a/src/model/conference.cpp b/src/model/conference.cpp index be9a88e3b5..dbe8d98694 100644 --- a/src/model/conference.cpp +++ b/src/model/conference.cpp @@ -34,8 +34,8 @@ Conference::Conference(int conferenceId_, const ConferenceId persistentConferenc // in conferences, we only notify on messages containing your name <-- dumb // sound notifications should be on all messages, but system popup notification // on naming is appropriate - hasNewMessages = 0; - userWasMentioned = 0; + hasNewMessages = false; + userWasMentioned = false; regeneratePeerList(); } diff --git a/src/model/exiftransform.cpp b/src/model/exiftransform.cpp index 162b0690e9..e509f09574 100644 --- a/src/model/exiftransform.cpp +++ b/src/model/exiftransform.cpp @@ -62,24 +62,24 @@ QImage applyTransformation(QImage image, Orientation orientation) case Orientation::TopLeft: break; case Orientation::TopRight: - image = image.mirrored(1, 0); + image = image.mirrored(true, false); break; case Orientation::BottomRight: exifTransform.rotate(180); break; case Orientation::BottomLeft: - image = image.mirrored(0, 1); + image = image.mirrored(false, true); break; case Orientation::LeftTop: exifTransform.rotate(-90); - image = image.mirrored(1, 0); + image = image.mirrored(true, false); break; case Orientation::RightTop: exifTransform.rotate(90); break; case Orientation::RightBottom: exifTransform.rotate(90); - image = image.mirrored(1, 0); + image = image.mirrored(true, false); break; case Orientation::LeftBottom: exifTransform.rotate(-90);