mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-04 21:59:20 +02:00
Tabified.
Indent adjusted.
This commit is contained in:
parent
27629a8dd6
commit
7ce8abe5d6
@ -112,7 +112,7 @@ private:
|
|||||||
template <typename Stream, typename T>
|
template <typename Stream, typename T>
|
||||||
inline void pack(Stream* s, const T& v)
|
inline void pack(Stream* s, const T& v)
|
||||||
{
|
{
|
||||||
packer<Stream>(s).pack(v);
|
packer<Stream>(*s).pack(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Stream, typename T>
|
template <typename Stream, typename T>
|
||||||
@ -121,23 +121,6 @@ inline void pack(Stream& s, const T& v)
|
|||||||
packer<Stream>(s).pack(v);
|
packer<Stream>(s).pack(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define msgpack_pack_inline_func(name) \
|
|
||||||
template <typename Stream> \
|
|
||||||
inline void packer<Stream>::_pack ## name
|
|
||||||
|
|
||||||
#define msgpack_pack_inline_func_cint(name) \
|
|
||||||
template <typename Stream> \
|
|
||||||
inline void packer<Stream>::_pack ## name
|
|
||||||
|
|
||||||
#define msgpack_pack_inline_func_fixint(name) \
|
|
||||||
template <typename Stream> \
|
|
||||||
inline void packer<Stream>::_pack_fix ## name
|
|
||||||
|
|
||||||
#define msgpack_pack_user Stream&
|
|
||||||
|
|
||||||
#define msgpack_pack_append_buffer append_buffer
|
|
||||||
|
|
||||||
#if defined(__LITTLE_ENDIAN__)
|
#if defined(__LITTLE_ENDIAN__)
|
||||||
#define TAKE8_8(d) ((uint8_t*)&d)[0]
|
#define TAKE8_8(d) ((uint8_t*)&d)[0]
|
||||||
#define TAKE8_16(d) ((uint8_t*)&d)[0]
|
#define TAKE8_16(d) ((uint8_t*)&d)[0]
|
||||||
@ -294,13 +277,13 @@ inline packer<Stream>& packer<Stream>::pack_short(short d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(short) == 2) {
|
if(sizeof(short) == 2) {
|
||||||
pack_real_int16(d);
|
pack_real_int16(d);
|
||||||
} else if(sizeof(short) == 4) {
|
} else if(sizeof(short) == 4) {
|
||||||
pack_real_int32(d);
|
pack_real_int32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_int64(d);
|
pack_real_int64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -327,13 +310,13 @@ inline packer<Stream>& packer<Stream>::pack_int(int d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(int) == 2) {
|
if(sizeof(int) == 2) {
|
||||||
pack_real_int16(d);
|
pack_real_int16(d);
|
||||||
} else if(sizeof(int) == 4) {
|
} else if(sizeof(int) == 4) {
|
||||||
pack_real_int32(d);
|
pack_real_int32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_int64(d);
|
pack_real_int64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -360,13 +343,13 @@ inline packer<Stream>& packer<Stream>::pack_long(long d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(long) == 2) {
|
if(sizeof(long) == 2) {
|
||||||
pack_real_int16(d);
|
pack_real_int16(d);
|
||||||
} else if(sizeof(long) == 4) {
|
} else if(sizeof(long) == 4) {
|
||||||
pack_real_int32(d);
|
pack_real_int32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_int64(d);
|
pack_real_int64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -393,13 +376,13 @@ inline packer<Stream>& packer<Stream>::pack_long_long(long long d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(long long) == 2) {
|
if(sizeof(long long) == 2) {
|
||||||
pack_real_int16(d);
|
pack_real_int16(d);
|
||||||
} else if(sizeof(long long) == 4) {
|
} else if(sizeof(long long) == 4) {
|
||||||
pack_real_int32(d);
|
pack_real_int32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_int64(d);
|
pack_real_int64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -431,13 +414,13 @@ inline packer<Stream>& packer<Stream>::pack_unsigned_short(unsigned short d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(unsigned short) == 2) {
|
if(sizeof(unsigned short) == 2) {
|
||||||
pack_real_uint16(d);
|
pack_real_uint16(d);
|
||||||
} else if(sizeof(unsigned short) == 4) {
|
} else if(sizeof(unsigned short) == 4) {
|
||||||
pack_real_uint32(d);
|
pack_real_uint32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_uint64(d);
|
pack_real_uint64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -464,13 +447,13 @@ inline packer<Stream>& packer<Stream>::pack_unsigned_int(unsigned int d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(unsigned int) == 2) {
|
if(sizeof(unsigned int) == 2) {
|
||||||
pack_real_uint16(d);
|
pack_real_uint16(d);
|
||||||
} else if(sizeof(unsigned int) == 4) {
|
} else if(sizeof(unsigned int) == 4) {
|
||||||
pack_real_uint32(d);
|
pack_real_uint32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_uint64(d);
|
pack_real_uint64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -497,13 +480,13 @@ inline packer<Stream>& packer<Stream>::pack_unsigned_long(unsigned long d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(unsigned long) == 2) {
|
if(sizeof(unsigned long) == 2) {
|
||||||
pack_real_uint16(d);
|
pack_real_uint16(d);
|
||||||
} else if(sizeof(unsigned long) == 4) {
|
} else if(sizeof(unsigned long) == 4) {
|
||||||
pack_real_uint32(d);
|
pack_real_uint32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_uint64(d);
|
pack_real_uint64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -530,13 +513,13 @@ inline packer<Stream>& packer<Stream>::pack_unsigned_long_long(unsigned long lon
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if(sizeof(unsigned long long) == 2) {
|
if(sizeof(unsigned long long) == 2) {
|
||||||
pack_real_uint16(d);
|
pack_real_uint16(d);
|
||||||
} else if(sizeof(unsigned long long) == 4) {
|
} else if(sizeof(unsigned long long) == 4) {
|
||||||
pack_real_uint32(d);
|
pack_real_uint32(d);
|
||||||
} else {
|
} else {
|
||||||
pack_real_uint64(d);
|
pack_real_uint64(d);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user