From 5f59a34ab747dde8ede7357f3431bf06bd6002fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 8 Mar 2026 17:28:33 +0100 Subject: New upstream version 1.4.2 --- lib/uninorm/canonical-decomposition.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'lib/uninorm/canonical-decomposition.c') diff --git a/lib/uninorm/canonical-decomposition.c b/lib/uninorm/canonical-decomposition.c index 628d2f12..93169bf2 100644 --- a/lib/uninorm/canonical-decomposition.c +++ b/lib/uninorm/canonical-decomposition.c @@ -1,5 +1,5 @@ /* Canonical decomposition of Unicode characters. - Copyright (C) 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This file is free software: you can redistribute it and/or modify @@ -33,18 +33,14 @@ uc_canonical_decomposition (ucs4_t uc, ucs4_t *decomposition) "Hangul Syllable Decomposition", See also the clarification at , section "Clarification of Hangul Jamo Handling". */ - unsigned int t; - uc -= 0xAC00; - t = uc % 28; + unsigned int t = uc % 28; if (t == 0) { - unsigned int v, l; - uc = uc / 28; - v = uc % 21; - l = uc / 21; + unsigned int v = uc % 21; + unsigned int l = uc / 21; decomposition[0] = 0x1100 + l; decomposition[1] = 0x1161 + v; @@ -57,11 +53,9 @@ uc_canonical_decomposition (ucs4_t uc, ucs4_t *decomposition) decomposition[1] = 0x11A7 + t; return 2; #else - unsigned int v, l; - uc = uc / 28; - v = uc % 21; - l = uc / 21; + unsigned int v = uc % 21; + unsigned int l = uc / 21; decomposition[0] = 0x1100 + l; decomposition[1] = 0x1161 + v; @@ -78,16 +72,12 @@ uc_canonical_decomposition (ucs4_t uc, ucs4_t *decomposition) is a canonical one. */ if (entry < 0x8000) { - const unsigned char *p; - unsigned int element; - unsigned int length; - - p = &gl_uninorm_decomp_chars_table[3 * entry]; - element = (p[0] << 16) | (p[1] << 8) | p[2]; + const unsigned char *p = &gl_uninorm_decomp_chars_table[3 * entry]; + unsigned int element = (p[0] << 16) | (p[1] << 8) | p[2]; /* The first element has 5 bits for the decomposition type. */ if (((element >> 18) & 0x1f) != UC_DECOMP_CANONICAL) abort (); - length = 1; + unsigned int length = 1; for (;;) { /* Every element has an 18 bits wide Unicode code point. */ -- cgit v1.2.3