diff options
Diffstat (limited to 'src/config/ConfigValue.hpp')
| -rw-r--r-- | src/config/ConfigValue.hpp | 12 |
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 |
