From: Bartosz Golaszewski Date: Wed, 1 Mar 2017 10:22:11 +0000 (+0100) Subject: tests: use function attribute consistently X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a2fb686c1b384150d35120344e21e5e17f840b0c;p=qemu-gpiodev%2Flibgpiod.git tests: use function attribute consistently Move all function attributes to the function definitions and put them before the return type. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/unit/gpiod-unit.c b/tests/unit/gpiod-unit.c index a667725..3fa77aa 100644 --- a/tests/unit/gpiod-unit.c +++ b/tests/unit/gpiod-unit.c @@ -52,7 +52,7 @@ static void vmsg(FILE *stream, const char *hdr, const char *fmt, va_list va) fputc('\n', stream); } -static void GU_PRINTF(1, 2) msg(const char *fmt, ...) +static GU_PRINTF(1, 2) void msg(const char *fmt, ...) { va_list va; @@ -61,7 +61,7 @@ static void GU_PRINTF(1, 2) msg(const char *fmt, ...) va_end(va); } -static void GU_PRINTF(1, 2) err(const char *fmt, ...) +static GU_PRINTF(1, 2) void err(const char *fmt, ...) { va_list va; @@ -70,7 +70,7 @@ static void GU_PRINTF(1, 2) err(const char *fmt, ...) va_end(va); } -static void GU_PRINTF(1, 2) NORETURN die(const char *fmt, ...) +static GU_PRINTF(1, 2) NORETURN void die(const char *fmt, ...) { va_list va; @@ -81,7 +81,7 @@ static void GU_PRINTF(1, 2) NORETURN die(const char *fmt, ...) exit(EXIT_FAILURE); } -static void GU_PRINTF(1, 2) NORETURN die_perr(const char *fmt, ...) +static GU_PRINTF(1, 2) NORETURN void die_perr(const char *fmt, ...) { va_list va; @@ -461,7 +461,7 @@ void _gu_register_test(struct _gu_test *test) globals.num_tests++; } -void _gu_test_failed(const char *fmt, ...) +GU_PRINTF(1, 2) void _gu_test_failed(const char *fmt, ...) { va_list va; diff --git a/tests/unit/gpiod-unit.h b/tests/unit/gpiod-unit.h index 9bae567..bd6fe9f 100644 --- a/tests/unit/gpiod-unit.h +++ b/tests/unit/gpiod-unit.h @@ -39,7 +39,7 @@ struct _gu_test { }; void _gu_register_test(struct _gu_test *test); -void _gu_test_failed(const char *fmt, ...) GU_PRINTF(1, 2); +void _gu_test_failed(const char *fmt, ...); /* * This macro should be used for code brevity instead of manually declaring