From 2e076d52507be5dd998117ae119683c34b92b457 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 4 May 2016 03:39:44 -0400 Subject: stop using gunichar here it makes compilation more complicated, since it makes vt100.h require knowing about the glib headers --- src/unicode-extra.c | 11 ++++++----- src/unicode-extra.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/unicode-extra.c b/src/unicode-extra.c index 3a59378..b226e30 100644 --- a/src/unicode-extra.c +++ b/src/unicode-extra.c @@ -1,4 +1,5 @@ #include +#include #include "vt100.h" @@ -23,8 +24,8 @@ * http://www.unicode.org/Public/emoji/2.0//emoji-data.txt. */ struct vt100_char_range { - gunichar start; - gunichar end; + uint32_t start; + uint32_t end; }; static struct vt100_char_range vt100_wide_emoji[] = { @@ -64,14 +65,14 @@ static struct vt100_char_range vt100_wide_emoji[] = { { 0x1F9C0, 0x1F9C0 }, }; -static int vt100_is_wide_emoji(gunichar codepoint); +static int vt100_is_wide_emoji(uint32_t codepoint); -int vt100_is_wide_char(gunichar codepoint) +int vt100_is_wide_char(uint32_t codepoint) { return g_unichar_iswide(codepoint) || vt100_is_wide_emoji(codepoint); } -static int vt100_is_wide_emoji(gunichar codepoint) +static int vt100_is_wide_emoji(uint32_t codepoint) { static size_t ranges = sizeof(vt100_wide_emoji) / sizeof(struct vt100_char_range); ssize_t low = 0, high = ranges - 1; diff --git a/src/unicode-extra.h b/src/unicode-extra.h index eaa3dce..3f749e8 100644 --- a/src/unicode-extra.h +++ b/src/unicode-extra.h @@ -1,8 +1,8 @@ #ifndef _VT100_UNICODE_EXTRA_H #define _VT100_UNICODE_EXTRA_H -#include +#include -int vt100_is_wide_char(gunichar codepoint); +int vt100_is_wide_char(uint32_t codepoint); #endif -- cgit v1.2.3-54-g00ecf