diff options
author | David Robillard <d@drobilla.net> | 2012-01-16 18:21:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-01-16 18:21:53 +0000 |
commit | 2d724f0e199f74201307cc161031afbd8dba4eb5 (patch) | |
tree | b6db75dbfa6e3d29823d64b9207232e61cfcc070 /tests | |
parent | 80a8bad6790dd510577d0922287b8a3f60d89252 (diff) | |
download | serd-2d724f0e199f74201307cc161031afbd8dba4eb5.tar.gz serd-2d724f0e199f74201307cc161031afbd8dba4eb5.tar.bz2 serd-2d724f0e199f74201307cc161031afbd8dba4eb5.zip |
Support compilation as C++ under MSVC++
git-svn-id: http://svn.drobilla.net/serd/trunk@291 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index b94f7c1f..3c3855dc 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -150,7 +150,7 @@ main() // Test serd_node_new_blob for (size_t size = 0; size < 256; ++size) { - uint8_t* data = malloc(size); + uint8_t* data = (uint8_t*)malloc(size); for (size_t i = 0; i < size; ++i) { data[i] = (uint8_t)(rand() % 256); } @@ -164,7 +164,8 @@ main() } size_t out_size; - uint8_t* out = serd_base64_decode(blob.buf, blob.n_bytes, &out_size); + uint8_t* out = (uint8_t*)serd_base64_decode( + blob.buf, blob.n_bytes, &out_size); if (out_size != size) { fprintf(stderr, "error: Blob size %zu != %zu\n", out_size, size); return 1; @@ -369,18 +370,18 @@ main() // Test SerdReader and SerdWriter - const char* path = tmpnam(NULL); + const char* path = "serd_test.ttl"; FILE* fd = fopen(path, "w"); if (!fd) { fprintf(stderr, "Failed to open file %s\n", path); return 1; } - int* n_statements = malloc(sizeof(int)); + int* n_statements = (int*)malloc(sizeof(int)); *n_statements = 0; SerdWriter* writer = serd_writer_new( - SERD_TURTLE, 0, env, NULL, serd_file_sink, fd); + SERD_TURTLE, (SerdStyle)0, env, NULL, serd_file_sink, fd); if (!writer) { fprintf(stderr, "Failed to create writer\n"); return 1; |