summaryrefslogtreecommitdiff
path: root/src/config/ConfigValue.hpp
diff options
context:
space:
mode:
authorKamikadze <40305144+Kam1k4dze@users.noreply.github.com>2025-08-14 19:44:56 +0500
committerGitHub <noreply@github.com>2025-08-14 15:44:56 +0100
commitbeee22a95ed9044950e5486f22edd813e00ffa2c (patch)
tree4612fa3d9b17275d417a059c19f998c64e871997 /src/config/ConfigValue.hpp
parentaa6a78f0a4e17c49ed4aff8b58c3f7ec7ef0408f (diff)
refactor: Use new hyprutils casts (#11377)
Diffstat (limited to 'src/config/ConfigValue.hpp')
-rw-r--r--src/config/ConfigValue.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/config/ConfigValue.hpp b/src/config/ConfigValue.hpp
index a159bf8c..1da359b6 100644
--- a/src/config/ConfigValue.hpp
+++ b/src/config/ConfigValue.hpp
@@ -29,7 +29,7 @@ class CConfigValue {
}
T* ptr() const {
- return *(T* const*)p_;
+ return *rc<T* const*>(p_);
}
T operator*() const {
@@ -48,26 +48,26 @@ inline std::string* CConfigValue<std::string>::ptr() const {
template <>
inline std::string CConfigValue<std::string>::operator*() const {
- return std::string{*(Hyprlang::STRING*)p_};
+ return std::string{*rc<const Hyprlang::STRING*>(p_)};
}
template <>
inline Hyprlang::STRING* CConfigValue<Hyprlang::STRING>::ptr() const {
- return (Hyprlang::STRING*)p_;
+ return rc<Hyprlang::STRING*>(*p_);
}
template <>
inline Hyprlang::STRING CConfigValue<Hyprlang::STRING>::operator*() const {
- return *(Hyprlang::STRING*)p_;
+ return *rc<const Hyprlang::STRING*>(p_);
}
template <>
inline Hyprlang::CUSTOMTYPE* CConfigValue<Hyprlang::CUSTOMTYPE>::ptr() const {
- return *(Hyprlang::CUSTOMTYPE* const*)p_;
+ return *rc<Hyprlang::CUSTOMTYPE* const*>(p_);
}
template <>
inline Hyprlang::CUSTOMTYPE CConfigValue<Hyprlang::CUSTOMTYPE>::operator*() const {
RASSERT(false, "Impossible to implement operator* of CConfigValue<Hyprlang::CUSTOMTYPE>, use ptr()");
return *ptr();
-}
+} \ No newline at end of file