Skip to content

Commit

Permalink
utf8.h: Move all SKIP functions to be near each other
Browse files Browse the repository at this point in the history
For convenient code reading
  • Loading branch information
khwilliamson committed Aug 7, 2021
1 parent 788cdc6 commit 222d763
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions utf8.h
Expand Up @@ -467,6 +467,14 @@ encoded as UTF-8. C<cp> is a native (ASCII or EBCDIC) code point if less than
*/
#define UVCHR_SKIP(uv) OFFUNISKIP(NATIVE_TO_UNI(uv))

#define NATIVE_SKIP(uv) UVCHR_SKIP(uv) /* Old terminology */

/* Most code which says UNISKIP is really thinking in terms of native code
* points (0-255) plus all those beyond. This is an imprecise term, but having
* it means existing code continues to work. For precision, use UVCHR_SKIP,
* NATIVE_SKIP, or OFFUNISKIP */
#define UNISKIP(uv) UVCHR_SKIP(uv)

#define UTF_MIN_START_BYTE \
((UTF_CONTINUATION_MARK >> UTF_ACCUMULATION_SHIFT) | UTF_START_MARK(2))

Expand Down Expand Up @@ -574,15 +582,6 @@ uppercase/lowercase/titlecase/fold into.
&& UTF8_IS_DOWNGRADEABLE_START(*(s)) \
&& UTF8_IS_CONTINUATION(*((s)+1)))

/* Number of bytes a code point occupies in UTF-8. */
#define NATIVE_SKIP(uv) UVCHR_SKIP(uv)

/* Most code which says UNISKIP is really thinking in terms of native code
* points (0-255) plus all those beyond. This is an imprecise term, but having
* it means existing code continues to work. For precision, use UVCHR_SKIP,
* NATIVE_SKIP, or OFFUNISKIP */
#define UNISKIP(uv) UVCHR_SKIP(uv)

/* Longer, but more accurate name */
#define UTF8_IS_ABOVE_LATIN1_START(c) UTF8_IS_ABOVE_LATIN1(c)

Expand Down

0 comments on commit 222d763

Please sign in to comment.