Replaced uint32_t with size_t.

User buffer size is not limited by msgpack-c so size_t is the
appropriate type.
This commit is contained in:
Takatoshi Kondo 2016-07-16 09:32:19 +09:00
parent aa790ba785
commit b9bc9d4195
2 changed files with 4 additions and 4 deletions

View File

@ -99,7 +99,7 @@ MSGPACK_DLLEXPORT
void msgpack_object_print(FILE* out, msgpack_object o);
MSGPACK_DLLEXPORT
int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_object o);
int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o);
MSGPACK_DLLEXPORT
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);

View File

@ -222,10 +222,10 @@ void msgpack_object_print(FILE* out, msgpack_object o)
}
}
int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_object o)
int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o)
{
char *aux_buffer = buffer;
uint32_t aux_buffer_size = buffer_size;
size_t aux_buffer_size = buffer_size;
int ret;
switch(o.type) {
case MSGPACK_OBJECT_NIL:
@ -309,7 +309,7 @@ int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_obje
} else {
memcpy(aux_buffer, o.via.bin.ptr, aux_buffer_size);
aux_buffer_size = 0;
}
}
ret = snprintf(aux_buffer, aux_buffer_size, "\"");
aux_buffer = aux_buffer + ret;
aux_buffer_size = aux_buffer_size - ret;