From 7d069bf05a8cff42c48f3fa5c6eb1915e9dac944 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 28 Aug 2020 16:20:26 +0200 Subject: [PATCH] variadic args in nanosvg macro malformed bug --- src/nanosvg.h | 2 +- tests/common/test.c | 25 ++++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/nanosvg.h b/src/nanosvg.h index 5579449..fb9df4b 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -217,7 +217,7 @@ void nsvgDelete(NSVGimage* image); #endif #ifndef NANOSVG_DEBUG -#define NANOSVG_DEBUG(x...) +#define NANOSVG_DEBUG(...) //#define NANOSVG_DEBUG printf #endif diff --git a/tests/common/test.c b/tests/common/test.c index e210a2b..9a4b1bf 100644 --- a/tests/common/test.c +++ b/tests/common/test.c @@ -92,17 +92,8 @@ double time_diff(struct timeval x , struct timeval y) return diff; } -void randomize_color (VkvgContext ctx) { - vkvg_set_source_rgba(ctx, - (float)rand()/RAND_MAX, - (float)rand()/RAND_MAX, - (float)rand()/RAND_MAX, - (float)rand()/RAND_MAX - ); -} /* from caskbench */ -double -get_tick (void) +double get_tick (void) { struct timeval now; gettimeofday (&now, NULL); @@ -159,9 +150,6 @@ void init_test (uint32_t width, uint32_t height){ vkh_presenter_build_blit_cmd (r, vkvg_surface_get_vk_image(surf), width, height); } - -// printf ("size:%d iter:%d avgFps: %f avg: %4.2f%% med: %4.2f%% sd: %4.2f%% \n", test_size, i, avg_frames_per_second, avg_run_time, med_run_time, standard_dev); - void clear_test () { vkDeviceWaitIdle(e->dev->dev); @@ -321,6 +309,7 @@ void perform_test (void(*testfunc)(void), const char *testName, int argc, char* vkengine_destroy (e); } + const int star_points[11][2] = { { 0, 85 }, { 75, 75 }, @@ -334,7 +323,14 @@ const int star_points[11][2] = { { 50, 125 }, { 0, 85 } }; - +void randomize_color(VkvgContext ctx) { + vkvg_set_source_rgba(ctx, + (float)rand() / RAND_MAX, + (float)rand() / RAND_MAX, + (float)rand() / RAND_MAX, + (float)rand() / RAND_MAX + ); +} void draw_random_shape (VkvgContext ctx, shape_t shape, float sizeFact) { float w = (float)test_width; float h = (float)test_height; @@ -414,7 +410,6 @@ void draw_random_shape (VkvgContext ctx, shape_t shape, float sizeFact) { break; } } - /*void draw_random_shape (VkvgContext ctx, shape_t shape) { float w = (float)test_width; float h = (float)test_height; -- 2.47.3