summaryrefslogtreecommitdiff
path: root/pango/pango-emoji.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2019-01-24 11:42:34 +0100
committerBehdad Esfahbod <behdad@behdad.org>2019-01-24 11:42:34 +0100
commit267d991d9b6f040580a6421a0f52c292ed9304dc (patch)
tree320fc79a582c26b1275c995d2a2db8340cb0aa90 /pango/pango-emoji.c
parente7c292e918f318eccb6b756170640517331eee7a (diff)
downloadpango-267d991d9b6f040580a6421a0f52c292ed9304dc.tar.gz
Update emoji scanner ragel file to latest from Chrome
Diffstat (limited to 'pango/pango-emoji.c')
-rw-r--r--pango/pango-emoji.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c
index 886fef53..c0e0de60 100644
--- a/pango/pango-emoji.c
+++ b/pango/pango-emoji.c
@@ -192,18 +192,10 @@ _pango_EmojiSegmentationCategory (gunichar codepoint)
return kMaxEmojiScannerCategory;
}
-#define found_text_presentation_sequence \
- { \
- if (0) g_print ("text %ld..%ld\n", ts - buffer, te - buffer); \
- *end = te - buffer; \
- return FALSE; \
- }
-#define found_emoji_presentation_sequence \
- { \
- if (0) g_print ("emoji %ld..%ld\n", ts - buffer, te - buffer); \
- *end = te - buffer; \
- return TRUE; \
- }
+
+typedef gboolean bool;
+enum { false = FALSE, true = TRUE };
+typedef unsigned char *emoji_text_iter_t;
#include "emoji_presentation_scanner.c"
@@ -259,7 +251,9 @@ _pango_emoji_iter_next (PangoEmojiIter *iter)
iter->start = iter->end;
old_cursor = cursor = iter->cursor;
- is_emoji = scan_emoji_presentation (iter->types, iter->n_chars, cursor, &cursor);
+ cursor = scan_emoji_presentation (iter->types + cursor,
+ iter->types + iter->n_chars,
+ &is_emoji) - iter->types;
do
{
iter->cursor = cursor;
@@ -268,7 +262,9 @@ _pango_emoji_iter_next (PangoEmojiIter *iter)
if (cursor == iter->n_chars)
break;
- is_emoji = scan_emoji_presentation (iter->types, iter->n_chars, cursor, &cursor);
+ cursor = scan_emoji_presentation (iter->types + cursor,
+ iter->types + iter->n_chars,
+ &is_emoji) - iter->types;
}
while (iter->is_emoji == is_emoji);