From 2d724f0e199f74201307cc161031afbd8dba4eb5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Jan 2012 18:21:53 +0000 Subject: Support compilation as C++ under MSVC++ git-svn-id: http://svn.drobilla.net/serd/trunk@291 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- tests/serd_test.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/serd_test.c') 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; -- cgit v1.2.1