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



commit 024d17ffa14e00cce07457805cd7f9a40389d053
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 | 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 (", ");


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