clang-tidy: Add override keywords
Marked virtual functions with the `override` keyword to ensure
they correctly override base class functions. This resolves
-Winconsistent-missing-override warnings and improves code safety
and readability by explicitly indicating overridden functions.
'''
item_updater.hpp:120:18: [0m[0;1;31m
error: [0m[1m'deleteAll' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override
static/item_updater_static.hpp:75:10: [0m[0;1;31m
error: [0m[1m'validateImage' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override][0m
'''
Tested: Build verified
Change-Id: Iee2bb85498db72c8f2a9f265e0490fff9288f5f4
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index e444055..4832a5f 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -117,7 +117,7 @@
/**
* @brief Erases any non-active pnor versions.
*/
- virtual void deleteAll() = 0;
+ virtual void deleteAll() override = 0;
/** @brief Brings the total number of active PNOR versions to
* ACTIVE_PNOR_MAX_ALLOWED -1. This function is intended to be
diff --git a/static/item_updater_static.hpp b/static/item_updater_static.hpp
index 77409ba..46cd45b 100644
--- a/static/item_updater_static.hpp
+++ b/static/item_updater_static.hpp
@@ -72,7 +72,7 @@
const std::string& filePath) override;
/** @brief Validate if image is valid or not */
- bool validateImage(const std::string& path);
+ bool validateImage(const std::string& path) override;
/** @brief Host factory reset - clears PNOR partitions for each
* Activation D-Bus object */