diff options
author | madmaxoft <github@xoft.cz> | 2013-10-28 20:57:03 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-28 20:57:03 +0100 |
commit | dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1 (patch) | |
tree | 3cc9621b2bd0e6852da5ab9695d9b0a8cf460241 /source/ByteBuffer.h | |
parent | cByteBuffer: Added the VarInt and VarUTF8String type reading and writing. (diff) | |
download | cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.tar cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.tar.gz cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.tar.bz2 cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.tar.lz cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.tar.xz cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.tar.zst cuberite-dfefdcf7f1cb1c7a741bb2deb82b7fb9634657b1.zip |
Diffstat (limited to 'source/ByteBuffer.h')
-rw-r--r-- | source/ByteBuffer.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/ByteBuffer.h b/source/ByteBuffer.h index eb5ce5910..71ee4764e 100644 --- a/source/ByteBuffer.h +++ b/source/ByteBuffer.h @@ -58,13 +58,13 @@ public: bool ReadBEDouble (double & a_Value); bool ReadBool (bool & a_Value); bool ReadBEUTF16String16(AString & a_Value); // string length as BE short, then string as UTF-16BE - bool ReadVarInt (UInt64 & a_Value); + bool ReadVarInt (UInt32 & a_Value); bool ReadVarUTF8String (AString & a_Value); // string length as VarInt, then string as UTF-8 - /// Reads VarInt, assigns it to anything that can be assigned from an UInt64 (unsigned int, short, char, Byte, double, ...) + /// Reads VarInt, assigns it to anything that can be assigned from an UInt32 (unsigned short, char, Byte, double, ...) template <typename T> bool ReadVarUInt(T & a_Value) { - UInt64 v; + UInt32 v; bool res = ReadVarInt(v); if (res) { @@ -83,7 +83,7 @@ public: bool WriteBEDouble (double a_Value); bool WriteBool (bool a_Value); bool WriteBEUTF16String16(const AString & a_Value); // string length as BE short, then string as UTF-16BE - bool WriteVarInt (UInt64 a_Value); + bool WriteVarInt (UInt32 a_Value); bool WriteVarUTF8String (AString & a_Value); // string length as VarInt, then string as UTF-8 /// Reads a_Count bytes into a_Buffer; returns true if successful |