Do not interleave code and declarations in C files

Avoid C99 style to interleave code and declarations in order to compile msgpackc with Visual Studion < 2013
This commit is contained in:
tbeu
2015-03-26 21:48:03 +01:00
parent 7bee573a72
commit 8921f9dcfc
9 changed files with 514 additions and 478 deletions

View File

@@ -1,13 +1,16 @@
#include <msgpack.h>
#include <assert.h>
void test()
{
size_t size = 10000000;
msgpack_sbuffer buf;
msgpack_packer * pk;
size_t upk_pos = 0;
msgpack_unpacked msg;
msgpack_sbuffer_init(&buf);
msgpack_packer * pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
msgpack_pack_array(pk, size);
{
@@ -17,9 +20,6 @@ void test()
}
msgpack_packer_free(pk);
size_t upk_pos = 0;
msgpack_unpacked msg;
msgpack_unpacked_init(&msg);
while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos)) {