mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-29 07:25:55 +02:00
Replaced types of length from unsigned int to size_t.
This commit is contained in:
parent
3dc636bf3e
commit
ffd0525607
@ -64,7 +64,7 @@ static inline void msgpack_sbuffer_free(msgpack_sbuffer* sbuf)
|
||||
#define MSGPACK_SBUFFER_INIT_SIZE 8192
|
||||
#endif
|
||||
|
||||
static inline int msgpack_sbuffer_write(void* data, const char* buf, unsigned int len)
|
||||
static inline int msgpack_sbuffer_write(void* data, const char* buf, size_t len)
|
||||
{
|
||||
msgpack_sbuffer* sbuf = (msgpack_sbuffer*)data;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
void write(const char* buf, unsigned int len)
|
||||
void write(const char* buf, size_t len)
|
||||
{
|
||||
if(base::alloc - base::size < len) {
|
||||
expand_buffer(len);
|
||||
|
@ -65,7 +65,7 @@ static inline char* msgpack_zbuffer_release_buffer(msgpack_zbuffer* zbuf);
|
||||
#define MSGPACK_ZBUFFER_RESERVE_SIZE 512
|
||||
#endif
|
||||
|
||||
static inline int msgpack_zbuffer_write(void* data, const char* buf, unsigned int len);
|
||||
static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len);
|
||||
|
||||
static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf);
|
||||
|
||||
@ -123,7 +123,7 @@ bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf)
|
||||
return true;
|
||||
}
|
||||
|
||||
int msgpack_zbuffer_write(void* data, const char* buf, unsigned int len)
|
||||
int msgpack_zbuffer_write(void* data, const char* buf, size_t len)
|
||||
{
|
||||
msgpack_zbuffer* zbuf = (msgpack_zbuffer*)data;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
void write(const char* buf, unsigned int len)
|
||||
void write(const char* buf, size_t len)
|
||||
{
|
||||
if(msgpack_zbuffer_write(this, buf, len) < 0) {
|
||||
throw std::bad_alloc();
|
||||
|
Loading…
x
Reference in New Issue
Block a user