Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move canonical_ordering functions

  • Loading branch information...
commit da2fa87e232d244f679d391263d180dd5b51bffe 1 parent 7b3bb60
Nikolai Weibull authored
Showing with 22 additions and 22 deletions.
  1. +22 −22 ext/u/u_normalize.c
View
44 ext/u/u_normalize.c
@@ -114,6 +114,28 @@ decompose_simple(uint32_t c, enum u_normalize_mode mode, uint32_t *result)
return u_n_chars(decomposition);
}
+static inline size_t
+decompose_step(uint32_t c, enum u_normalize_mode mode, uint32_t *result)
+{
+ return (SBase <= c && c <= SLast) ?
+ decompose_hangul(c, result) :
+ decompose_simple(c, mode, result);
+}
+
+static size_t
+decompose_loop(const char *string, size_t length, bool use_length,
+ enum u_normalize_mode mode, uint32_t *result)
+{
+ size_t n = 0;
+ const char *p = string;
+ const char *end = p + length;
+ while (P_WITHIN_STR(p, end, use_length)) {
+ n += decompose_step(u_dref(p), mode, OFFSET_IF(result, n));
+ p = u_next(p);
+ }
+ return n;
+}
+
static inline bool
canonical_ordering_swap(uint32_t *string, size_t offset, int next)
{
@@ -156,28 +178,6 @@ canonical_ordering(uint32_t *string, size_t length)
;
}
-static inline size_t
-decompose_step(uint32_t c, enum u_normalize_mode mode, uint32_t *result)
-{
- return (SBase <= c && c <= SLast) ?
- decompose_hangul(c, result) :
- decompose_simple(c, mode, result);
-}
-
-static size_t
-decompose_loop(const char *string, size_t length, bool use_length,
- enum u_normalize_mode mode, uint32_t *result)
-{
- size_t n = 0;
- const char *p = string;
- const char *end = p + length;
- while (P_WITHIN_STR(p, end, use_length)) {
- n += decompose_step(u_dref(p), mode, OFFSET_IF(result, n));
- p = u_next(p);
- }
- return n;
-}
-
static inline bool
combine_hangul(uint32_t a, uint32_t b, uint32_t *result)
{
Please sign in to comment.
Something went wrong with that request. Please try again.