mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 14:20:44 -04:00
Fix memory management and deprecated removal from serialization
Fix missing RsDiscPgpKeyItem initialization Fix inconsistent new[]/delete[] usage in RsDiscPgpKeyItem and PGPHandler::exportPublicKey which now consistently uses malloc/free Remove deprecated RsGenericSerializer::FORMAT_* Move from deprecated RsServiceSerializer::SERIALIZATION_FLAG_* to RsSerializationFlags Solve a bunch of compiler warnings Stricter checks in SerializeContext costructor
This commit is contained in:
parent
39bde58c29
commit
5610cc8600
24 changed files with 230 additions and 244 deletions
|
@ -45,11 +45,12 @@ struct RsItem : RsMemoryManagement::SmallObject, RsSerializable
|
|||
/// TODO: Do this make sense with the new serialization system?
|
||||
virtual void clear() = 0;
|
||||
|
||||
/// @deprecated use << ostream operator instead
|
||||
RS_DEPRECATED_FOR("<< ostream operator")
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t /* indent */ = 0)
|
||||
{
|
||||
RsGenericSerializer::SerializeContext ctx(
|
||||
NULL, 0, RsGenericSerializer::FORMAT_BINARY,
|
||||
RsGenericSerializer::SERIALIZATION_FLAG_NONE );
|
||||
nullptr, 0, RsSerializationFlags::NONE );
|
||||
serial_process(RsGenericSerializer::PRINT,ctx);
|
||||
return out;
|
||||
}
|
||||
|
|
|
@ -147,8 +147,8 @@ void RsMsgItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSeri
|
|||
|
||||
RsTypeSerializer::serial_process<RsTlvItem>(j,ctx,attachment,"attachment");
|
||||
|
||||
if(ctx.mFlags & RsServiceSerializer::SERIALIZATION_FLAG_CONFIG)
|
||||
RsTypeSerializer::serial_process<uint32_t>(j,ctx,msgId,"msgId");
|
||||
if(!!(ctx.mFlags & RsSerializationFlags::CONFIG))
|
||||
RS_SERIAL_PROCESS(msgId);
|
||||
}
|
||||
|
||||
void RsMsgTagType::clear()
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
#ifndef RS_MSG_ITEMS_H
|
||||
#define RS_MSG_ITEMS_H
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -33,10 +32,6 @@
|
|||
#include "serialiser/rstlvfileitem.h"
|
||||
#include "grouter/grouteritems.h"
|
||||
|
||||
#if 0
|
||||
#include "serialiser/rstlvtypes.h"
|
||||
#include "serialiser/rstlvfileitem.h"
|
||||
#endif
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
|
@ -218,17 +213,12 @@ class RsMsgParentId : public RsMessageItem
|
|||
|
||||
class RsMsgSerialiser: public RsServiceSerializer
|
||||
{
|
||||
public:
|
||||
RsMsgSerialiser(SerializationFlags flags = RsServiceSerializer::SERIALIZATION_FLAG_NONE)
|
||||
:RsServiceSerializer(RS_SERVICE_TYPE_MSG,RsGenericSerializer::FORMAT_BINARY,flags){}
|
||||
public:
|
||||
RsMsgSerialiser(
|
||||
RsSerializationFlags flags = RsSerializationFlags::NONE ):
|
||||
RsServiceSerializer(RS_SERVICE_TYPE_MSG, flags){}
|
||||
|
||||
virtual ~RsMsgSerialiser() {}
|
||||
RsItem* create_item(uint16_t service,uint8_t type) const override;
|
||||
|
||||
virtual RsItem *create_item(uint16_t service,uint8_t type) const ;
|
||||
~RsMsgSerialiser() override = default;
|
||||
};
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
#endif /* RS_MSG_ITEMS_H */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue