From b4cf498144a51d2dd63c3b9fbef52969de807182 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 20 Oct 2023 18:07:55 +0200 Subject: [PATCH] fixed `-Wold-style-declaration` compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example: ``` fontutils/fv1.c:36:1: error: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration] 36 | const static char FV1_SIGNATURE[] = {'F', 'N', 'T', '1'}; | ^~~~~ ``` --- fontutils/fv1.c | 2 +- tests/common/test_parse.c | 4 ++-- tests/common/test_string_calls_unicode.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fontutils/fv1.c b/fontutils/fv1.c index 72826a12..fa001c16 100644 --- a/fontutils/fv1.c +++ b/fontutils/fv1.c @@ -33,7 +33,7 @@ #include "string_calls.h" #include "fv1.h" -const static char FV1_SIGNATURE[] = {'F', 'N', 'T', '1'}; +static const char FV1_SIGNATURE[] = {'F', 'N', 'T', '1'}; /*****************************************************************************/ struct fv1_glyph * diff --git a/tests/common/test_parse.c b/tests/common/test_parse.c index 82f04f3d..7927c17e 100644 --- a/tests/common/test_parse.c +++ b/tests/common/test_parse.c @@ -11,12 +11,12 @@ #define ELEMENTS(x) (sizeof(x) / sizeof(x[0])) -const static char +static const char utf8_simple_test_with_emoji[] = "Simple Test." "\xf0\x9f\x98\xa5"; // U+1F625 Disappointed But Relieved Face -const static char16_t +static const char16_t utf16_simple_test_with_emoji[] = { 'S', 'i', 'm', 'p', 'l', 'e', ' ', 'T', 'e', 's', 't', '.', diff --git a/tests/common/test_string_calls_unicode.c b/tests/common/test_string_calls_unicode.c index e678ba30..83f0c55b 100644 --- a/tests/common/test_string_calls_unicode.c +++ b/tests/common/test_string_calls_unicode.c @@ -34,7 +34,7 @@ struct utf8_encode_sub_test }; // Used as the simple test in UTF-8-test.txt -const static char greek_kosme[] = +static const char greek_kosme[] = "\xce\xba" // GREEK SMALL LETTER KAPPA "\xe1\xbd\xb9" // GREEK SMALL LETTER OMICRON WITH OXIA "\xcf\x83" // GREEK SMALL LETTER SIGMA @@ -42,7 +42,7 @@ const static char greek_kosme[] = "\xce\xb5"; // GREEK SMALL LETTER EPSILON // See Issue #2603 -const static char simple_test_with_emoji[] = +static const char simple_test_with_emoji[] = "Simple Test." "\xf0\x9f\x98\xa5"; // U+1F625 Disappointed But Relieved Face