refactor: Use new hyprutils casts (#11377)

This commit is contained in:
Kamikadze
2025-08-14 19:44:56 +05:00
committed by GitHub
parent aa6a78f0a4
commit beee22a95e
116 changed files with 715 additions and 696 deletions

View File

@@ -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();
}
}