From ab0574cea5eb6b0a56fe12c25cb60aeb326ef1bf Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Mon, 23 Feb 2026 23:05:43 +0100 Subject: [PATCH 01/11] feat: add support for mac arm Signed-off-by: Luca Foppiano --- internal/compile.sh | 1 + internal/compile_dynamic.sh | 55 +++++++++++++++++++++++++------------ internal/compile_full.sh | 1 + internal/compile_libs.sh | 52 +++++++++++++++++++++++++++++++++-- 4 files changed, 90 insertions(+), 19 deletions(-) diff --git a/internal/compile.sh b/internal/compile.sh index b78cf31..4e029cf 100755 --- a/internal/compile.sh +++ b/internal/compile.sh @@ -16,6 +16,7 @@ if [ -z "${CFLAGS}" -a -z "${CXXFLAGS}" -a -z "${CPPFLAGS}" ]; then echo "Warning: None of CFLAGS, CXXFLAGS or CPPFLAGS is set; you probably should enable some options." 1>&2 + CXXFLAGS="-w -Wno-c++11-narrowing" fi if [ -n "${CFLAGS}" ]; then echo "CFLAGS=${CFLAGS}" diff --git a/internal/compile_dynamic.sh b/internal/compile_dynamic.sh index 6973163..7353029 100755 --- a/internal/compile_dynamic.sh +++ b/internal/compile_dynamic.sh @@ -16,6 +16,15 @@ if [ -z "${CFLAGS}" -a -z "${CXXFLAGS}" -a -z "${CPPFLAGS}" ]; then echo "Warning: None of CFLAGS, CXXFLAGS or CPPFLAGS is set; you probably should enable some options." 1>&2 + CXXFLAGS="-w -Wno-c++11-narrowing" +fi + +if [ "$(uname)" = "Darwin" ]; then + SONAME_FLAG="" + SOEXT="dylib" +else + SONAME_FLAG="-Wl,-soname," + SOEXT="so" fi if [ -n "${CFLAGS}" ]; then echo "CFLAGS=${CFLAGS}" @@ -29,9 +38,9 @@ fi # The data tool, which can be used to read and write CLD2 dynamic data files g++ $CFLAGS $CPPFLAGS $CXXFLAGS cld2_dynamic_data_tool.cc \ - cld2_dynamic_data.h cld2_dynamic_data.cc \ - cld2_dynamic_data_extractor.h cld2_dynamic_data_extractor.cc \ - cld2_dynamic_data_loader.h cld2_dynamic_data_loader.cc \ + cld2_dynamic_data.cc \ + cld2_dynamic_data_extractor.cc \ + cld2_dynamic_data_loader.cc \ cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ generated_entities.cc generated_language.cc generated_ulscript.cc \ @@ -46,9 +55,9 @@ echo " cld2_dynamic_data_tool compiled" # Tests for Chromium flavored dynamic CLD2 g++ $CFLAGS $CPPFLAGS $CXXFLAGS -D CLD2_DYNAMIC_MODE compact_lang_det_test.cc \ - cld2_dynamic_data.h cld2_dynamic_data.cc \ - cld2_dynamic_data_extractor.h cld2_dynamic_data_extractor.cc \ - cld2_dynamic_data_loader.h cld2_dynamic_data_loader.cc \ + cld2_dynamic_data.cc \ + cld2_dynamic_data_extractor.cc \ + cld2_dynamic_data_loader.cc \ cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ generated_entities.cc generated_language.cc generated_ulscript.cc \ @@ -60,8 +69,8 @@ echo " compact_lang_det_dynamic_test_chrome compiled" # Unit tests, in dynamic mode g++ $CFLAGS $CPPFLAGS $CXXFLAGS -g3 -D CLD2_DYNAMIC_MODE cld2_unittest.cc \ - cld2_dynamic_data.h cld2_dynamic_data.cc \ - cld2_dynamic_data_loader.h cld2_dynamic_data_loader.cc \ + cld2_dynamic_data.cc \ + cld2_dynamic_data_loader.cc \ cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ generated_entities.cc generated_language.cc generated_ulscript.cc \ @@ -71,14 +80,26 @@ g++ $CFLAGS $CPPFLAGS $CXXFLAGS -g3 -D CLD2_DYNAMIC_MODE cld2_unittest.cc \ echo " cld2_dynamic_unittest compiled" # Shared library, in dynamic mode -g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC -D CLD2_DYNAMIC_MODE \ - cld2_dynamic_data.h cld2_dynamic_data.cc \ - cld2_dynamic_data_loader.h cld2_dynamic_data_loader.cc \ - cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ - compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ - generated_entities.cc generated_language.cc generated_ulscript.cc \ - getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \ - tote.cc utf8statetable.cc \ - -o libcld2_dynamic.so -Wl,-soname=libcld2_dynamic.so $LDFLAGS +if [ -n "${SONAME_FLAG}" ]; then + g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC -D CLD2_DYNAMIC_MODE \ + cld2_dynamic_data.cc \ + cld2_dynamic_data_loader.cc \ + cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ + compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ + generated_entities.cc generated_language.cc generated_ulscript.cc \ + getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \ + tote.cc utf8statetable.cc \ + -o libcld2_dynamic.${SOEXT} ${SONAME_FLAG}libcld2_dynamic.${SOEXT} $LDFLAGS +else + g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC -D CLD2_DYNAMIC_MODE \ + cld2_dynamic_data.cc \ + cld2_dynamic_data_loader.cc \ + cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ + compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ + generated_entities.cc generated_language.cc generated_ulscript.cc \ + getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \ + tote.cc utf8statetable.cc \ + -o libcld2_dynamic.${SOEXT} $LDFLAGS +fi echo " libcld2_dynamic.so compiled" diff --git a/internal/compile_full.sh b/internal/compile_full.sh index 4736506..ad69f61 100755 --- a/internal/compile_full.sh +++ b/internal/compile_full.sh @@ -16,6 +16,7 @@ if [ -z "${CFLAGS}" -a -z "${CXXFLAGS}" -a -z "${CPPFLAGS}" ]; then echo "Warning: None of CFLAGS, CXXFLAGS or CPPFLAGS is set; you probably should enable some options." 1>&2 + CXXFLAGS="-w -Wno-c++11-narrowing" fi if [ -n "${CFLAGS}" ]; then echo "CFLAGS=${CFLAGS}" diff --git a/internal/compile_libs.sh b/internal/compile_libs.sh index 38c6655..22b72bc 100755 --- a/internal/compile_libs.sh +++ b/internal/compile_libs.sh @@ -16,6 +16,15 @@ if [ -z "${CFLAGS}" -a -z "${CXXFLAGS}" -a -z "${CPPFLAGS}" ]; then echo "Warning: None of CFLAGS, CXXFLAGS or CPPFLAGS is set; you probably should enable some options." 1>&2 + CXXFLAGS="-w -Wno-c++11-narrowing" +fi + +if [ "$(uname)" = "Darwin" ]; then + SONAME_FLAG="" + SOEXT="dylib" +else + SONAME_FLAG="-Wl,-soname," + SOEXT="so" fi if [ -n "${CFLAGS}" ]; then echo "CFLAGS=${CFLAGS}" @@ -37,8 +46,46 @@ g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC \ cld_generated_cjk_delta_bi_4.cc generated_distinct_bi_0.cc \ cld2_generated_quadchrome_2.cc cld2_generated_deltaoctachrome.cc \ cld2_generated_distinctoctachrome.cc cld_generated_score_quad_octa_2.cc \ - -o libcld2.so $LDFLAGS -Wl,-soname=libcld2.so + -o libcld2.${SOEXT} $LDFLAGS +if [ -n "${SONAME_FLAG}" ]; then + g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC \ + cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ + compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ + generated_entities.cc generated_language.cc generated_ulscript.cc \ + getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \ + tote.cc utf8statetable.cc \ + cld_generated_cjk_uni_prop_80.cc cld2_generated_cjk_compatible.cc \ + cld_generated_cjk_delta_bi_4.cc generated_distinct_bi_0.cc \ + cld2_generated_quadchrome_2.cc cld2_generated_deltaoctachrome.cc \ + cld2_generated_distinctoctachrome.cc cld_generated_score_quad_octa_2.cc \ + -o libcld2.${SOEXT} $LDFLAGS ${SONAME_FLAG}libcld2.${SOEXT} +else + g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC \ + cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ + compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ + generated_entities.cc generated_language.cc generated_ulscript.cc \ + getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \ + tote.cc utf8statetable.cc \ + cld_generated_cjk_uni_prop_80.cc cld2_generated_cjk_compatible.cc \ + cld_generated_cjk_delta_bi_4.cc generated_distinct_bi_0.cc \ + cld2_generated_quadchrome_2.cc cld2_generated_deltaoctachrome.cc \ + cld2_generated_distinctoctachrome.cc cld_generated_score_quad_octa_2.cc \ + -o libcld2.${SOEXT} $LDFLAGS +fi +if [ -n "${SONAME_FLAG}" ]; then +g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC \ + cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ + compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ + generated_entities.cc generated_language.cc generated_ulscript.cc \ + getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc \ + tote.cc utf8statetable.cc \ + cld_generated_cjk_uni_prop_80.cc cld2_generated_cjk_compatible.cc \ + cld_generated_cjk_delta_bi_32.cc generated_distinct_bi_0.cc \ + cld2_generated_quad0122.cc cld2_generated_deltaocta0122.cc \ + cld2_generated_distinctocta0122.cc cld_generated_score_quad_octa_0122.cc \ + -o libcld2_full.${SOEXT} $LDFLAGS ${SONAME_FLAG}libcld2_full.${SOEXT} +else g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC \ cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc \ compact_lang_det_impl.cc debug.cc fixunicodevalue.cc \ @@ -49,5 +96,6 @@ g++ $CFLAGS $CPPFLAGS $CXXFLAGS -shared -fPIC \ cld_generated_cjk_delta_bi_32.cc generated_distinct_bi_0.cc \ cld2_generated_quad0122.cc cld2_generated_deltaocta0122.cc \ cld2_generated_distinctocta0122.cc cld_generated_score_quad_octa_0122.cc \ - -o libcld2_full.so $LDFLAGS -Wl,-soname=libcld2_full.so + -o libcld2_full.${SOEXT} $LDFLAGS +fi From 7efd79f1179e78f891b8a7fb7690230faf501e5d Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Tue, 24 Feb 2026 07:04:46 +0100 Subject: [PATCH 02/11] feat: add ci support --- .github/workflows/build-cld2.yml | 83 ++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/build-cld2.yml diff --git a/.github/workflows/build-cld2.yml b/.github/workflows/build-cld2.yml new file mode 100644 index 0000000..e5e6f69 --- /dev/null +++ b/.github/workflows/build-cld2.yml @@ -0,0 +1,83 @@ +name: Build CLD2 Native Libraries + +on: + push: + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-14] + include: + - os: ubuntu-latest + os_name: linux + arch: x64 + artifact_suffix: linux-x64 + - os: ubuntu-24.04-arm + os_name: linux + arch: arm64 + artifact_suffix: linux-arm64 + - os: macos-latest + os_name: mac + arch: x64 + artifact_suffix: mac-x64 + - os: macos-14 + os_name: mac + arch: arm64 + artifact_suffix: mac-arm64 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout this project + uses: actions/checkout@v4 + + - name: Build libcld2 + working-directory: internal + run: | + chmod +x compile_libs.sh + ./compile_libs.sh + + - name: Create output directory + run: | + mkdir -p output/${{ matrix.artifact_suffix }} + + - name: Copy library to output + run: | + cp internal/libcld2.${{ matrix.os_name == 'mac' && 'dylib' || 'so' }} output/${{ matrix.artifact_suffix }}/ + + - name: Save artifact + uses: actions/upload-artifact@v4 + with: + name: cld2-bin-${{ matrix.artifact_suffix }} + path: output + + assemble: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: output + pattern: cld2-bin-* + merge-multiple: true + + - name: Display structure + run: ls -R + + - name: Get short commit ID + id: extract_rev_id + run: | + SHORT_COMMIT_ID=$(echo "${{ github.sha }}" | cut -c1-7) + echo "short_commit_id=${SHORT_COMMIT_ID}" >> $GITHUB_OUTPUT + + - name: Save consolidated artifact + uses: actions/upload-artifact@v4 + with: + name: cld2-bin-all-${{ steps.extract_rev_id.outputs.short_commit_id }} + path: output From c50d96afe41ff664fcd7beae890b93204f01104f Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Wed, 25 Feb 2026 09:15:32 +0100 Subject: [PATCH 03/11] feat: include the 160 languages library --- .github/workflows/build-cld2.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-cld2.yml b/.github/workflows/build-cld2.yml index e5e6f69..d5f5fda 100644 --- a/.github/workflows/build-cld2.yml +++ b/.github/workflows/build-cld2.yml @@ -12,7 +12,7 @@ jobs: - os: ubuntu-latest os_name: linux arch: x64 - artifact_suffix: linux-x64 + artifact_suffix: linux-x86_64 - os: ubuntu-24.04-arm os_name: linux arch: arm64 @@ -20,8 +20,8 @@ jobs: - os: macos-latest os_name: mac arch: x64 - artifact_suffix: mac-x64 - - os: macos-14 + artifact_suffix: mac-x86_64 + - os: macos-15-intel os_name: mac arch: arm64 artifact_suffix: mac-arm64 @@ -44,7 +44,8 @@ jobs: - name: Copy library to output run: | - cp internal/libcld2.${{ matrix.os_name == 'mac' && 'dylib' || 'so' }} output/${{ matrix.artifact_suffix }}/ + cp internal/libcld2.${{ matrix.os_name == 'mac' && 'dylib' || 'so' }} output/${{ matrix.artifact_suffix }}/ + cp internal/libcld2_full.${{ matrix.os_name == 'mac' && 'dylib' || 'so' }} output/${{ matrix.artifact_suffix }}/ - name: Save artifact uses: actions/upload-artifact@v4 From a29f33c01c4eaf18ab168856bc7fa16b049f9aeb Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Wed, 25 Feb 2026 09:36:01 +0100 Subject: [PATCH 04/11] fix: uniform naming conventions --- .github/workflows/build-cld2.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-cld2.yml b/.github/workflows/build-cld2.yml index d5f5fda..3f87986 100644 --- a/.github/workflows/build-cld2.yml +++ b/.github/workflows/build-cld2.yml @@ -7,24 +7,23 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-14] include: - - os: ubuntu-latest + - os: ubuntu-24.04 os_name: linux - arch: x64 - artifact_suffix: linux-x86_64 - - os: ubuntu-24.04-arm + arch: x86-64 + artifact_suffix: linux-x86-64 + - os: ubuntu-24.04-aarch64 os_name: linux - arch: arm64 - artifact_suffix: linux-arm64 - - os: macos-latest - os_name: mac - arch: x64 - artifact_suffix: mac-x86_64 + arch: aarch64 + artifact_suffix: linux-aarch64 - os: macos-15-intel os_name: mac - arch: arm64 - artifact_suffix: mac-arm64 + arch: x86-64 + artifact_suffix: mac-x86-64 + - os: macos-latest + os_name: mac + arch: aarch64 + artifact_suffix: mac-aarch64 runs-on: ${{ matrix.os }} From 8305b57733fc59921c06d7aa4cfa359f3b8b457a Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Wed, 25 Feb 2026 09:37:12 +0100 Subject: [PATCH 05/11] fix: fix ubuntu arm runner name --- .github/workflows/build-cld2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cld2.yml b/.github/workflows/build-cld2.yml index 3f87986..44455c8 100644 --- a/.github/workflows/build-cld2.yml +++ b/.github/workflows/build-cld2.yml @@ -11,8 +11,8 @@ jobs: - os: ubuntu-24.04 os_name: linux arch: x86-64 - artifact_suffix: linux-x86-64 - - os: ubuntu-24.04-aarch64 + artifact_suffix: linux-x86-arm + - os: ubuntu-24.04-arm64 os_name: linux arch: aarch64 artifact_suffix: linux-aarch64 From 3e84c6fbc6f9f9c4b94664c64e2afde5bf240522 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Wed, 25 Feb 2026 09:37:53 +0100 Subject: [PATCH 06/11] fix: fix ubuntu arm runner name --- .github/workflows/build-cld2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cld2.yml b/.github/workflows/build-cld2.yml index 44455c8..700e54a 100644 --- a/.github/workflows/build-cld2.yml +++ b/.github/workflows/build-cld2.yml @@ -11,8 +11,8 @@ jobs: - os: ubuntu-24.04 os_name: linux arch: x86-64 - artifact_suffix: linux-x86-arm - - os: ubuntu-24.04-arm64 + artifact_suffix: linux-x86-64 + - os: ubuntu-24.04-arm os_name: linux arch: aarch64 artifact_suffix: linux-aarch64 From f095fc13c304543702257c6dfb9d24f8b5c06e89 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Wed, 25 Feb 2026 09:41:44 +0100 Subject: [PATCH 07/11] fix: mac artifact suffix --- .github/workflows/build-cld2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cld2.yml b/.github/workflows/build-cld2.yml index 700e54a..67c7f45 100644 --- a/.github/workflows/build-cld2.yml +++ b/.github/workflows/build-cld2.yml @@ -19,11 +19,11 @@ jobs: - os: macos-15-intel os_name: mac arch: x86-64 - artifact_suffix: mac-x86-64 + artifact_suffix: darwin-x86-64 - os: macos-latest os_name: mac arch: aarch64 - artifact_suffix: mac-aarch64 + artifact_suffix: darwin-aarch64 runs-on: ${{ matrix.os }} From 53061addbe830c7c0b07dc63acea67e9ced4425e Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Thu, 26 Feb 2026 12:26:27 +0100 Subject: [PATCH 08/11] patch: applied patch from ubuntu which wraps negative integer literals with static_cast(...) --- internal/cld_generated_cjk_uni_prop_80.cc | 110 +++++++++++----------- internal/scoreonescriptspan.cc | 4 +- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/internal/cld_generated_cjk_uni_prop_80.cc b/internal/cld_generated_cjk_uni_prop_80.cc index 06ad806..af6f9ed 100644 --- a/internal/cld_generated_cjk_uni_prop_80.cc +++ b/internal/cld_generated_cjk_uni_prop_80.cc @@ -165,8 +165,8 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, // state[16 + 2] 0x000000 Byte 2 of 3 (relative offsets) X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, --14,-14,-14,-14,-14,-14,-14,-14, -14,-14,-14,-14,-14,-14,-14,-14, --14,-14,-14,-14,-14,-14,-14,-14, -14,-14,-14,-14,-14,-14,-14,-14, +static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14), static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14), +static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14), static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14),static_cast(-14), // state[17 + 2] 0x0031c0 Byte 3 of 3 (property) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -259,10 +259,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 229,229,229, 3,208, 0,229, 5, 233, 0,229,229,229,208,229,229, // state[32 + 2] 0x002000 Byte 2 of 3 (relative offsets) --30,-30,-30,-30,-30,-30,-30,-30, -30,-30,-30,-30,-30,-30,-30,-30, --30,-30,-30,-30,-30,-30,-30,-30, -30,-30,-30,-30,-30,-30,-30,-30, --30,-30,-30,-30,-30,-30,-30,-30, -30,-30,-30,-30,-30,-30,-30,-30, --30,-30,-30,-30,-30,-30,-30,-30, -30,-30,-30,-30,-30,-30,-30,-30, +static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), +static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), +static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), +static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30),static_cast(-30), // state[33 + 2] 0x003780 Byte 3 of 3 (property) 229,208,229,229,208,229,229,229, 208,208,208,208,208, 4, 6,208, @@ -355,10 +355,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 228,229,229,229,229,233,233, 6, 208,229, 3,229,233, 6, 6, 0, // state[48 + 2] 0x001000 Byte 2 of 3 (relative offsets) --46,-46,-46,-46,-42,-41,-40,-39, -46,-46,-46,-46,-46,-46,-46,-46, --46,-46,-46,-46,-46,-46,-46,-46, -46,-46,-46,-46,-46,-46,-46,-46, --46,-46,-46,-46,-46,-46,-46,-46, -46,-46,-46,-46,-46,-46,-46,-46, --46,-46,-46,-46,-46,-46,-46,-46, -46,-46,-46,-46,-46,-46,-46,-46, +static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-42),static_cast(-41),static_cast(-40),static_cast(-39), static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), +static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), +static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), +static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46),static_cast(-46), // state[49 + 2] 0x003b40 Byte 3 of 3 (property) 6,227,208,233,208, 3, 3,208, 208,229, 0,229,233,219, 0, 6, @@ -451,10 +451,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 229,208,208,208,217,208,229,229, 229,229,208,217,208,229,229,229, // state[64 + 2] 0x003000 Byte 2 of 3 (relative offsets) --54,-53,-52,-51,-50,-58,-49,-47, -62,-62,-62,-62,-62,-62,-62,-62, --46,-45,-44,-43,-42,-41,-40,-39, -38,-37,-36,-35,-34,-33,-31,-30, --29,-28,-27,-26,-25,-24,-23,-22, -21,-20,-19,-18,-17,-15,-14,-13, --12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, +static_cast(-54),static_cast(-53),static_cast(-52),static_cast(-51),static_cast(-50),static_cast(-58),static_cast(-49),static_cast(-47), static_cast(-62),static_cast(-62),static_cast(-62),static_cast(-62),static_cast(-62),static_cast(-62),static_cast(-62),static_cast(-62), +static_cast(-46),static_cast(-45),static_cast(-44),static_cast(-43),static_cast(-42),static_cast(-41),static_cast(-40),static_cast(-39), static_cast(-38),static_cast(-37),static_cast(-36),static_cast(-35),static_cast(-34),static_cast(-33),static_cast(-31),static_cast(-30), +static_cast(-29),static_cast(-28),static_cast(-27),static_cast(-26),static_cast(-25),static_cast(-24),static_cast(-23),static_cast(-22), static_cast(-21),static_cast(-20),static_cast(-19),static_cast(-18),static_cast(-17),static_cast(-15),static_cast(-14),static_cast(-13), +static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, // state[65 + 2] 0x003f00 Byte 3 of 3 (property) 217,217,208, 3,208,217,208,208, 6,229,208,228,229,229,208,229, @@ -547,10 +547,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 229,208,229,229,208,229,233, 0, 208,208,229,208,227,229,229,229, // state[80 + 2] 0x004000 Byte 2 of 3 (relative offsets) --11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, +static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44,-78, 45, 46, 47, 48, 49, 50, 51, 52, + 38, 39, 40, 41, 42, 43, 44,static_cast(-78), 45, 46, 47, 48, 49, 50, 51, 52, // state[81 + 2] 0x0042c0 Byte 3 of 3 (property) 229, 0,229,229,229, 3, 4, 4, 229,229,229,229,208,229, 0,208, @@ -931,7 +931,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 0,142, 98, 28,117,206,212,212, 220, 15, 0,231,199,231,111, 28, // state[144 + 2] 0x005000 Byte 2 of 3 (relative offsets) --11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, +static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, @@ -1315,7 +1315,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 16, 15,211,118, 0,231, 68,231, 0, 99,161, 0,115,221,144,140, // state[208 + 2] 0x006000 Byte 2 of 3 (relative offsets) --10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, +static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, @@ -1699,7 +1699,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 119, 16, 51, 0, 0, 68,136, 72, 144,118, 87,201,191,136, 78,233, // state[272 + 2] 0x007000 Byte 2 of 3 (relative offsets) - -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, + static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -2083,7 +2083,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 212,212, 0,126,140,220,220, 0, 0, 0,127,118,106, 0,199, 0, // state[336 + 2] 0x008000 Byte 2 of 3 (relative offsets) - -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, + static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, @@ -2467,7 +2467,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 0,122, 0,231,100,232, 0, 0, 117, 0,206,231, 0, 0,231, 0, // state[400 + 2] 0x009000 Byte 2 of 3 (relative offsets) - -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, + static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, @@ -2851,10 +2851,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // state[464 + 2] 0x00a000 Byte 2 of 3 (relative offsets) - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, - -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, + static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), + static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), + static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), static_cast(-6), + static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), static_cast(-5), // state[465 + 2] 0x000080 Byte 2 of 2 (property) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2947,10 +2947,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 208,208,208,208, 5, 6,208, 2, 0, 6, 6, 5,208,208,208, 6, // state[480 + 2] 0x00b000 Byte 2 of 3 (relative offsets) --20,-20,-20,-20,-20,-20,-20,-20, -20,-20,-20,-20,-20,-20,-20,-20, --20,-20,-20,-20,-20,-20,-20,-20, -20,-20,-20,-20,-20,-20,-20,-20, --20,-20,-20,-20,-20,-20,-20,-20, -20,-20,-20,-20,-20,-20,-20,-20, --20,-20,-20,-20,-20,-20,-20,-20, -20,-20,-20,-20,-20,-20,-20,-20, +static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), +static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), +static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), +static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20),static_cast(-20), // state[481 + 2] 0x020100 Byte 4 of 4 (property) 2, 6, 5, 6, 5,229, 5,208, 208,208,208,208,208,208,208,229, @@ -3043,10 +3043,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 208,208, 5, 5, 5,208,208, 2, 229, 5, 5, 5, 5, 5, 6,208, // state[496 + 2] 0x00d000 Byte 2 of 3 (relative offsets) --35,-35,-35,-35,-35,-35,-35,-35, -35,-35,-35,-35,-35,-35,-35,-35, --35,-35,-35,-35,-35,-35,-35,-35, -35,-35,-35,-35,-35,-35,-34,-33, --33,-33,-33,-33,-33,-33,-33,-33, -33,-33,-33,-33,-33,-33,-33,-33, --33,-33,-33,-33,-33,-33,-33,-33, -33,-33,-33,-33,-33,-33,-33,-33, +static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35), static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35), +static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35), static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-35),static_cast(-34),static_cast(-33), +static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33), static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33), +static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33), static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33),static_cast(-33), // state[497 + 2] 0x0204c0 Byte 4 of 4 (property) 2, 2, 5, 5, 5, 2,208, 2, 5, 5, 6,208,208, 5, 5, 5, @@ -3139,10 +3139,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 208,208, 5, 5, 5, 5, 6, 6, 208,208, 2,208,208,208,208,208, // state[512 + 2] 0x00f000 Byte 2 of 3 (relative offsets) --47,-47,-47,-47,-47,-47,-47,-47, -47,-47,-47,-47,-47,-47,-47,-47, --47,-47,-47,-47,-47,-47,-47,-47, -47,-47,-47,-47,-47,-47,-47,-47, --47,-47,-47,-47,-46,-45,-44,-43, -42,-41,-44,-40,-47,-47,-47,-47, --47,-47,-47,-47,-47,-47,-47,-47, -47,-47,-47,-47,-47,-39,-38,-37, +static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47), static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47), +static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47), static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47), +static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-46),static_cast(-45),static_cast(-44),static_cast(-43), static_cast(-42),static_cast(-41),static_cast(-44),static_cast(-40),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47), +static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47), static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-47),static_cast(-39),static_cast(-38),static_cast(-37), // state[513 + 2] 0x020880 Byte 4 of 4 (property) 5, 5, 5, 6,208,208,208,208, 208,208, 5, 5, 6, 6,208,208, @@ -3235,10 +3235,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 5, 6,208,218,208,208,208,218, 208, 6,227,229, 6, 6, 6,208, // state[528 + 2] 0x020000 Byte 3 of 4 (relative offsets) --52,-51,-50,-49,-47,-46,-45,-44, -43,-42,-41,-40,-39,-38,-37,-36, --35,-34,-33,-31,-30,-29,-28,-27, -26,-25,-24,-23,-22,-21,-20,-19, --18,-17,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, - -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, +static_cast(-52),static_cast(-51),static_cast(-50),static_cast(-49),static_cast(-47),static_cast(-46),static_cast(-45),static_cast(-44), static_cast(-43),static_cast(-42),static_cast(-41),static_cast(-40),static_cast(-39),static_cast(-38),static_cast(-37),static_cast(-36), +static_cast(-35),static_cast(-34),static_cast(-33),static_cast(-31),static_cast(-30),static_cast(-29),static_cast(-28),static_cast(-27), static_cast(-26),static_cast(-25),static_cast(-24),static_cast(-23),static_cast(-22),static_cast(-21),static_cast(-20),static_cast(-19), +static_cast(-18),static_cast(-17),static_cast(-15),static_cast(-14),static_cast(-13),static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), + static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // state[529 + 2] 0x020c40 Byte 4 of 4 (property) 227, 5, 5, 5, 2, 2, 2, 2, 213, 2, 2, 2, 2, 2,208, 6, @@ -3427,7 +3427,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 208,208,208,208,208,208,208,208, 208, 6, 6, 6, 6, 2, 5, 5, // state[560 + 2] 0x021000 Byte 3 of 4 (relative offsets) --16,-15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, +static_cast(-16),static_cast(-15),static_cast(-14),static_cast(-13),static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, @@ -3811,7 +3811,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 5, 5, 5, 6, 6, 6, 5,208, 208,229,208,208, 5, 5, 5, 5, // state[624 + 2] 0x022000 Byte 3 of 4 (relative offsets) --15,-14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, +static_cast(-15),static_cast(-14),static_cast(-13),static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, @@ -4195,7 +4195,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 6, 6, 4, 5,208,208,208,208, 208,208,229, 6, 5, 6, 6, 6, // state[688 + 2] 0x023000 Byte 3 of 4 (relative offsets) --14,-13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, +static_cast(-14),static_cast(-13),static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, @@ -4579,7 +4579,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 5, 5, 5, 5, 5, 5, 5, 6, 208,208,208,208,208,208, 6, 6, // state[752 + 2] 0x024000 Byte 3 of 4 (relative offsets) --13,-12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, +static_cast(-13),static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, @@ -4963,7 +4963,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 229, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 6,229, // state[816 + 2] 0x025000 Byte 3 of 4 (relative offsets) --12,-11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, +static_cast(-12),static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, @@ -5347,7 +5347,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 6, 6, 6, 5, 5, 5, 5, 6, 6, 6, 3, 6,229,208,208,229, // state[880 + 2] 0x026000 Byte 3 of 4 (relative offsets) --11,-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, +static_cast(-11),static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, @@ -5731,7 +5731,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 208, 6, 6,208,208,208,208,208, 6, 6, 6,216, 5, 5, 5, 5, // state[944 + 2] 0x027000 Byte 3 of 4 (relative offsets) --10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, +static_cast(-10), static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, @@ -6115,7 +6115,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 5, 5, 5, 6,208,208, 6, 6, 208,229,208,208,208, 5, 5, 5, // state[1008 + 2] 0x028000 Byte 3 of 4 (relative offsets) - -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, + static_cast(-9), static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, @@ -6499,7 +6499,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 208,208, 5, 5, 6,208,208, 5, 208,208,208, 6,208, 6,208,208, // state[1072 + 2] 0x029000 Byte 3 of 4 (relative offsets) - -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, + static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, @@ -6883,7 +6883,7 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 229,229,229,229,208,208,208,229, 208,208,208,229, 0,229,208,208, // state[1136 + 2] 0x02a000 Byte 3 of 4 (relative offsets) - -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, + static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, @@ -7075,10 +7075,10 @@ X__,X__,X__,X__,X__,X__,X__,X__, X__,X__,X__,X__,X__,X__,X__,X__, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // state[1168 + 2] 0x02f000 Byte 3 of 4 (relative offsets) - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -8, -7, -6, -5, -4, -3, -2, -1, 1, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, + static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), + static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), + static_cast(-8), static_cast(-7), static_cast(-6), static_cast(-5), static_cast(-4), static_cast(-3), static_cast(-2), static_cast(-1), 1, static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), + static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), static_cast(-9), // state[1169 + 2] 0x02fa00 Byte 4 of 4 (property) 217, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,217, 5, 5, diff --git a/internal/scoreonescriptspan.cc b/internal/scoreonescriptspan.cc index 11ccaea..8313ecc 100644 --- a/internal/scoreonescriptspan.cc +++ b/internal/scoreonescriptspan.cc @@ -1144,8 +1144,8 @@ void ScoreEntireScriptSpan(const LangSpan& scriptspan, if (scoringcontext->flags_cld2_html) { ChunkSummary chunksummary = { 1, 0, - one_one_lang, UNKNOWN_LANGUAGE, score, 1, - bytes, 0, scriptspan.ulscript, reliability, reliability + static_cast(one_one_lang), UNKNOWN_LANGUAGE, static_cast(score), 1, + static_cast(bytes), 0, static_cast(scriptspan.ulscript), static_cast(reliability), static_cast(reliability) }; CLD2_Debug(scriptspan.text, 1, scriptspan.text_bytes, false, false, NULL, From 08fb6a882462c9e3e88e840302922f608a68406a Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Thu, 26 Feb 2026 12:31:47 +0100 Subject: [PATCH 09/11] patch: applied patch from ubuntu add CMake and reduce the size of the libcld2_full using a dynamic dependency with libcld2 --- CMakeLists.txt | 155 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..58db864 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,155 @@ +cmake_minimum_required(VERSION 3.10) +project (cld2) +enable_language(CXX) + +set (VERSION "0.0.197") +set (common_SOURCE_FILES + internal/cldutil.cc + internal/cldutil_shared.cc + internal/compact_lang_det.cc + internal/compact_lang_det_hint_code.cc + internal/compact_lang_det_impl.cc + internal/debug.cc + internal/fixunicodevalue.cc + internal/generated_entities.cc + internal/generated_language.cc + internal/generated_ulscript.cc + internal/getonescriptspan.cc + internal/lang_script.cc + internal/offsetmap.cc + internal/scoreonescriptspan.cc + internal/tote.cc + internal/utf8statetable.cc + ) + +set (cld2_SOURCE_FILES + internal/generated_distinct_bi_0.cc + internal/cld_generated_cjk_uni_prop_80.cc + internal/cld2_generated_cjk_compatible.cc + internal/cld_generated_cjk_delta_bi_4.cc + internal/cld2_generated_quadchrome_2.cc + internal/cld2_generated_deltaoctachrome.cc + internal/cld2_generated_distinctoctachrome.cc + internal/cld_generated_score_quad_octa_2.cc + ) + +set (cld2_full_SOURCE_FILES + internal/generated_distinct_bi_0.cc + internal/cld_generated_cjk_uni_prop_80.cc + internal/cld2_generated_cjk_compatible.cc + internal/cld_generated_cjk_delta_bi_32.cc + internal/cld2_generated_quad0122.cc + internal/cld2_generated_deltaocta0122.cc + internal/cld2_generated_distinctocta0122.cc + internal/cld_generated_score_quad_octa_0122.cc + ) + +set (cld2_dynamic_SOURCE_FILES + internal/cld2_dynamic_data.cc + internal/cld2_dynamic_data_loader.cc + ) + +add_library(cld2 SHARED ${common_SOURCE_FILES} ${cld2_SOURCE_FILES}) +set_target_properties(cld2 PROPERTIES + ENABLE_EXPORTS On + OUTPUT_NAME cld2 + VERSION ${VERSION} + SOVERSION 0 + ) +add_library(cld2_full SHARED ${cld2_full_SOURCE_FILES}) +set_target_properties(cld2_full PROPERTIES + ENABLE_EXPORTS On + OUTPUT_NAME cld2_full + VERSION ${VERSION} + SOVERSION 0 + ) + +add_library(cld2_dynamic SHARED ${cld2_dynamic_SOURCE_FILES}) +set_target_properties(cld2_dynamic PROPERTIES + ENABLE_EXPORTS On + OUTPUT_NAME cld2_dynamic + VERSION ${VERSION} + SOVERSION 0 + COMPILE_FLAGS "-DCLD2_DYNAMIC_MODE" + ) +install(TARGETS cld2 DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}) +install(TARGETS cld2_full DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}) +install(TARGETS cld2_dynamic DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}) + +set (cld2_internal_HEADERS + internal/cld2_dynamic_compat.h + internal/cld2_dynamic_data_extractor.h + internal/cld2_dynamic_data.h + internal/cld2_dynamic_data_loader.h + internal/cld2tablesummary.h + internal/cldutil.h + internal/cldutil_offline.h + internal/cldutil_shared.h + internal/compact_lang_det_hint_code.h + internal/compact_lang_det_impl.h + internal/debug.h + internal/fixunicodevalue.h + internal/generated_language.h + internal/generated_ulscript.h + internal/getonescriptspan.h + internal/integral_types.h + internal/lang_script.h + internal/langspan.h + internal/offsetmap.h + internal/port.h + internal/scoreonescriptspan.h + internal/stringpiece.h + internal/tote.h + internal/unittest_data.h + internal/utf8acceptinterchange.h + internal/utf8prop_lettermarkscriptnum.h + internal/utf8repl_lettermarklower.h + internal/utf8scannot_lettermarkspecial.h + internal/utf8statetable.h + ) + +install(FILES ${cld2_internal_HEADERS} DESTINATION include/cld2/internal) +set (cld2_public_HEADERS + public/compact_lang_det.h + public/encodings.h + ) +install(FILES ${cld2_public_HEADERS} DESTINATION include/cld2/public) + +set (full_SOURCE_FILES + internal/cld_generated_cjk_uni_prop_80.cc + internal/cld2_generated_cjk_compatible.cc + internal/cld_generated_cjk_delta_bi_32.cc + internal/generated_distinct_bi_0.cc + internal/cld2_generated_quad0122.cc + internal/cld2_generated_deltaocta0122.cc + internal/cld2_generated_distinctocta0122.cc + internal/cld_generated_score_quad_octa_0122.cc + ) + +add_executable(compact_lang_det_test_full ${full_SOURCE_FILES} internal/compact_lang_det_test.cc) +add_executable(cld2_unittest_full ${full_SOURCE_FILES} internal/cld2_unittest_full.cc) +add_executable(cld2_unittest_full_avoid ${full_SOURCE_FILES} internal/cld2_unittest_full.cc) +set_target_properties(cld2_unittest_full_avoid PROPERTIES COMPILE_FLAGS "-Davoid_utf8_string_constants") + +add_executable(cld2_dynamic_data_tool internal/cld2_dynamic_data_extractor.cc internal/cld2_dynamic_data_tool.cc) +add_executable(compact_lang_det_dynamic_test_chrome ${common_SOURCE_FILES} internal/cld2_dynamic_data_extractor.cc internal/compact_lang_det_test.cc) +add_executable(cld2_dynamic_unittest ${common_SOURCE_FILES} internal/cld2_unittest.cc) +set_target_properties(compact_lang_det_dynamic_test_chrome PROPERTIES COMPILE_FLAGS "-DCLD2_DYNAMIC_MODE") +set_target_properties(cld2_dynamic_unittest PROPERTIES COMPILE_FLAGS "-DCLD2_DYNAMIC_MODE") + +add_executable(compact_lang_det_test_chrome_2 internal/compact_lang_det_test.cc) +add_executable(compact_lang_det_test_chrome_16 internal/compact_lang_det_test.cc) +add_executable(cld2_unittest_chrome_2 internal/cld2_unittest.cc) +add_executable(cld2_unittest_avoid_chrome_2 internal/cld2_unittest.cc) +set_target_properties(cld2_unittest_avoid_chrome_2 PROPERTIES COMPILE_FLAGS "-Davoid_utf8_string_constants") + +target_link_libraries(compact_lang_det_test_full cld2) +target_link_libraries(cld2_unittest_full cld2) +target_link_libraries(cld2_unittest_full_avoid cld2) +target_link_libraries(cld2_dynamic_data_tool cld2 cld2_dynamic) +target_link_libraries(compact_lang_det_dynamic_test_chrome cld2_dynamic) +target_link_libraries(cld2_dynamic_unittest cld2_dynamic) +target_link_libraries(compact_lang_det_test_chrome_2 cld2) +target_link_libraries(compact_lang_det_test_chrome_16 cld2) +target_link_libraries(cld2_unittest_chrome_2 cld2) +target_link_libraries(cld2_unittest_avoid_chrome_2 cld2) From 8af52d6c405c14b38db5ba2e7b319a69450a9a54 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Thu, 26 Feb 2026 14:28:04 +0100 Subject: [PATCH 10/11] fix: missing link from full to standard --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58db864..22c6510 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,7 @@ set_target_properties(cld2_full PROPERTIES VERSION ${VERSION} SOVERSION 0 ) +target_link_libraries(cld2_full cld2) add_library(cld2_dynamic SHARED ${cld2_dynamic_SOURCE_FILES}) set_target_properties(cld2_dynamic PROPERTIES From 7964a43056d065d4532d59d3490b5cfe6b5a6501 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Thu, 26 Feb 2026 15:14:54 +0100 Subject: [PATCH 11/11] fix: remove unnecessary target_link_libraries for cld2_full --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22c6510..58db864 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,6 @@ set_target_properties(cld2_full PROPERTIES VERSION ${VERSION} SOVERSION 0 ) -target_link_libraries(cld2_full cld2) add_library(cld2_dynamic SHARED ${cld2_dynamic_SOURCE_FILES}) set_target_properties(cld2_dynamic PROPERTIES