[pango/gen-script-for-lang-avoid-empty-arrays] tools/gen-script-for-lang.c: Avoid generating code with empty arrays



commit a77a776fc9e2c44df0cffa4da25a35da6351ee95
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jun 5 12:12:07 2019 +0800

    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 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/tools/gen-script-for-lang.c b/tools/gen-script-for-lang.c
index 7de3c98d..aa215be5 100644
--- a/tools/gen-script-for-lang.c
+++ b/tools/gen-script-for-lang.c
@@ -289,7 +289,11 @@ int main (void)
       for (j = 0; j < MAX_SCRIPTS; j++)
        {
          if (!info->scripts[j].freq)
-           break;
+           {
+             /* Avoid generating code with empty arrays */
+             g_print ("0");
+             break;
+           }
 
          if (j != 0)
            g_print (", ");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]