From 2593cb2feb3553f5de72d1d574bbf2ef97636fa4 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 6 May 2019 13:04:45 +0200 Subject: [PATCH] More descriptive documentation about enum size in gossip items Also use hexadecimal value as Cyril like that more ;) --- .../gossipdiscovery/gossipdiscoveryitems.h | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h b/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h index 7830e91a5..70bf5920a 100644 --- a/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h +++ b/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h @@ -33,12 +33,12 @@ enum class RsGossipDiscoveryItemType : uint8_t { - PGP_LIST = 1, - PGP_CERT = 2, - CONTACT = 5, - IDENTITY_LIST = 6, - INVITE = 7, - INVITE_REQUEST = 8 + PGP_LIST = 0x1, + PGP_CERT = 0x2, + CONTACT = 0x5, + IDENTITY_LIST = 0x6, + INVITE = 0x7, + INVITE_REQUEST = 0x8 }; class RsDiscItem: public RsItem @@ -51,12 +51,17 @@ public: virtual ~RsDiscItem(); }; -/// uint32_t overkill just for retro-compatibility +/** + * This enum is underlined by uint32_t for historical reasons. + * We are conscious that uint32_t is an overkill for so few possible values but, + * changing here it at this point would break binary serialized item + * retro-compatibility. + */ enum class RsGossipDiscoveryPgpListMode : uint32_t { - NONE = 0, - FRIENDS = 1, - GETCERT = 2 + NONE = 0x0, + FRIENDS = 0x1, + GETCERT = 0x2 }; class RsDiscPgpListItem: public RsDiscItem