Skip to content

Commit cb4d851

Browse files
committed
1 parent bf7fece commit cb4d851

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

example/protocol.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace myprotocol {
1717

1818
struct Put : define< tuple<uint32_t, std::string, raw_ref> > {
1919
Put() { }
20-
Put(uint32_t f, const std::string& k, const char* valref, size_t vallen) :
20+
Put(uint32_t f, const std::string& k, const char* valref, uint32_t vallen) :
2121
define_type(msgpack_type( f, k, raw_ref(valref,vallen) )) { }
2222
uint32_t& flags() { return get<0>(); }
2323
std::string& key() { return get<1>(); }

pack_template.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ msgpack_pack_inline_func(_false)(msgpack_pack_user x)
688688
* Array
689689
*/
690690

691-
msgpack_pack_inline_func(_array)(msgpack_pack_user x, unsigned int n)
691+
msgpack_pack_inline_func(_array)(msgpack_pack_user x, size_t n)
692692
{
693693
if(n < 16) {
694694
unsigned char d = 0x90 | n;
@@ -709,7 +709,7 @@ msgpack_pack_inline_func(_array)(msgpack_pack_user x, unsigned int n)
709709
* Map
710710
*/
711711

712-
msgpack_pack_inline_func(_map)(msgpack_pack_user x, unsigned int n)
712+
msgpack_pack_inline_func(_map)(msgpack_pack_user x, size_t n)
713713
{
714714
if(n < 16) {
715715
unsigned char d = 0x80 | n;

src/msgpack/pack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ static int msgpack_pack_nil(msgpack_packer* pk);
8686
static int msgpack_pack_true(msgpack_packer* pk);
8787
static int msgpack_pack_false(msgpack_packer* pk);
8888

89-
static int msgpack_pack_array(msgpack_packer* pk, unsigned int n);
89+
static int msgpack_pack_array(msgpack_packer* pk, size_t n);
9090

91-
static int msgpack_pack_map(msgpack_packer* pk, unsigned int n);
91+
static int msgpack_pack_map(msgpack_packer* pk, size_t n);
9292

9393
static int msgpack_pack_raw(msgpack_packer* pk, size_t l);
9494
static int msgpack_pack_raw_body(msgpack_packer* pk, const void* b, size_t l);

src/msgpack/pack.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ class packer {
7070
packer<Stream>& pack_true();
7171
packer<Stream>& pack_false();
7272

73-
packer<Stream>& pack_array(unsigned int n);
73+
packer<Stream>& pack_array(size_t n);
7474

75-
packer<Stream>& pack_map(unsigned int n);
75+
packer<Stream>& pack_map(size_t n);
7676

7777
packer<Stream>& pack_raw(size_t l);
7878
packer<Stream>& pack_raw_body(const char* b, size_t l);
@@ -112,14 +112,14 @@ class packer {
112112
static void _pack_true(Stream& x);
113113
static void _pack_false(Stream& x);
114114

115-
static void _pack_array(Stream& x, unsigned int n);
115+
static void _pack_array(Stream& x, size_t n);
116116

117-
static void _pack_map(Stream& x, unsigned int n);
117+
static void _pack_map(Stream& x, size_t n);
118118

119119
static void _pack_raw(Stream& x, size_t l);
120120
static void _pack_raw_body(Stream& x, const void* b, size_t l);
121121

122-
static void append_buffer(Stream& x, const unsigned char* buf, unsigned int len)
122+
static void append_buffer(Stream& x, const unsigned char* buf, size_t len)
123123
{ x.write((const char*)buf, len); }
124124

125125
private:
@@ -294,12 +294,12 @@ inline packer<Stream>& packer<Stream>::pack_false()
294294

295295

296296
template <typename Stream>
297-
inline packer<Stream>& packer<Stream>::pack_array(unsigned int n)
297+
inline packer<Stream>& packer<Stream>::pack_array(size_t n)
298298
{ _pack_array(m_stream, n); return *this; }
299299

300300

301301
template <typename Stream>
302-
inline packer<Stream>& packer<Stream>::pack_map(unsigned int n)
302+
inline packer<Stream>& packer<Stream>::pack_map(size_t n)
303303
{ _pack_map(m_stream, n); return *this; }
304304

305305

src/msgpack/vrefbuffer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ void msgpack_vrefbuffer_destroy(msgpack_vrefbuffer* vbuf);
7777
static inline msgpack_vrefbuffer* msgpack_vrefbuffer_new(size_t ref_size, size_t chunk_size);
7878
static inline void msgpack_vrefbuffer_free(msgpack_vrefbuffer* vbuf);
7979

80-
static inline int msgpack_vrefbuffer_write(void* data, const char* buf, unsigned int len);
80+
static inline int msgpack_vrefbuffer_write(void* data, const char* buf, size_t len);
8181

8282
static inline const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref);
8383
static inline size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref);
8484

8585
int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf,
86-
const char* buf, unsigned int len);
86+
const char* buf, size_t len);
8787

8888
int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf,
89-
const char* buf, unsigned int len);
89+
const char* buf, size_t len);
9090

9191
int msgpack_vrefbuffer_migrate(msgpack_vrefbuffer* vbuf, msgpack_vrefbuffer* to);
9292

@@ -112,7 +112,7 @@ static inline void msgpack_vrefbuffer_free(msgpack_vrefbuffer* vbuf)
112112
free(vbuf);
113113
}
114114

115-
static inline int msgpack_vrefbuffer_write(void* data, const char* buf, unsigned int len)
115+
static inline int msgpack_vrefbuffer_write(void* data, const char* buf, size_t len)
116116
{
117117
msgpack_vrefbuffer* vbuf = (msgpack_vrefbuffer*)data;
118118

src/msgpack/vrefbuffer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class vrefbuffer : public msgpack_vrefbuffer {
4040
}
4141

4242
public:
43-
void write(const char* buf, unsigned int len)
43+
void write(const char* buf, size_t len)
4444
{
4545
if(len < base::ref_size) {
4646
append_copy(buf, len);

src/vrefbuffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void msgpack_vrefbuffer_clear(msgpack_vrefbuffer* vbuf)
9595
}
9696

9797
int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf,
98-
const char* buf, unsigned int len)
98+
const char* buf, size_t len)
9999
{
100100
if(vbuf->tail == vbuf->end) {
101101
const size_t nused = vbuf->tail - vbuf->array;
@@ -120,7 +120,7 @@ int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf,
120120
}
121121

122122
int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf,
123-
const char* buf, unsigned int len)
123+
const char* buf, size_t len)
124124
{
125125
msgpack_vrefbuffer_inner_buffer* const ib = &vbuf->inner_buffer;
126126

0 commit comments

Comments
 (0)