From 5983cb6af0b7540ff84a448ecff8747fa70cd2c5 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 16 May 2015 12:19:40 -0400 Subject: [PATCH] [i18n] Adding NUM_SCRIPTS to the end of the scripts enum --- scripts/geodata/i18n/unicode_properties.py | 5 +++-- src/unicode_script_types.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/geodata/i18n/unicode_properties.py b/scripts/geodata/i18n/unicode_properties.py index d3309e81..78d49e7f 100644 --- a/scripts/geodata/i18n/unicode_properties.py +++ b/scripts/geodata/i18n/unicode_properties.py @@ -75,6 +75,7 @@ scripts_header_template = u'''#ifndef UNICODE_SCRIPT_TYPES_H typedef enum {{ {script_enum} + NUM_SCRIPTS }} script_t; #endif @@ -370,8 +371,8 @@ def main(out_dir): # Generate C header and constants - script_enum = u''', - '''.join(['SCRIPT_{} = {}'.format(s.upper(), i) for s, i in sorted(all_scripts.iteritems(), key=itemgetter(1))]) + script_enum = u''' + '''.join(['SCRIPT_{} = {},'.format(s.upper(), i) for s, i in sorted(all_scripts.iteritems(), key=itemgetter(1))]) out_header.write(scripts_header_template.format(num_chars=NUM_CHARS, max_langs=max_langs, diff --git a/src/unicode_script_types.h b/src/unicode_script_types.h index f2eb7bec..90e0078d 100644 --- a/src/unicode_script_types.h +++ b/src/unicode_script_types.h @@ -78,7 +78,8 @@ typedef enum { SCRIPT_JAVANESE = 68, SCRIPT_CHAM = 69, SCRIPT_TAI_VIET = 70, - SCRIPT_MEETEI_MAYEK = 71 + SCRIPT_MEETEI_MAYEK = 71, + NUM_SCRIPTS } script_t; #endif