mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-31 03:43:49 -07:00
refactor: Use new hyprutils casts (#11377)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user