From 024d17ffa14e00cce07457805cd7f9a40389d053 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 5 Jun 2019 12:12:07 +0800 Subject: tools/gen-script-for-lang.c: Avoid generating code with empty arrays Empty arrays are one of the C99 features that is not currently supported by any Visual Studio versions. Avoid doing so. --- tools/gen-script-for-lang.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/gen-script-for-lang.c b/tools/gen-script-for-lang.c index 7de3c98d..2f439a4e 100644 --- a/tools/gen-script-for-lang.c +++ b/tools/gen-script-for-lang.c @@ -289,7 +289,13 @@ int main (void) for (j = 0; j < MAX_SCRIPTS; j++) { if (!info->scripts[j].freq) - break; + { + /* Avoid generating code with empty arrays */ + if (j == 0) + g_print ("0"); + + break; + } if (j != 0) g_print (", "); -- cgit v1.2.1 From 6a6976ff13d85aa4317ac2687622f313190e5114 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 6 Jun 2019 15:36:56 +0800 Subject: Re-generate pango-script-lang-table.h This contains the updates that removes the empty arrays from the generated code. --- pango/pango-script-lang-table.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/pango-script-lang-table.h b/pango/pango-script-lang-table.h index d296010e..9f6e0b42 100644 --- a/pango/pango-script-lang-table.h +++ b/pango/pango-script-lang-table.h @@ -1,7 +1,7 @@ /* pango-script-lang-table.h: * * Generated by ../tools/gen-script-for-lang.c - * Date: 2019-05-27 + * Date: 2019-06-06 * Source: fontconfig-2.13.1 * * Do not edit. @@ -236,7 +236,7 @@ static const PangoScriptForLang pango_script_for_lang[] = { { "ug", { G_UNICODE_SCRIPT_ARABIC/*33*/ } }, { "uk", { G_UNICODE_SCRIPT_CYRILLIC/*72*/ } }, { "und-zmth", { G_UNICODE_SCRIPT_LATIN/*53*/, G_UNICODE_SCRIPT_GREEK/*51*/ } }, - { "und-zsye", { } }, + { "und-zsye", { 0 } }, { "ur", { G_UNICODE_SCRIPT_ARABIC/*27*/ } }, { "uz", { G_UNICODE_SCRIPT_LATIN/*52*/ } }, { "ve", { G_UNICODE_SCRIPT_LATIN/*62*/ } }, -- cgit v1.2.1