From be5a0e8108cb5d17b4e36f5858e1700ccb645c8b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 16 May 2025 15:18:00 +0100 Subject: Serialize using mutable objects not immutable ones. --- modules/chanserv/cs_entrymsg.cpp | 2 +- modules/chanserv/cs_log.cpp | 2 +- modules/chanserv/cs_mode.cpp | 4 ++-- modules/chanserv/cs_seen.cpp | 2 +- modules/chanserv/cs_set_misc.cpp | 2 +- modules/chanserv/cs_suspend.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/chanserv') diff --git a/modules/chanserv/cs_entrymsg.cpp b/modules/chanserv/cs_entrymsg.cpp index ac83e45f1..db247a05f 100644 --- a/modules/chanserv/cs_entrymsg.cpp +++ b/modules/chanserv/cs_entrymsg.cpp @@ -39,7 +39,7 @@ struct EntryMsgTypeImpl final { } - void Serialize(const Serializable *obj, Serialize::Data &data) const override + void Serialize(Serializable *obj, Serialize::Data &data) const override { const auto *msg = static_cast(obj); data.Store("ci", msg->chan); diff --git a/modules/chanserv/cs_log.cpp b/modules/chanserv/cs_log.cpp index b33a1bf44..797c1df35 100644 --- a/modules/chanserv/cs_log.cpp +++ b/modules/chanserv/cs_log.cpp @@ -44,7 +44,7 @@ struct LogSettingTypeImpl final { } - void Serialize(const Serializable *obj, Serialize::Data &data) const override + void Serialize(Serializable *obj, Serialize::Data &data) const override { const auto *ls = static_cast(obj); data.Store("ci", ls->chan); diff --git a/modules/chanserv/cs_mode.cpp b/modules/chanserv/cs_mode.cpp index d6339311e..14d5d27c3 100644 --- a/modules/chanserv/cs_mode.cpp +++ b/modules/chanserv/cs_mode.cpp @@ -39,7 +39,7 @@ struct ModeLockTypeImpl final : Serialize::Type("ModeLock") { } - void Serialize(const Serializable *obj, Serialize::Data &data) const override; + void Serialize(Serializable *obj, Serialize::Data &data) const override; Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override; }; @@ -211,7 +211,7 @@ struct ModeLocksImpl final } }; -void ModeLockTypeImpl::Serialize(const Serializable *obj, Serialize::Data &data) const +void ModeLockTypeImpl::Serialize(Serializable *obj, Serialize::Data &data) const { const auto *ml = static_cast(obj); data.Store("ci", ml->ci); diff --git a/modules/chanserv/cs_seen.cpp b/modules/chanserv/cs_seen.cpp index ec90206e1..53b0b5865 100644 --- a/modules/chanserv/cs_seen.cpp +++ b/modules/chanserv/cs_seen.cpp @@ -53,7 +53,7 @@ struct SeenInfoType final { } - void Serialize(const Serializable *obj, Serialize::Data &data) const override + void Serialize(Serializable *obj, Serialize::Data &data) const override { const auto *s = static_cast(obj); data.Store("nick", s->nick); diff --git a/modules/chanserv/cs_set_misc.cpp b/modules/chanserv/cs_set_misc.cpp index 8d6effafe..68c4e6b80 100644 --- a/modules/chanserv/cs_set_misc.cpp +++ b/modules/chanserv/cs_set_misc.cpp @@ -54,7 +54,7 @@ struct CSMiscDataType { } - void Serialize(const Serializable *obj, Serialize::Data &sdata) const override + void Serialize(Serializable *obj, Serialize::Data &sdata) const override { const auto *d = static_cast(obj); sdata.Store("ci", d->object); diff --git a/modules/chanserv/cs_suspend.cpp b/modules/chanserv/cs_suspend.cpp index 9df5cea0b..4ddf431ff 100644 --- a/modules/chanserv/cs_suspend.cpp +++ b/modules/chanserv/cs_suspend.cpp @@ -27,7 +27,7 @@ struct CSSuspendInfoType final { } - void Serialize(const Serializable *obj, Serialize::Data &data) const override + void Serialize(Serializable *obj, Serialize::Data &data) const override { const auto *si = static_cast(obj); data.Store("chan", si->what); -- cgit