]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/protocol.h
Update hash function call
[libs/net.git] / source / net / protocol.h
index 256d978ec1d2ca0dfc24ce0bb29da4ac9f006445..e078caff57ac8569d36a1fd24b3e5e1f2686f8fe 100644 (file)
@@ -256,10 +256,10 @@ protected:
 
 public:
        template<typename P>
-       unsigned serialize(const P &, char *, unsigned) const;
+       std::size_t serialize(const P &, char *, std::size_t) const;
 
-       unsigned get_packet_size(const char *, unsigned) const;
-       unsigned dispatch(ReceiverBase &, const char *, unsigned) const;
+       std::size_t get_packet_size(const char *, std::size_t) const;
+       std::size_t dispatch(ReceiverBase &, const char *, std::size_t) const;
 
        UInt64 get_hash() const;
 
@@ -291,7 +291,7 @@ const Protocol::PacketTypeDef<P> &Protocol::get_packet_by_class() const
 }
 
 template<typename P>
-unsigned Protocol::serialize(const P &pkt, char *buf, unsigned size) const
+std::size_t Protocol::serialize(const P &pkt, char *buf, std::size_t size) const
 {
        const PacketTypeDef<P> &pdef = get_packet_by_class<P>();
        if(!pdef.get_id())
@@ -328,6 +328,7 @@ struct Protocol::Traits
        typedef CompoundSerializer<T> Serializer;
 };
 
+template<> struct Protocol::Traits<bool>: BasicTraits<bool, 'B'> { };
 template<> struct Protocol::Traits<Int8>: BasicTraits<Int8, 'I'> { };
 template<> struct Protocol::Traits<UInt8>: BasicTraits<UInt8, 'U'> { };
 template<> struct Protocol::Traits<Int16>: BasicTraits<Int16, 'I'> { };