From ebffe8f61db10b1a7d19a822edba40eb2eaccc7e Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 13 Feb 2024 16:26:06 +0000 Subject: [PATCH] API: make addSpecialConfigValue take a ref to val woo breaking API and ABI --- include/hyprlang.hpp | 6 ++++-- src/config.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hyprlang.hpp b/include/hyprlang.hpp index 66497de..7b6a2e0 100644 --- a/include/hyprlang.hpp +++ b/include/hyprlang.hpp @@ -299,11 +299,13 @@ namespace Hyprlang { void removeSpecialCategory(const char* name); /*! - \since 0.3.0 + \since 0.3.2 Add a config value to a special category. + + \note Before 0.3.2, this takes a `const CConfigValue` (non-ref) */ - void addSpecialConfigValue(const char* cat, const char* name, const CConfigValue value); + void addSpecialConfigValue(const char* cat, const char* name, const CConfigValue& value); /*! Remove a config value from a special category. diff --git a/src/config.cpp b/src/config.cpp index fd5d707..7d8dff9 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -70,7 +70,7 @@ void CConfig::addConfigValue(const char* name, const CConfigValue& value) { reinterpret_cast(value.m_pData)->dtor}); } -void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CConfigValue value) { +void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CConfigValue& value) { const auto IT = std::find_if(impl->specialCategoryDescriptors.begin(), impl->specialCategoryDescriptors.end(), [&](const auto& other) { return other->name == cat; }); if (IT == impl->specialCategoryDescriptors.end())