From: Jean-Philippe Bruyère Date: Fri, 28 Aug 2020 14:20:26 +0000 (+0200) Subject: variadic args in nanosvg macro malformed bug X-Git-Tag: v0.2.0~101 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=7d069bf05a8cff42c48f3fa5c6eb1915e9dac944;p=jp%2Fvkvg.git variadic args in nanosvg macro malformed bug --- 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;