Mark unsigned integer literals with the u suffix

Simplifies hb_in_range() calls as the type can be inferred.
The rest is obsessiveness, I admit.
This commit is contained in:
Behdad Esfahbod 2014-07-11 14:54:42 -04:00
parent a8b89a09f6
commit 7627100f42
32 changed files with 375 additions and 375 deletions

View File

@ -63,7 +63,7 @@ hb_buffer_serialize_format_t
hb_buffer_serialize_format_from_string (const char *str, int len) hb_buffer_serialize_format_from_string (const char *str, int len)
{ {
/* Upper-case it. */ /* Upper-case it. */
return (hb_buffer_serialize_format_t) (hb_tag_from_string (str, len) & ~0x20202020); return (hb_buffer_serialize_format_t) (hb_tag_from_string (str, len) & ~0x20202020u);
} }
/** /**

View File

@ -371,7 +371,7 @@ hb_script_from_iso15924_tag (hb_tag_t tag)
return HB_SCRIPT_INVALID; return HB_SCRIPT_INVALID;
/* Be lenient, adjust case (one capital letter followed by three small letters) */ /* Be lenient, adjust case (one capital letter followed by three small letters) */
tag = (tag & 0xDFDFDFDF) | 0x00202020; tag = (tag & 0xDFDFDFDFu) | 0x00202020u;
switch (tag) { switch (tag) {
@ -391,7 +391,7 @@ hb_script_from_iso15924_tag (hb_tag_t tag)
} }
/* If it looks right, just use the tag as a script */ /* If it looks right, just use the tag as a script */
if (((uint32_t) tag & 0xE0E0E0E0) == 0x40606060) if (((uint32_t) tag & 0xE0E0E0E0u) == 0x40606060u)
return (hb_script_t) tag; return (hb_script_t) tag;
/* Otherwise, return unknown */ /* Otherwise, return unknown */

View File

@ -610,13 +610,13 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
for (unsigned int i = 0; i < buffer->len; i++) { for (unsigned int i = 0; i < buffer->len; i++) {
hb_codepoint_t c = buffer->info[i].codepoint; hb_codepoint_t c = buffer->info[i].codepoint;
buffer->info[i].utf16_index() = chars_len; buffer->info[i].utf16_index() = chars_len;
if (likely (c < 0x10000)) if (likely (c <= 0xFFFFu))
pchars[chars_len++] = c; pchars[chars_len++] = c;
else if (unlikely (c >= 0x110000)) else if (unlikely (c > 0x10FFFFu))
pchars[chars_len++] = 0xFFFD; pchars[chars_len++] = 0xFFFDu;
else { else {
pchars[chars_len++] = 0xD800 + ((c - 0x10000) >> 10); pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10);
pchars[chars_len++] = 0xDC00 + ((c - 0x10000) & ((1 << 10) - 1)); pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1 << 10) - 1));
} }
} }
@ -642,7 +642,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
hb_codepoint_t c = buffer->info[i].codepoint; hb_codepoint_t c = buffer->info[i].codepoint;
unsigned int cluster = buffer->info[i].cluster; unsigned int cluster = buffer->info[i].cluster;
log_clusters[chars_len++] = cluster; log_clusters[chars_len++] = cluster;
if (c >= 0x10000 && c < 0x110000) if (hb_in_range (c, 0x10000u, 0x10FFFFu))
log_clusters[chars_len++] = cluster; /* Surrogates. */ log_clusters[chars_len++] = cluster; /* Surrogates. */
} }
@ -714,10 +714,10 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
for (CFIndex j = range.location; j < range.location + range.length; j++) for (CFIndex j = range.location; j < range.location + range.length; j++)
{ {
UniChar ch = CFStringGetCharacterAtIndex (string_ref, j); UniChar ch = CFStringGetCharacterAtIndex (string_ref, j);
if (hb_in_range<UniChar> (ch, 0xDC00, 0xDFFF) && range.location < j) if (hb_in_range<UniChar> (ch, 0xDC00u, 0xDFFFu) && range.location < j)
{ {
ch = CFStringGetCharacterAtIndex (string_ref, j - 1); ch = CFStringGetCharacterAtIndex (string_ref, j - 1);
if (hb_in_range<UniChar> (ch, 0xD800, 0xDBFF)) if (hb_in_range<UniChar> (ch, 0xD800u, 0xDBFFu))
/* This is the second of a surrogate pair. Don't need .notdef /* This is the second of a surrogate pair. Don't need .notdef
* for this one. */ * for this one. */
continue; continue;

View File

@ -138,7 +138,7 @@ struct TTCHeaderVersion1
protected: protected:
Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */ Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */
FixedVersion version; /* Version of the TTC Header (1.0), FixedVersion version; /* Version of the TTC Header (1.0),
* 0x00010000 */ * 0x00010000u */
ArrayOf<OffsetTo<OffsetTable, ULONG>, ULONG> ArrayOf<OffsetTo<OffsetTable, ULONG>, ULONG>
table; /* Array of offsets to the OffsetTable for each font table; /* Array of offsets to the OffsetTable for each font
* from the beginning of the file */ * from the beginning of the file */
@ -184,7 +184,7 @@ struct TTCHeader
struct { struct {
Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */ Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */
FixedVersion version; /* Version of the TTC Header (1.0 or 2.0), FixedVersion version; /* Version of the TTC Header (1.0 or 2.0),
* 0x00010000 or 0x00020000 */ * 0x00010000u or 0x00020000u */
} header; } header;
TTCHeaderVersion1 version1; TTCHeaderVersion1 version1;
} u; } u;

View File

@ -626,7 +626,7 @@ typedef USHORT GlyphID;
/* Script/language-system/feature index */ /* Script/language-system/feature index */
struct Index : USHORT { struct Index : USHORT {
static const unsigned int NOT_FOUND_INDEX = 0xFFFF; static const unsigned int NOT_FOUND_INDEX = 0xFFFFu;
}; };
DEFINE_NULL_DATA (Index, "\xff\xff"); DEFINE_NULL_DATA (Index, "\xff\xff");

View File

@ -121,7 +121,7 @@ struct CmapSubtableFormat4
gid += idDelta[i]; gid += idDelta[i];
} }
*glyph = gid & 0xFFFF; *glyph = gid & 0xFFFFu;
return true; return true;
} }
@ -159,7 +159,7 @@ struct CmapSubtableFormat4
USHORT values[VAR]; USHORT values[VAR];
#if 0 #if 0
USHORT endCount[segCount]; /* End characterCode for each segment, USHORT endCount[segCount]; /* End characterCode for each segment,
* last=0xFFFF. */ * last=0xFFFFu. */
USHORT reservedPad; /* Set to 0. */ USHORT reservedPad; /* Set to 0. */
USHORT startCount[segCount]; /* Start character code for each segment. */ USHORT startCount[segCount]; /* Start character code for each segment. */
SHORT idDelta[segCount]; /* Delta for all character codes in segment. */ SHORT idDelta[segCount]; /* Delta for all character codes in segment. */

View File

@ -58,12 +58,12 @@ struct head
protected: protected:
FixedVersion version; /* Version of the head table--currently FixedVersion version; /* Version of the head table--currently
* 0x00010000 for version 1.0. */ * 0x00010000u for version 1.0. */
FixedVersion fontRevision; /* Set by font manufacturer. */ FixedVersion fontRevision; /* Set by font manufacturer. */
ULONG checkSumAdjustment; /* To compute: set it to 0, sum the ULONG checkSumAdjustment; /* To compute: set it to 0, sum the
* entire font as ULONG, then store * entire font as ULONG, then store
* 0xB1B0AFBA - sum. */ * 0xB1B0AFBAu - sum. */
ULONG magicNumber; /* Set to 0x5F0F3CF5. */ ULONG magicNumber; /* Set to 0x5F0F3CF5u. */
USHORT flags; /* Bit 0: Baseline for font at y=0; USHORT flags; /* Bit 0: Baseline for font at y=0;
* Bit 1: Left sidebearing point at x=0; * Bit 1: Left sidebearing point at x=0;
* Bit 2: Instructions may depend on point size; * Bit 2: Instructions may depend on point size;

View File

@ -50,7 +50,7 @@ struct hhea
} }
public: public:
FixedVersion version; /* 0x00010000 for version 1.0. */ FixedVersion version; /* 0x00010000u for version 1.0. */
FWORD ascender; /* Typographic ascent. <a FWORD ascender; /* Typographic ascent. <a
* href="http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html"> * href="http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html">
* (Distance from baseline of highest * (Distance from baseline of highest

View File

@ -190,10 +190,10 @@ struct LangSys
unsigned int *feature_indexes /* OUT */) const unsigned int *feature_indexes /* OUT */) const
{ return featureIndex.get_indexes (start_offset, feature_count, feature_indexes); } { return featureIndex.get_indexes (start_offset, feature_count, feature_indexes); }
inline bool has_required_feature (void) const { return reqFeatureIndex != 0xffff; } inline bool has_required_feature (void) const { return reqFeatureIndex != 0xFFFFu; }
inline unsigned int get_required_feature_index (void) const inline unsigned int get_required_feature_index (void) const
{ {
if (reqFeatureIndex == 0xffff) if (reqFeatureIndex == 0xFFFFu)
return Index::NOT_FOUND_INDEX; return Index::NOT_FOUND_INDEX;
return reqFeatureIndex;; return reqFeatureIndex;;
} }
@ -208,7 +208,7 @@ struct LangSys
* reordering table) */ * reordering table) */
USHORT reqFeatureIndex;/* Index of a feature required for this USHORT reqFeatureIndex;/* Index of a feature required for this
* language system--if no required features * language system--if no required features
* = 0xFFFF */ * = 0xFFFFu */
IndexArray featureIndex; /* Array of indices into the FeatureList */ IndexArray featureIndex; /* Array of indices into the FeatureList */
public: public:
DEFINE_SIZE_ARRAY (6, featureIndex); DEFINE_SIZE_ARRAY (6, featureIndex);
@ -448,9 +448,9 @@ struct FeatureParams
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
if (tag == HB_TAG ('s','i','z','e')) if (tag == HB_TAG ('s','i','z','e'))
return TRACE_RETURN (u.size.sanitize (c)); return TRACE_RETURN (u.size.sanitize (c));
if ((tag & 0xFFFF0000) == HB_TAG ('s','s','\0','\0')) /* ssXX */ if ((tag & 0xFFFF0000u) == HB_TAG ('s','s','\0','\0')) /* ssXX */
return TRACE_RETURN (u.stylisticSet.sanitize (c)); return TRACE_RETURN (u.stylisticSet.sanitize (c));
if ((tag & 0xFFFF0000) == HB_TAG ('c','v','\0','\0')) /* cvXX */ if ((tag & 0xFFFF0000u) == HB_TAG ('c','v','\0','\0')) /* cvXX */
return TRACE_RETURN (u.characterVariants.sanitize (c)); return TRACE_RETURN (u.characterVariants.sanitize (c));
return TRACE_RETURN (true); return TRACE_RETURN (true);
} }
@ -585,7 +585,7 @@ struct Lookup
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false); if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
lookupType.set (lookup_type); lookupType.set (lookup_type);
lookupFlag.set (lookup_props & 0xFFFF); lookupFlag.set (lookup_props & 0xFFFFu);
if (unlikely (!subTable.serialize (c, num_subtables))) return TRACE_RETURN (false); if (unlikely (!subTable.serialize (c, num_subtables))) return TRACE_RETURN (false);
if (lookupFlag & LookupFlag::UseMarkFilteringSet) if (lookupFlag & LookupFlag::UseMarkFilteringSet)
{ {
@ -1131,7 +1131,7 @@ struct Device
unsigned int byte = deltaValue[s >> (4 - f)]; unsigned int byte = deltaValue[s >> (4 - f)];
unsigned int bits = (byte >> (16 - (((s & ((1 << (4 - f)) - 1)) + 1) << f))); unsigned int bits = (byte >> (16 - (((s & ((1 << (4 - f)) - 1)) + 1) << f)));
unsigned int mask = (0xFFFF >> (16 - (1 << f))); unsigned int mask = (0xFFFFu >> (16 - (1 << f)));
int delta = bits & mask; int delta = bits & mask;

View File

@ -360,9 +360,9 @@ struct GDEF
hb_position_t *caret_array /* OUT */) const hb_position_t *caret_array /* OUT */) const
{ return (this+ligCaretList).get_lig_carets (font, direction, glyph_id, start_offset, caret_count, caret_array); } { return (this+ligCaretList).get_lig_carets (font, direction, glyph_id, start_offset, caret_count, caret_array); }
inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002 && markGlyphSetsDef[0] != 0; } inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef[0] != 0; }
inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const
{ return version.to_int () >= 0x00010002 && (this+markGlyphSetsDef[0]).covers (set_index, glyph_id); } { return version.to_int () >= 0x00010002u && (this+markGlyphSetsDef[0]).covers (set_index, glyph_id); }
inline bool sanitize (hb_sanitize_context_t *c) { inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
@ -372,7 +372,7 @@ struct GDEF
attachList.sanitize (c, this) && attachList.sanitize (c, this) &&
ligCaretList.sanitize (c, this) && ligCaretList.sanitize (c, this) &&
markAttachClassDef.sanitize (c, this) && markAttachClassDef.sanitize (c, this) &&
(version.to_int () < 0x00010002 || markGlyphSetsDef[0].sanitize (c, this))); (version.to_int () < 0x00010002u || markGlyphSetsDef[0].sanitize (c, this)));
} }
@ -400,7 +400,7 @@ struct GDEF
protected: protected:
FixedVersion version; /* Version of the GDEF table--currently FixedVersion version; /* Version of the GDEF table--currently
* 0x00010002 */ * 0x00010002u */
OffsetTo<ClassDef> OffsetTo<ClassDef>
glyphClassDef; /* Offset to class definition table glyphClassDef; /* Offset to class definition table
* for glyph type--from beginning of * for glyph type--from beginning of

View File

@ -49,18 +49,18 @@ typedef Value ValueRecord[VAR];
struct ValueFormat : USHORT struct ValueFormat : USHORT
{ {
enum Flags { enum Flags {
xPlacement = 0x0001, /* Includes horizontal adjustment for placement */ xPlacement = 0x0001u, /* Includes horizontal adjustment for placement */
yPlacement = 0x0002, /* Includes vertical adjustment for placement */ yPlacement = 0x0002u, /* Includes vertical adjustment for placement */
xAdvance = 0x0004, /* Includes horizontal adjustment for advance */ xAdvance = 0x0004u, /* Includes horizontal adjustment for advance */
yAdvance = 0x0008, /* Includes vertical adjustment for advance */ yAdvance = 0x0008u, /* Includes vertical adjustment for advance */
xPlaDevice = 0x0010, /* Includes horizontal Device table for placement */ xPlaDevice = 0x0010u, /* Includes horizontal Device table for placement */
yPlaDevice = 0x0020, /* Includes vertical Device table for placement */ yPlaDevice = 0x0020u, /* Includes vertical Device table for placement */
xAdvDevice = 0x0040, /* Includes horizontal Device table for advance */ xAdvDevice = 0x0040u, /* Includes horizontal Device table for advance */
yAdvDevice = 0x0080, /* Includes vertical Device table for advance */ yAdvDevice = 0x0080u, /* Includes vertical Device table for advance */
ignored = 0x0F00, /* Was used in TrueType Open for MM fonts */ ignored = 0x0F00u, /* Was used in TrueType Open for MM fonts */
reserved = 0xF000, /* For future use */ reserved = 0xF000u, /* For future use */
devices = 0x00F0 /* Mask for having any Device table */ devices = 0x00F0u /* Mask for having any Device table */
}; };
/* All fields are options. Only those available advance the value pointer. */ /* All fields are options. Only those available advance the value pointer. */

View File

@ -44,7 +44,7 @@ struct SingleSubstFormat1
for (iter.init (this+coverage); iter.more (); iter.next ()) { for (iter.init (this+coverage); iter.more (); iter.next ()) {
hb_codepoint_t glyph_id = iter.get_glyph (); hb_codepoint_t glyph_id = iter.get_glyph ();
if (c->glyphs->has (glyph_id)) if (c->glyphs->has (glyph_id))
c->glyphs->add ((glyph_id + deltaGlyphID) & 0xFFFF); c->glyphs->add ((glyph_id + deltaGlyphID) & 0xFFFFu);
} }
} }
@ -55,7 +55,7 @@ struct SingleSubstFormat1
for (iter.init (this+coverage); iter.more (); iter.next ()) { for (iter.init (this+coverage); iter.more (); iter.next ()) {
hb_codepoint_t glyph_id = iter.get_glyph (); hb_codepoint_t glyph_id = iter.get_glyph ();
c->input->add (glyph_id); c->input->add (glyph_id);
c->output->add ((glyph_id + deltaGlyphID) & 0xFFFF); c->output->add ((glyph_id + deltaGlyphID) & 0xFFFFu);
} }
} }
@ -79,7 +79,7 @@ struct SingleSubstFormat1
/* According to the Adobe Annotated OpenType Suite, result is always /* According to the Adobe Annotated OpenType Suite, result is always
* limited to 16bit. */ * limited to 16bit. */
glyph_id = (glyph_id + deltaGlyphID) & 0xFFFF; glyph_id = (glyph_id + deltaGlyphID) & 0xFFFFu;
c->replace_glyph (glyph_id); c->replace_glyph (glyph_id);
return TRACE_RETURN (true); return TRACE_RETURN (true);

View File

@ -2294,7 +2294,7 @@ struct GSUBGPOS
protected: protected:
FixedVersion version; /* Version of the GSUB/GPOS table--initially set FixedVersion version; /* Version of the GSUB/GPOS table--initially set
* to 0x00010000 */ * to 0x00010000u */
OffsetTo<ScriptList> OffsetTo<ScriptList>
scriptList; /* ScriptList table */ scriptList; /* ScriptList table */
OffsetTo<FeatureList> OffsetTo<FeatureList>

View File

@ -214,7 +214,7 @@ struct JSTF
protected: protected:
FixedVersion version; /* Version of the JSTF table--initially set FixedVersion version; /* Version of the JSTF table--initially set
* to 0x00010000 */ * to 0x00010000u */
RecordArrayOf<JstfScript> RecordArrayOf<JstfScript>
scriptList; /* Array of JstfScripts--listed scriptList; /* Array of JstfScripts--listed
* alphabetically by ScriptTag */ * alphabetically by ScriptTag */

View File

@ -190,8 +190,8 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_unicode_funcs_t *uni
/* XXX This shouldn't be inlined, or at least not while is_default_ignorable() is inline. */ /* XXX This shouldn't be inlined, or at least not while is_default_ignorable() is inline. */
info->unicode_props0() = ((unsigned int) unicode->general_category (info->codepoint)) | info->unicode_props0() = ((unsigned int) unicode->general_category (info->codepoint)) |
(unicode->is_default_ignorable (info->codepoint) ? MASK0_IGNORABLE : 0) | (unicode->is_default_ignorable (info->codepoint) ? MASK0_IGNORABLE : 0) |
(info->codepoint == 0x200C ? MASK0_ZWNJ : 0) | (info->codepoint == 0x200Cu ? MASK0_ZWNJ : 0) |
(info->codepoint == 0x200D ? MASK0_ZWJ : 0); (info->codepoint == 0x200Du ? MASK0_ZWJ : 0);
info->unicode_props1() = unicode->modified_combining_class (info->codepoint); info->unicode_props1() = unicode->modified_combining_class (info->codepoint);
} }

View File

@ -92,9 +92,9 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font,
* GSUB/GPOS feature query and enumeration interface * GSUB/GPOS feature query and enumeration interface
*/ */
#define HB_OT_LAYOUT_NO_SCRIPT_INDEX ((unsigned int) 0xFFFF) #define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu
#define HB_OT_LAYOUT_NO_FEATURE_INDEX ((unsigned int) 0xFFFF) #define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu
#define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX ((unsigned int) 0xFFFF) #define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu
unsigned int unsigned int
hb_ot_layout_table_get_script_tags (hb_face_t *face, hb_ot_layout_table_get_script_tags (hb_face_t *face,

View File

@ -153,10 +153,10 @@ struct hb_ot_map_t
}; };
enum hb_ot_map_feature_flags_t { enum hb_ot_map_feature_flags_t {
F_NONE = 0x0000, F_NONE = 0x0000u,
F_GLOBAL = 0x0001, F_GLOBAL = 0x0001u,
F_HAS_FALLBACK = 0x0002, F_HAS_FALLBACK = 0x0002u,
F_MANUAL_ZWJ = 0x0004 F_MANUAL_ZWJ = 0x0004u
}; };
/* Macro version for where const is desired. */ /* Macro version for where const is desired. */
#define F_COMBINE(l,r) (hb_ot_map_feature_flags_t ((unsigned int) (l) | (unsigned int) (r))) #define F_COMBINE(l,r) (hb_ot_map_feature_flags_t ((unsigned int) (l) | (unsigned int) (r)))

View File

@ -50,13 +50,13 @@ struct maxp
inline bool sanitize (hb_sanitize_context_t *c) { inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return TRACE_RETURN (c->check_struct (this) && return TRACE_RETURN (c->check_struct (this) &&
likely (version.major == 1 || (version.major == 0 && version.minor == 0x5000))); likely (version.major == 1 || (version.major == 0 && version.minor == 0x5000u)));
} }
/* We only implement version 0.5 as none of the extra fields in version 1.0 are useful. */ /* We only implement version 0.5 as none of the extra fields in version 1.0 are useful. */
protected: protected:
FixedVersion version; /* Version of the maxp table (0.5 or 1.0), FixedVersion version; /* Version of the maxp table (0.5 or 1.0),
* 0x00005000 or 0x00010000. */ * 0x00005000u or 0x00010000u. */
USHORT numGlyphs; /* The number of glyphs in the font. */ USHORT numGlyphs; /* The number of glyphs in the font. */
public: public:
DEFINE_SIZE_STATIC (6); DEFINE_SIZE_STATIC (6);

View File

@ -71,7 +71,7 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS
!hb_font_get_glyph (font, u, 0, &u_glyph) || !hb_font_get_glyph (font, u, 0, &u_glyph) ||
!hb_font_get_glyph (font, s, 0, &s_glyph) || !hb_font_get_glyph (font, s, 0, &s_glyph) ||
u_glyph == s_glyph || u_glyph == s_glyph ||
u_glyph > 0xFFFF || s_glyph > 0xFFFF) u_glyph > 0xFFFFu || s_glyph > 0xFFFFu)
continue; continue;
glyphs[num_glyphs].set (u_glyph); glyphs[num_glyphs].set (u_glyph);

View File

@ -86,26 +86,26 @@ data_destroy_hangul (void *data)
} }
/* Constants for algorithmic hangul syllable [de]composition. */ /* Constants for algorithmic hangul syllable [de]composition. */
#define LBase 0x1100 #define LBase 0x1100u
#define VBase 0x1161 #define VBase 0x1161u
#define TBase 0x11A7 #define TBase 0x11A7u
#define LCount 19 #define LCount 19u
#define VCount 21 #define VCount 21u
#define TCount 28 #define TCount 28u
#define SBase 0xAC00 #define SBase 0xAC00u
#define NCount (VCount * TCount) #define NCount (VCount * TCount)
#define SCount (LCount * NCount) #define SCount (LCount * NCount)
#define isCombiningL(u) (hb_in_range<hb_codepoint_t> ((u), LBase, LBase+LCount-1)) #define isCombiningL(u) (hb_in_range ((u), LBase, LBase+LCount-1))
#define isCombiningV(u) (hb_in_range<hb_codepoint_t> ((u), VBase, VBase+VCount-1)) #define isCombiningV(u) (hb_in_range ((u), VBase, VBase+VCount-1))
#define isCombiningT(u) (hb_in_range<hb_codepoint_t> ((u), TBase+1, TBase+TCount-1)) #define isCombiningT(u) (hb_in_range ((u), TBase+1, TBase+TCount-1))
#define isCombinedS(u) (hb_in_range<hb_codepoint_t> ((u), SBase, SBase+SCount-1)) #define isCombinedS(u) (hb_in_range ((u), SBase, SBase+SCount-1))
#define isL(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x1100, 0x115F, 0xA960, 0xA97C)) #define isL(u) (hb_in_ranges ((u), 0x1100u, 0x115Fu, 0xA960u, 0xA97Cu))
#define isV(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x1160, 0x11A7, 0xD7B0, 0xD7C6)) #define isV(u) (hb_in_ranges ((u), 0x1160u, 0x11A7u, 0xD7B0u, 0xD7C6u))
#define isT(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x11A8, 0x11FF, 0xD7CB, 0xD7FB)) #define isT(u) (hb_in_ranges ((u), 0x11A8u, 0x11FFu, 0xD7CBu, 0xD7FBu))
#define isHangulTone(u) (hb_in_range<hb_codepoint_t> ((u), 0x302e, 0x302f)) #define isHangulTone(u) (hb_in_range ((u), 0x302Eu, 0x302Fu))
/* buffer var allocations */ /* buffer var allocations */
#define hangul_shaping_feature() complex_var_u8_0() /* hangul jamo shaping feature */ #define hangul_shaping_feature() complex_var_u8_0() /* hangul jamo shaping feature */
@ -211,14 +211,14 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan,
else else
{ {
/* No valid syllable as base for tone mark; try to insert dotted circle. */ /* No valid syllable as base for tone mark; try to insert dotted circle. */
if (font->has_glyph (0x25cc)) if (font->has_glyph (0x25CCu))
{ {
hb_codepoint_t chars[2]; hb_codepoint_t chars[2];
if (!is_zero_width_char (font, u)) { if (!is_zero_width_char (font, u)) {
chars[0] = u; chars[0] = u;
chars[1] = 0x25cc; chars[1] = 0x25CCu;
} else { } else {
chars[0] = 0x25cc; chars[0] = 0x25CCu;
chars[1] = u; chars[1] = u;
} }
buffer->replace_glyphs (1, 2, chars); buffer->replace_glyphs (1, 2, chars);

View File

@ -35,37 +35,37 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c,
{ {
/* Hebrew presentation-form shaping. /* Hebrew presentation-form shaping.
* https://bugzilla.mozilla.org/show_bug.cgi?id=728866 * https://bugzilla.mozilla.org/show_bug.cgi?id=728866
* Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA; * Hebrew presentation forms with dagesh, for characters U+05D0..05EA;
* Note that some letters do not have a dagesh presForm encoded. * Note that some letters do not have a dagesh presForm encoded.
*/ */
static const hb_codepoint_t sDageshForms[0x05EA - 0x05D0 + 1] = { static const hb_codepoint_t sDageshForms[0x05EAu - 0x05D0u + 1] = {
0xFB30, /* ALEF */ 0xFB30u, /* ALEF */
0xFB31, /* BET */ 0xFB31u, /* BET */
0xFB32, /* GIMEL */ 0xFB32u, /* GIMEL */
0xFB33, /* DALET */ 0xFB33u, /* DALET */
0xFB34, /* HE */ 0xFB34u, /* HE */
0xFB35, /* VAV */ 0xFB35u, /* VAV */
0xFB36, /* ZAYIN */ 0xFB36u, /* ZAYIN */
0x0000, /* HET */ 0x0000u, /* HET */
0xFB38, /* TET */ 0xFB38u, /* TET */
0xFB39, /* YOD */ 0xFB39u, /* YOD */
0xFB3A, /* FINAL KAF */ 0xFB3Au, /* FINAL KAF */
0xFB3B, /* KAF */ 0xFB3Bu, /* KAF */
0xFB3C, /* LAMED */ 0xFB3Cu, /* LAMED */
0x0000, /* FINAL MEM */ 0x0000u, /* FINAL MEM */
0xFB3E, /* MEM */ 0xFB3Eu, /* MEM */
0x0000, /* FINAL NUN */ 0x0000u, /* FINAL NUN */
0xFB40, /* NUN */ 0xFB40u, /* NUN */
0xFB41, /* SAMEKH */ 0xFB41u, /* SAMEKH */
0x0000, /* AYIN */ 0x0000u, /* AYIN */
0xFB43, /* FINAL PE */ 0xFB43u, /* FINAL PE */
0xFB44, /* PE */ 0xFB44u, /* PE */
0x0000, /* FINAL TSADI */ 0x0000u, /* FINAL TSADI */
0xFB46, /* TSADI */ 0xFB46u, /* TSADI */
0xFB47, /* QOF */ 0xFB47u, /* QOF */
0xFB48, /* RESH */ 0xFB48u, /* RESH */
0xFB49, /* SHIN */ 0xFB49u, /* SHIN */
0xFB4A /* TAV */ 0xFB4Au /* TAV */
}; };
bool found = c->unicode->compose (a, b, ab); bool found = c->unicode->compose (a, b, ab);
@ -75,76 +75,76 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c,
/* Special-case Hebrew presentation forms that are excluded from /* Special-case Hebrew presentation forms that are excluded from
* standard normalization, but wanted for old fonts. */ * standard normalization, but wanted for old fonts. */
switch (b) { switch (b) {
case 0x05B4: /* HIRIQ */ case 0x05B4u: /* HIRIQ */
if (a == 0x05D9) { /* YOD */ if (a == 0x05D9u) { /* YOD */
*ab = 0xFB1D; *ab = 0xFB1Du;
found = true; found = true;
} }
break; break;
case 0x05B7: /* patah */ case 0x05B7u: /* patah */
if (a == 0x05F2) { /* YIDDISH YOD YOD */ if (a == 0x05F2u) { /* YIDDISH YOD YOD */
*ab = 0xFB1F; *ab = 0xFB1Fu;
found = true; found = true;
} else if (a == 0x05D0) { /* ALEF */ } else if (a == 0x05D0u) { /* ALEF */
*ab = 0xFB2E; *ab = 0xFB2Eu;
found = true; found = true;
} }
break; break;
case 0x05B8: /* QAMATS */ case 0x05B8u: /* QAMATS */
if (a == 0x05D0) { /* ALEF */ if (a == 0x05D0u) { /* ALEF */
*ab = 0xFB2F; *ab = 0xFB2Fu;
found = true; found = true;
} }
break; break;
case 0x05B9: /* HOLAM */ case 0x05B9u: /* HOLAM */
if (a == 0x05D5) { /* VAV */ if (a == 0x05D5u) { /* VAV */
*ab = 0xFB4B; *ab = 0xFB4Bu;
found = true; found = true;
} }
break; break;
case 0x05BC: /* DAGESH */ case 0x05BCu: /* DAGESH */
if (a >= 0x05D0 && a <= 0x05EA) { if (a >= 0x05D0u && a <= 0x05EAu) {
*ab = sDageshForms[a - 0x05D0]; *ab = sDageshForms[a - 0x05D0u];
found = (*ab != 0); found = (*ab != 0);
} else if (a == 0xFB2A) { /* SHIN WITH SHIN DOT */ } else if (a == 0xFB2Au) { /* SHIN WITH SHIN DOT */
*ab = 0xFB2C; *ab = 0xFB2Cu;
found = true; found = true;
} else if (a == 0xFB2B) { /* SHIN WITH SIN DOT */ } else if (a == 0xFB2Bu) { /* SHIN WITH SIN DOT */
*ab = 0xFB2D; *ab = 0xFB2Du;
found = true; found = true;
} }
break; break;
case 0x05BF: /* RAFE */ case 0x05BFu: /* RAFE */
switch (a) { switch (a) {
case 0x05D1: /* BET */ case 0x05D1u: /* BET */
*ab = 0xFB4C; *ab = 0xFB4Cu;
found = true; found = true;
break; break;
case 0x05DB: /* KAF */ case 0x05DBu: /* KAF */
*ab = 0xFB4D; *ab = 0xFB4Du;
found = true; found = true;
break; break;
case 0x05E4: /* PE */ case 0x05E4u: /* PE */
*ab = 0xFB4E; *ab = 0xFB4Eu;
found = true; found = true;
break; break;
} }
break; break;
case 0x05C1: /* SHIN DOT */ case 0x05C1u: /* SHIN DOT */
if (a == 0x05E9) { /* SHIN */ if (a == 0x05E9u) { /* SHIN */
*ab = 0xFB2A; *ab = 0xFB2Au;
found = true; found = true;
} else if (a == 0xFB49) { /* SHIN WITH DAGESH */ } else if (a == 0xFB49u) { /* SHIN WITH DAGESH */
*ab = 0xFB2C; *ab = 0xFB2Cu;
found = true; found = true;
} }
break; break;
case 0x05C2: /* SIN DOT */ case 0x05C2u: /* SIN DOT */
if (a == 0x05E9) { /* SHIN */ if (a == 0x05E9u) { /* SHIN */
*ab = 0xFB2B; *ab = 0xFB2Bu;
found = true; found = true;
} else if (a == 0xFB49) { /* SHIN WITH DAGESH */ } else if (a == 0xFB49u) { /* SHIN WITH DAGESH */
*ab = 0xFB2D; *ab = 0xFB2Du;
found = true; found = true;
} }
break; break;

View File

@ -37,19 +37,19 @@
*/ */
#define IN_HALF_BLOCK(u, Base) (((u) & ~0x7F) == (Base)) #define IN_HALF_BLOCK(u, Base) (((u) & ~0x7Fu) == (Base))
#define IS_DEVA(u) (IN_HALF_BLOCK (u, 0x0900)) #define IS_DEVA(u) (IN_HALF_BLOCK (u, 0x0900u))
#define IS_BENG(u) (IN_HALF_BLOCK (u, 0x0980)) #define IS_BENG(u) (IN_HALF_BLOCK (u, 0x0980u))
#define IS_GURU(u) (IN_HALF_BLOCK (u, 0x0A00)) #define IS_GURU(u) (IN_HALF_BLOCK (u, 0x0A00u))
#define IS_GUJR(u) (IN_HALF_BLOCK (u, 0x0A80)) #define IS_GUJR(u) (IN_HALF_BLOCK (u, 0x0A80u))
#define IS_ORYA(u) (IN_HALF_BLOCK (u, 0x0B00)) #define IS_ORYA(u) (IN_HALF_BLOCK (u, 0x0B00u))
#define IS_TAML(u) (IN_HALF_BLOCK (u, 0x0B80)) #define IS_TAML(u) (IN_HALF_BLOCK (u, 0x0B80u))
#define IS_TELU(u) (IN_HALF_BLOCK (u, 0x0C00)) #define IS_TELU(u) (IN_HALF_BLOCK (u, 0x0C00u))
#define IS_KNDA(u) (IN_HALF_BLOCK (u, 0x0C80)) #define IS_KNDA(u) (IN_HALF_BLOCK (u, 0x0C80u))
#define IS_MLYM(u) (IN_HALF_BLOCK (u, 0x0D00)) #define IS_MLYM(u) (IN_HALF_BLOCK (u, 0x0D00u))
#define IS_SINH(u) (IN_HALF_BLOCK (u, 0x0D80)) #define IS_SINH(u) (IN_HALF_BLOCK (u, 0x0D80u))
#define IS_KHMR(u) (IN_HALF_BLOCK (u, 0x1780)) #define IS_KHMR(u) (IN_HALF_BLOCK (u, 0x1780u))
#define MATRA_POS_LEFT(u) POS_PRE_M #define MATRA_POS_LEFT(u) POS_PRE_M
@ -60,8 +60,8 @@
IS_GUJR(u) ? POS_AFTER_POST : \ IS_GUJR(u) ? POS_AFTER_POST : \
IS_ORYA(u) ? POS_AFTER_POST : \ IS_ORYA(u) ? POS_AFTER_POST : \
IS_TAML(u) ? POS_AFTER_POST : \ IS_TAML(u) ? POS_AFTER_POST : \
IS_TELU(u) ? (u <= 0x0C42 ? POS_BEFORE_SUB : POS_AFTER_SUB) : \ IS_TELU(u) ? (u <= 0x0C42u ? POS_BEFORE_SUB : POS_AFTER_SUB) : \
IS_KNDA(u) ? (u < 0x0CC3 || u > 0xCD6 ? POS_BEFORE_SUB : POS_AFTER_SUB) : \ IS_KNDA(u) ? (u < 0x0CC3u || u > 0xCD6u ? POS_BEFORE_SUB : POS_AFTER_SUB) : \
IS_MLYM(u) ? POS_AFTER_POST : \ IS_MLYM(u) ? POS_AFTER_POST : \
IS_SINH(u) ? POS_AFTER_SUB : \ IS_SINH(u) ? POS_AFTER_SUB : \
IS_KHMR(u) ? POS_AFTER_POST : \ IS_KHMR(u) ? POS_AFTER_POST : \
@ -112,20 +112,20 @@ matra_position (hb_codepoint_t u, indic_position_t side)
* Or completely remove it and just check in the tables. * Or completely remove it and just check in the tables.
*/ */
static const hb_codepoint_t ra_chars[] = { static const hb_codepoint_t ra_chars[] = {
0x0930, /* Devanagari */ 0x0930u, /* Devanagari */
0x09B0, /* Bengali */ 0x09B0u, /* Bengali */
0x09F0, /* Bengali */ 0x09F0u, /* Bengali */
0x0A30, /* Gurmukhi */ /* No Reph */ 0x0A30u, /* Gurmukhi */ /* No Reph */
0x0AB0, /* Gujarati */ 0x0AB0u, /* Gujarati */
0x0B30, /* Oriya */ 0x0B30u, /* Oriya */
0x0BB0, /* Tamil */ /* No Reph */ 0x0BB0u, /* Tamil */ /* No Reph */
0x0C30, /* Telugu */ /* Reph formed only with ZWJ */ 0x0C30u, /* Telugu */ /* Reph formed only with ZWJ */
0x0CB0, /* Kannada */ 0x0CB0u, /* Kannada */
0x0D30, /* Malayalam */ /* No Reph, Logical Repha */ 0x0D30u, /* Malayalam */ /* No Reph, Logical Repha */
0x0DBB, /* Sinhala */ /* Reph formed only with ZWJ */ 0x0DBBu, /* Sinhala */ /* Reph formed only with ZWJ */
0x179A, /* Khmer */ /* No Reph, Visual Repha */ 0x179Au, /* Khmer */ /* No Reph, Visual Repha */
}; };
static inline bool static inline bool
@ -168,7 +168,7 @@ set_indic_properties (hb_glyph_info_t &info)
{ {
hb_codepoint_t u = info.codepoint; hb_codepoint_t u = info.codepoint;
unsigned int type = hb_indic_get_categories (u); unsigned int type = hb_indic_get_categories (u);
indic_category_t cat = (indic_category_t) (type & 0x7F); indic_category_t cat = (indic_category_t) (type & 0x7Fu);
indic_position_t pos = (indic_position_t) (type >> 8); indic_position_t pos = (indic_position_t) (type >> 8);
@ -187,50 +187,50 @@ set_indic_properties (hb_glyph_info_t &info)
* U+092E,U+0951,U+0952 * U+092E,U+0951,U+0952
* U+092E,U+0952,U+0951 * U+092E,U+0952,U+0951
*/ */
if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0x0951, 0x0952, if (unlikely (hb_in_ranges (u, 0x0951u, 0x0952u,
0x1CD0, 0x1CD2, 0x1CD0u, 0x1CD2u,
0x1CD4, 0x1CE1) || 0x1CD4u, 0x1CE1u) ||
u == 0x1CF4)) u == 0x1CF4u))
cat = OT_A; cat = OT_A;
/* The following act more like the Bindus. */ /* The following act more like the Bindus. */
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x0953, 0x0954))) else if (unlikely (hb_in_range (u, 0x0953u, 0x0954u)))
cat = OT_SM; cat = OT_SM;
/* The following act like consonants. */ /* The following act like consonants. */
else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0x0A72, 0x0A73, else if (unlikely (hb_in_ranges (u, 0x0A72u, 0x0A73u,
0x1CF5, 0x1CF6))) 0x1CF5u, 0x1CF6u)))
cat = OT_C; cat = OT_C;
/* TODO: The following should only be allowed after a Visarga. /* TODO: The following should only be allowed after a Visarga.
* For now, just treat them like regular tone marks. */ * For now, just treat them like regular tone marks. */
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1CE2, 0x1CE8))) else if (unlikely (hb_in_range (u, 0x1CE2u, 0x1CE8u)))
cat = OT_A; cat = OT_A;
/* TODO: The following should only be allowed after some of /* TODO: The following should only be allowed after some of
* the nasalization marks, maybe only for U+1CE9..U+1CF1. * the nasalization marks, maybe only for U+1CE9..U+1CF1.
* For now, just treat them like tone marks. */ * For now, just treat them like tone marks. */
else if (unlikely (u == 0x1CED)) else if (unlikely (u == 0x1CEDu))
cat = OT_A; cat = OT_A;
/* The following take marks in standalone clusters, similar to Avagraha. */ /* The following take marks in standalone clusters, similar to Avagraha. */
else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0xA8F2, 0xA8F7, else if (unlikely (hb_in_ranges (u, 0xA8F2u, 0xA8F7u,
0x1CE9, 0x1CEC, 0x1CE9u, 0x1CECu,
0x1CEE, 0x1CF1))) 0x1CEEu, 0x1CF1u)))
{ {
cat = OT_Symbol; cat = OT_Symbol;
ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol); ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol);
} }
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x17CD, 0x17D1) || else if (unlikely (hb_in_range (u, 0x17CDu, 0x17D1u) ||
u == 0x17CB || u == 0x17D3 || u == 0x17DD)) /* Khmer Various signs */ u == 0x17CBu || u == 0x17D3u || u == 0x17DDu)) /* Khmer Various signs */
{ {
/* These are like Top Matras. */ /* These are like Top Matras. */
cat = OT_M; cat = OT_M;
pos = POS_ABOVE_C; pos = POS_ABOVE_C;
} }
else if (unlikely (u == 0x17C6)) cat = OT_N; /* Khmer Bindu doesn't like to be repositioned. */ else if (unlikely (u == 0x17C6u)) cat = OT_N; /* Khmer Bindu doesn't like to be repositioned. */
else if (unlikely (u == 0x17D2)) cat = OT_Coeng; /* Khmer coeng */ else if (unlikely (u == 0x17D2u)) cat = OT_Coeng; /* Khmer coeng */
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x2010, 0x2011))) else if (unlikely (hb_in_range (u, 0x2010u, 0x2011u)))
cat = OT_PLACEHOLDER; cat = OT_PLACEHOLDER;
else if (unlikely (u == 0x25CC)) cat = OT_DOTTEDCIRCLE; else if (unlikely (u == 0x25CCu)) cat = OT_DOTTEDCIRCLE;
else if (unlikely (u == 0xA982)) cat = OT_SM; /* Javanese repha. */ else if (unlikely (u == 0xA982u)) cat = OT_SM; /* Javanese repha. */
else if (unlikely (u == 0xA9BE)) cat = OT_CM2; /* Javanese medial ya. */ else if (unlikely (u == 0xA9BEu)) cat = OT_CM2; /* Javanese medial ya. */
else if (unlikely (u == 0xA9BD)) { cat = OT_M; pos = POS_POST_C; } /* Javanese vocalic r. */ else if (unlikely (u == 0xA9BDu)) { cat = OT_M; pos = POS_POST_C; } /* Javanese vocalic r. */
/* /*
@ -252,7 +252,7 @@ set_indic_properties (hb_glyph_info_t &info)
pos = POS_SMVD; pos = POS_SMVD;
} }
if (unlikely (u == 0x0B01)) pos = POS_BEFORE_SUB; /* Oriya Bindu is BeforeSub in the spec. */ if (unlikely (u == 0x0B01u)) pos = POS_BEFORE_SUB; /* Oriya Bindu is BeforeSub in the spec. */
@ -316,20 +316,20 @@ struct indic_config_t
static const indic_config_t indic_configs[] = static const indic_config_t indic_configs[] =
{ {
/* Default. Should be first. */ /* Default. Should be first. */
{HB_SCRIPT_INVALID, false, 0,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_1}, {HB_SCRIPT_INVALID, false, 0,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_1},
{HB_SCRIPT_DEVANAGARI,true, 0x094D,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE}, {HB_SCRIPT_DEVANAGARI,true, 0x094Du,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE},
{HB_SCRIPT_BENGALI, true, 0x09CD,BASE_POS_LAST, REPH_POS_AFTER_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE}, {HB_SCRIPT_BENGALI, true, 0x09CDu,BASE_POS_LAST, REPH_POS_AFTER_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE},
{HB_SCRIPT_GURMUKHI, true, 0x0A4D,BASE_POS_LAST, REPH_POS_BEFORE_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE}, {HB_SCRIPT_GURMUKHI, true, 0x0A4Du,BASE_POS_LAST, REPH_POS_BEFORE_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE},
{HB_SCRIPT_GUJARATI, true, 0x0ACD,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE}, {HB_SCRIPT_GUJARATI, true, 0x0ACDu,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE},
{HB_SCRIPT_ORIYA, true, 0x0B4D,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE}, {HB_SCRIPT_ORIYA, true, 0x0B4Du,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE},
{HB_SCRIPT_TAMIL, true, 0x0BCD,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_2}, {HB_SCRIPT_TAMIL, true, 0x0BCDu,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_2},
{HB_SCRIPT_TELUGU, true, 0x0C4D,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_EXPLICIT, BLWF_MODE_POST_ONLY, PREF_LEN_2}, {HB_SCRIPT_TELUGU, true, 0x0C4Du,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_EXPLICIT, BLWF_MODE_POST_ONLY, PREF_LEN_2},
{HB_SCRIPT_KANNADA, true, 0x0CCD,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_POST_ONLY, PREF_LEN_2}, {HB_SCRIPT_KANNADA, true, 0x0CCDu,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_POST_ONLY, PREF_LEN_2},
{HB_SCRIPT_MALAYALAM, true, 0x0D4D,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_LOG_REPHA,BLWF_MODE_PRE_AND_POST, PREF_LEN_2}, {HB_SCRIPT_MALAYALAM, true, 0x0D4Du,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_LOG_REPHA,BLWF_MODE_PRE_AND_POST, PREF_LEN_2},
{HB_SCRIPT_SINHALA, false,0x0DCA,BASE_POS_LAST_SINHALA, {HB_SCRIPT_SINHALA, false,0x0DCAu,BASE_POS_LAST_SINHALA,
REPH_POS_AFTER_MAIN, REPH_MODE_EXPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE}, REPH_POS_AFTER_MAIN, REPH_MODE_EXPLICIT, BLWF_MODE_PRE_AND_POST, PREF_LEN_DONT_CARE},
{HB_SCRIPT_KHMER, false,0x17D2,BASE_POS_FIRST,REPH_POS_DONT_CARE, REPH_MODE_VIS_REPHA,BLWF_MODE_PRE_AND_POST, PREF_LEN_2}, {HB_SCRIPT_KHMER, false,0x17D2u,BASE_POS_FIRST,REPH_POS_DONT_CARE, REPH_MODE_VIS_REPHA,BLWF_MODE_PRE_AND_POST, PREF_LEN_2},
{HB_SCRIPT_JAVANESE, false,0xA9C0,BASE_POS_FIRST,REPH_POS_DONT_CARE, REPH_MODE_VIS_REPHA,BLWF_MODE_PRE_AND_POST, PREF_LEN_1}, {HB_SCRIPT_JAVANESE, false,0xA9C0u,BASE_POS_FIRST,REPH_POS_DONT_CARE, REPH_MODE_VIS_REPHA,BLWF_MODE_PRE_AND_POST, PREF_LEN_1},
}; };
@ -553,7 +553,7 @@ data_create_indic (const hb_ot_shape_plan_t *plan)
break; break;
} }
indic_plan->is_old_spec = indic_plan->config->has_old_spec && ((plan->map.chosen_script[0] & 0x000000FF) != '2'); indic_plan->is_old_spec = indic_plan->config->has_old_spec && ((plan->map.chosen_script[0] & 0x000000FFu) != '2');
indic_plan->virama_glyph = (hb_codepoint_t) -1; indic_plan->virama_glyph = (hb_codepoint_t) -1;
/* Use zero-context would_substitute() matching for new-spec of the main /* Use zero-context would_substitute() matching for new-spec of the main
@ -1238,11 +1238,11 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_codepoint_t dottedcircle_glyph; hb_codepoint_t dottedcircle_glyph;
if (!font->get_glyph (0x25CC, 0, &dottedcircle_glyph)) if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
return; return;
hb_glyph_info_t dottedcircle = {0}; hb_glyph_info_t dottedcircle = {0};
dottedcircle.codepoint = 0x25CC; dottedcircle.codepoint = 0x25CCu;
set_indic_properties (dottedcircle); set_indic_properties (dottedcircle);
dottedcircle.codepoint = dottedcircle_glyph; dottedcircle.codepoint = dottedcircle_glyph;
@ -1749,37 +1749,37 @@ decompose_indic (const hb_ot_shape_normalize_context_t *c,
switch (ab) switch (ab)
{ {
/* Don't decompose these. */ /* Don't decompose these. */
case 0x0931 : return false; case 0x0931u : return false;
case 0x0B94 : return false; case 0x0B94u : return false;
/* /*
* Decompose split matras that don't have Unicode decompositions. * Decompose split matras that don't have Unicode decompositions.
*/ */
case 0x0F77 : *a = 0x0FB2; *b= 0x0F81; return true; case 0x0F77u : *a = 0x0FB2u; *b= 0x0F81u; return true;
case 0x0F79 : *a = 0x0FB3; *b= 0x0F81; return true; case 0x0F79u : *a = 0x0FB3u; *b= 0x0F81u; return true;
case 0x17BE : *a = 0x17C1; *b= 0x17BE; return true; case 0x17BEu : *a = 0x17C1u; *b= 0x17BEu; return true;
case 0x17BF : *a = 0x17C1; *b= 0x17BF; return true; case 0x17BFu : *a = 0x17C1u; *b= 0x17BFu; return true;
case 0x17C0 : *a = 0x17C1; *b= 0x17C0; return true; case 0x17C0u : *a = 0x17C1u; *b= 0x17C0u; return true;
case 0x17C4 : *a = 0x17C1; *b= 0x17C4; return true; case 0x17C4u : *a = 0x17C1u; *b= 0x17C4u; return true;
case 0x17C5 : *a = 0x17C1; *b= 0x17C5; return true; case 0x17C5u : *a = 0x17C1u; *b= 0x17C5u; return true;
case 0x1925 : *a = 0x1920; *b= 0x1923; return true; case 0x1925u : *a = 0x1920u; *b= 0x1923u; return true;
case 0x1926 : *a = 0x1920; *b= 0x1924; return true; case 0x1926u : *a = 0x1920u; *b= 0x1924u; return true;
case 0x1B3C : *a = 0x1B42; *b= 0x1B3C; return true; case 0x1B3Cu : *a = 0x1B42u; *b= 0x1B3Cu; return true;
case 0x1112E : *a = 0x11127; *b= 0x11131; return true; case 0x1112Eu : *a = 0x11127u; *b= 0x11131u; return true;
case 0x1112F : *a = 0x11127; *b= 0x11132; return true; case 0x1112Fu : *a = 0x11127u; *b= 0x11132u; return true;
#if 0 #if 0
/* This one has no decomposition in Unicode, but needs no decomposition either. */ /* This one has no decomposition in Unicode, but needs no decomposition either. */
/* case 0x0AC9 : return false; */ /* case 0x0AC9u : return false; */
case 0x0B57 : *a = no decomp, -> RIGHT; return true; case 0x0B57u : *a = no decomp, -> RIGHT; return true;
case 0x1C29 : *a = no decomp, -> LEFT; return true; case 0x1C29u : *a = no decomp, -> LEFT; return true;
case 0xA9C0 : *a = no decomp, -> RIGHT; return true; case 0xA9C0u : *a = no decomp, -> RIGHT; return true;
case 0x111BF : *a = no decomp, -> ABOVE; return true; case 0x111BuF : *a = no decomp, -> ABOVE; return true;
#endif #endif
} }
if ((ab == 0x0DDA || hb_in_range<hb_codepoint_t> (ab, 0x0DDC, 0x0DDE))) if ((ab == 0x0DDAu || hb_in_range (ab, 0x0DDCu, 0x0DDEu)))
{ {
/* /*
* Sinhala split matras... Let the fun begin. * Sinhala split matras... Let the fun begin.
@ -1816,7 +1816,7 @@ decompose_indic (const hb_ot_shape_normalize_context_t *c,
indic_plan->pstf.would_substitute (&glyph, 1, c->font->face))) indic_plan->pstf.would_substitute (&glyph, 1, c->font->face)))
{ {
/* Ok, safe to use Uniscribe-style decomposition. */ /* Ok, safe to use Uniscribe-style decomposition. */
*a = 0x0DD9; *a = 0x0DD9u;
*b = ab; *b = ab;
return true; return true;
} }
@ -1836,7 +1836,7 @@ compose_indic (const hb_ot_shape_normalize_context_t *c,
return false; return false;
/* Composition-exclusion exceptions that we want to recompose. */ /* Composition-exclusion exceptions that we want to recompose. */
if (a == 0x09AF && b == 0x09BC) { *ab = 0x09DF; return true; } if (a == 0x09AFu && b == 0x09BCu) { *ab = 0x09DFu; return true; }
return c->unicode->compose (a, b, ab); return c->unicode->compose (a, b, ab);
} }

View File

@ -169,80 +169,80 @@ set_myanmar_properties (hb_glyph_info_t &info)
{ {
hb_codepoint_t u = info.codepoint; hb_codepoint_t u = info.codepoint;
unsigned int type = hb_indic_get_categories (u); unsigned int type = hb_indic_get_categories (u);
indic_category_t cat = (indic_category_t) (type & 0x7F); indic_category_t cat = (indic_category_t) (type & 0x7Fu);
indic_position_t pos = (indic_position_t) (type >> 8); indic_position_t pos = (indic_position_t) (type >> 8);
/* Myanmar /* Myanmar
* http://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm#analyze * http://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm#analyze
*/ */
if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xFE00, 0xFE0F))) if (unlikely (hb_in_range (u, 0xFE00u, 0xFE0Fu)))
cat = (indic_category_t) OT_VS; cat = (indic_category_t) OT_VS;
switch (u) switch (u)
{ {
case 0x104E: case 0x104Eu:
cat = (indic_category_t) OT_C; /* The spec says C, IndicSyllableCategory doesn't have. */ cat = (indic_category_t) OT_C; /* The spec says C, IndicSyllableCategory doesn't have. */
break; break;
case 0x002D: case 0x00A0: case 0x00D7: case 0x2012: case 0x002Du: case 0x00A0u: case 0x00D7u: case 0x2012u:
case 0x2013: case 0x2014: case 0x2015: case 0x2022: case 0x2013u: case 0x2014u: case 0x2015u: case 0x2022u:
case 0x25CC: case 0x25FB: case 0x25FC: case 0x25FD: case 0x25CCu: case 0x25FBu: case 0x25FCu: case 0x25FDu:
case 0x25FE: case 0x25FEu:
cat = (indic_category_t) OT_GB; cat = (indic_category_t) OT_GB;
break; break;
case 0x1004: case 0x101B: case 0x105A: case 0x1004u: case 0x101Bu: case 0x105Au:
cat = (indic_category_t) OT_Ra; cat = (indic_category_t) OT_Ra;
break; break;
case 0x1032: case 0x1036: case 0x1032u: case 0x1036u:
cat = (indic_category_t) OT_A; cat = (indic_category_t) OT_A;
break; break;
case 0x103A: case 0x103Au:
cat = (indic_category_t) OT_As; cat = (indic_category_t) OT_As;
break; break;
case 0x1041: case 0x1042: case 0x1043: case 0x1044: case 0x1041u: case 0x1042u: case 0x1043u: case 0x1044u:
case 0x1045: case 0x1046: case 0x1047: case 0x1048: case 0x1045u: case 0x1046u: case 0x1047u: case 0x1048u:
case 0x1049: case 0x1090: case 0x1091: case 0x1092: case 0x1049u: case 0x1090u: case 0x1091u: case 0x1092u:
case 0x1093: case 0x1094: case 0x1095: case 0x1096: case 0x1093u: case 0x1094u: case 0x1095u: case 0x1096u:
case 0x1097: case 0x1098: case 0x1099: case 0x1097u: case 0x1098u: case 0x1099u:
cat = (indic_category_t) OT_D; cat = (indic_category_t) OT_D;
break; break;
case 0x1040: case 0x1040u:
cat = (indic_category_t) OT_D; /* XXX The spec says D0, but Uniscribe doesn't seem to do. */ cat = (indic_category_t) OT_D; /* XXX The spec says D0, but Uniscribe doesn't seem to do. */
break; break;
case 0x103E: case 0x1060: case 0x103Eu: case 0x1060u:
cat = (indic_category_t) OT_MH; cat = (indic_category_t) OT_MH;
break; break;
case 0x103C: case 0x103Cu:
cat = (indic_category_t) OT_MR; cat = (indic_category_t) OT_MR;
break; break;
case 0x103D: case 0x1082: case 0x103Du: case 0x1082u:
cat = (indic_category_t) OT_MW; cat = (indic_category_t) OT_MW;
break; break;
case 0x103B: case 0x105E: case 0x105F: case 0x103Bu: case 0x105Eu: case 0x105Fu:
cat = (indic_category_t) OT_MY; cat = (indic_category_t) OT_MY;
break; break;
case 0x1063: case 0x1064: case 0x1069: case 0x106A: case 0x1063u: case 0x1064u: case 0x1069u: case 0x106Au:
case 0x106B: case 0x106C: case 0x106D: case 0xAA7B: case 0x106Bu: case 0x106Cu: case 0x106Du: case 0xAA7Bu:
cat = (indic_category_t) OT_PT; cat = (indic_category_t) OT_PT;
break; break;
case 0x1038: case 0x1087: case 0x1088: case 0x1089: case 0x1038u: case 0x1087u: case 0x1088u: case 0x1089u:
case 0x108A: case 0x108B: case 0x108C: case 0x108D: case 0x108Au: case 0x108Bu: case 0x108Cu: case 0x108Du:
case 0x108F: case 0x109A: case 0x109B: case 0x109C: case 0x108Fu: case 0x109Au: case 0x109Bu: case 0x109Cu:
cat = (indic_category_t) OT_SM; cat = (indic_category_t) OT_SM;
break; break;
case 0x104A: case 0x104B: case 0x104Au: case 0x104Bu:
cat = (indic_category_t) OT_P; cat = (indic_category_t) OT_P;
break; break;
} }
@ -461,11 +461,11 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_codepoint_t dottedcircle_glyph; hb_codepoint_t dottedcircle_glyph;
if (!font->get_glyph (0x25CC, 0, &dottedcircle_glyph)) if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
return; return;
hb_glyph_info_t dottedcircle = {0}; hb_glyph_info_t dottedcircle = {0};
dottedcircle.codepoint = 0x25CC; dottedcircle.codepoint = 0x25CCu;
set_myanmar_properties (dottedcircle); set_myanmar_properties (dottedcircle);
dottedcircle.codepoint = dottedcircle_glyph; dottedcircle.codepoint = dottedcircle_glyph;

View File

@ -139,11 +139,11 @@ set_sea_properties (hb_glyph_info_t &info)
{ {
hb_codepoint_t u = info.codepoint; hb_codepoint_t u = info.codepoint;
unsigned int type = hb_indic_get_categories (u); unsigned int type = hb_indic_get_categories (u);
indic_category_t cat = (indic_category_t) (type & 0x7F); indic_category_t cat = (indic_category_t) (type & 0x7Fu);
indic_position_t pos = (indic_position_t) (type >> 8); indic_position_t pos = (indic_position_t) (type >> 8);
/* Medial Ra */ /* Medial Ra */
if (u == 0x1A55 || u == 0xAA34) if (u == 0x1A55u || u == 0xAA34u)
cat = (indic_category_t) OT_MR; cat = (indic_category_t) OT_MR;
if (cat == OT_M) if (cat == OT_M)
@ -288,11 +288,11 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_codepoint_t dottedcircle_glyph; hb_codepoint_t dottedcircle_glyph;
if (!font->get_glyph (0x25CC, 0, &dottedcircle_glyph)) if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
return; return;
hb_glyph_info_t dottedcircle = {0}; hb_glyph_info_t dottedcircle = {0};
dottedcircle.codepoint = 0x25CC; dottedcircle.codepoint = 0x25CCu;
set_sea_properties (dottedcircle); set_sea_properties (dottedcircle);
dottedcircle.codepoint = dottedcircle_glyph; dottedcircle.codepoint = dottedcircle_glyph;

View File

@ -46,13 +46,13 @@ enum thai_consonant_type_t
static thai_consonant_type_t static thai_consonant_type_t
get_consonant_type (hb_codepoint_t u) get_consonant_type (hb_codepoint_t u)
{ {
if (u == 0x0E1B || u == 0x0E1D || u == 0x0E1F/* || u == 0x0E2C*/) if (u == 0x0E1Bu || u == 0x0E1Du || u == 0x0E1Fu/* || u == 0x0E2Cu*/)
return AC; return AC;
if (u == 0x0E0D || u == 0x0E10) if (u == 0x0E0Du || u == 0x0E10u)
return RC; return RC;
if (u == 0x0E0E || u == 0x0E0F) if (u == 0x0E0Eu || u == 0x0E0Fu)
return DC; return DC;
if (hb_in_range<hb_codepoint_t> (u, 0x0E01, 0x0E2E)) if (hb_in_range (u, 0x0E01u, 0x0E2Eu))
return NC; return NC;
return NOT_CONSONANT; return NOT_CONSONANT;
} }
@ -70,12 +70,12 @@ enum thai_mark_type_t
static thai_mark_type_t static thai_mark_type_t
get_mark_type (hb_codepoint_t u) get_mark_type (hb_codepoint_t u)
{ {
if (u == 0x0E31 || hb_in_range<hb_codepoint_t> (u, 0x0E34, 0x0E37) || if (u == 0x0E31u || hb_in_range (u, 0x0E34u, 0x0E37u) ||
u == 0x0E47 || hb_in_range<hb_codepoint_t> (u, 0x0E4D, 0x0E4E)) u == 0x0E47u || hb_in_range (u, 0x0E4Du, 0x0E4Eu))
return AV; return AV;
if (hb_in_range<hb_codepoint_t> (u, 0x0E38, 0x0E3A)) if (hb_in_range (u, 0x0E38u, 0x0E3Au))
return BV; return BV;
if (hb_in_range<hb_codepoint_t> (u, 0x0E48, 0x0E4C)) if (hb_in_range (u, 0x0E48u, 0x0E4Cu))
return T; return T;
return NOT_MARK; return NOT_MARK;
} }
@ -99,43 +99,43 @@ thai_pua_shape (hb_codepoint_t u, thai_action_t action, hb_font_t *font)
hb_codepoint_t mac_pua; hb_codepoint_t mac_pua;
} const *pua_mappings = NULL; } const *pua_mappings = NULL;
static const thai_pua_mapping_t SD_mappings[] = { static const thai_pua_mapping_t SD_mappings[] = {
{0x0E48, 0xF70A, 0xF88B}, /* MAI EK */ {0x0E48u, 0xF70Au, 0xF88Bu}, /* MAI EK */
{0x0E49, 0xF70B, 0xF88E}, /* MAI THO */ {0x0E49u, 0xF70Bu, 0xF88Eu}, /* MAI THO */
{0x0E4A, 0xF70C, 0xF891}, /* MAI TRI */ {0x0E4Au, 0xF70Cu, 0xF891u}, /* MAI TRI */
{0x0E4B, 0xF70D, 0xF894}, /* MAI CHATTAWA */ {0x0E4Bu, 0xF70Du, 0xF894u}, /* MAI CHATTAWA */
{0x0E4C, 0xF70E, 0xF897}, /* THANTHAKHAT */ {0x0E4Cu, 0xF70Eu, 0xF897u}, /* THANTHAKHAT */
{0x0E38, 0xF718, 0xF89B}, /* SARA U */ {0x0E38u, 0xF718u, 0xF89Bu}, /* SARA U */
{0x0E39, 0xF719, 0xF89C}, /* SARA UU */ {0x0E39u, 0xF719u, 0xF89Cu}, /* SARA UU */
{0x0E3A, 0xF71A, 0xF89D}, /* PHINTHU */ {0x0E3Au, 0xF71Au, 0xF89Du}, /* PHINTHU */
{0x0000, 0x0000, 0x0000} {0x0000u, 0x0000u, 0x0000u}
}; };
static const thai_pua_mapping_t SDL_mappings[] = { static const thai_pua_mapping_t SDL_mappings[] = {
{0x0E48, 0xF705, 0xF88C}, /* MAI EK */ {0x0E48u, 0xF705u, 0xF88Cu}, /* MAI EK */
{0x0E49, 0xF706, 0xF88F}, /* MAI THO */ {0x0E49u, 0xF706u, 0xF88Fu}, /* MAI THO */
{0x0E4A, 0xF707, 0xF892}, /* MAI TRI */ {0x0E4Au, 0xF707u, 0xF892u}, /* MAI TRI */
{0x0E4B, 0xF708, 0xF895}, /* MAI CHATTAWA */ {0x0E4Bu, 0xF708u, 0xF895u}, /* MAI CHATTAWA */
{0x0E4C, 0xF709, 0xF898}, /* THANTHAKHAT */ {0x0E4Cu, 0xF709u, 0xF898u}, /* THANTHAKHAT */
{0x0000, 0x0000, 0x0000} {0x0000u, 0x0000u, 0x0000u}
}; };
static const thai_pua_mapping_t SL_mappings[] = { static const thai_pua_mapping_t SL_mappings[] = {
{0x0E48, 0xF713, 0xF88A}, /* MAI EK */ {0x0E48u, 0xF713u, 0xF88Au}, /* MAI EK */
{0x0E49, 0xF714, 0xF88D}, /* MAI THO */ {0x0E49u, 0xF714u, 0xF88Du}, /* MAI THO */
{0x0E4A, 0xF715, 0xF890}, /* MAI TRI */ {0x0E4Au, 0xF715u, 0xF890u}, /* MAI TRI */
{0x0E4B, 0xF716, 0xF893}, /* MAI CHATTAWA */ {0x0E4Bu, 0xF716u, 0xF893u}, /* MAI CHATTAWA */
{0x0E4C, 0xF717, 0xF896}, /* THANTHAKHAT */ {0x0E4Cu, 0xF717u, 0xF896u}, /* THANTHAKHAT */
{0x0E31, 0xF710, 0xF884}, /* MAI HAN-AKAT */ {0x0E31u, 0xF710u, 0xF884u}, /* MAI HAN-AKAT */
{0x0E34, 0xF701, 0xF885}, /* SARA I */ {0x0E34u, 0xF701u, 0xF885u}, /* SARA I */
{0x0E35, 0xF702, 0xF886}, /* SARA II */ {0x0E35u, 0xF702u, 0xF886u}, /* SARA II */
{0x0E36, 0xF703, 0xF887}, /* SARA UE */ {0x0E36u, 0xF703u, 0xF887u}, /* SARA UE */
{0x0E37, 0xF704, 0xF888}, /* SARA UEE */ {0x0E37u, 0xF704u, 0xF888u}, /* SARA UEE */
{0x0E47, 0xF712, 0xF889}, /* MAITAIKHU */ {0x0E47u, 0xF712u, 0xF889u}, /* MAITAIKHU */
{0x0E4D, 0xF711, 0xF899}, /* NIKHAHIT */ {0x0E4Du, 0xF711u, 0xF899u}, /* NIKHAHIT */
{0x0000, 0x0000, 0x0000} {0x0000u, 0x0000u, 0x0000u}
}; };
static const thai_pua_mapping_t RD_mappings[] = { static const thai_pua_mapping_t RD_mappings[] = {
{0x0E0D, 0xF70F, 0xF89A}, /* YO YING */ {0x0E0Du, 0xF70Fu, 0xF89Au}, /* YO YING */
{0x0E10, 0xF700, 0xF89E}, /* THO THAN */ {0x0E10u, 0xF700u, 0xF89Eu}, /* THO THAN */
{0x0000, 0x0000, 0x0000} {0x0000u, 0x0000u, 0x0000u}
}; };
switch (action) { switch (action) {
@ -308,10 +308,10 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan,
/* We only get one script at a time, so a script-agnostic implementation /* We only get one script at a time, so a script-agnostic implementation
* is adequate here. */ * is adequate here. */
#define IS_SARA_AM(x) (((x) & ~0x0080) == 0x0E33) #define IS_SARA_AM(x) (((x) & ~0x0080u) == 0x0E33u)
#define NIKHAHIT_FROM_SARA_AM(x) ((x) - 0xE33 + 0xE4D) #define NIKHAHIT_FROM_SARA_AM(x) ((x) - 0x0E33u + 0x0E4Du)
#define SARA_AA_FROM_SARA_AM(x) ((x) - 1) #define SARA_AA_FROM_SARA_AM(x) ((x) - 1)
#define IS_TONE_MARK(x) (hb_in_ranges<hb_codepoint_t> ((x) & ~0x0080, 0x0E34, 0x0E37, 0x0E47, 0x0E4E, 0x0E31, 0x0E31)) #define IS_TONE_MARK(x) (hb_in_ranges ((x) & ~0x0080u, 0x0E34u, 0x0E37u, 0x0E47u, 0x0E4Eu, 0x0E31u, 0x0E31u))
buffer->clear_output (); buffer->clear_output ();
unsigned int count = buffer->len; unsigned int count = buffer->len;

View File

@ -35,42 +35,42 @@ recategorize_combining_class (hb_codepoint_t u,
return klass; return klass;
/* Thai / Lao need some per-character work. */ /* Thai / Lao need some per-character work. */
if ((u & ~0xFF) == 0x0E00) if ((u & ~0xFF) == 0x0E00u)
{ {
if (unlikely (klass == 0)) if (unlikely (klass == 0))
{ {
switch (u) switch (u)
{ {
case 0x0E31: case 0x0E31u:
case 0x0E34: case 0x0E34u:
case 0x0E35: case 0x0E35u:
case 0x0E36: case 0x0E36u:
case 0x0E37: case 0x0E37u:
case 0x0E47: case 0x0E47u:
case 0x0E4C: case 0x0E4Cu:
case 0x0E4D: case 0x0E4Du:
case 0x0E4E: case 0x0E4Eu:
klass = HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT; klass = HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT;
break; break;
case 0x0EB1: case 0x0EB1u:
case 0x0EB4: case 0x0EB4u:
case 0x0EB5: case 0x0EB5u:
case 0x0EB6: case 0x0EB6u:
case 0x0EB7: case 0x0EB7u:
case 0x0EBB: case 0x0EBBu:
case 0x0ECC: case 0x0ECCu:
case 0x0ECD: case 0x0ECDu:
klass = HB_UNICODE_COMBINING_CLASS_ABOVE; klass = HB_UNICODE_COMBINING_CLASS_ABOVE;
break; break;
case 0x0EBC: case 0x0EBCu:
klass = HB_UNICODE_COMBINING_CLASS_BELOW; klass = HB_UNICODE_COMBINING_CLASS_BELOW;
break; break;
} }
} else { } else {
/* Thai virama is below-right */ /* Thai virama is below-right */
if (u == 0x0E3A) if (u == 0x0E3Au)
klass = HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT; klass = HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT;
} }
} }

View File

@ -213,7 +213,7 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
/* Not found, not decomposible; If codepoint is invalid Unicode and /* Not found, not decomposible; If codepoint is invalid Unicode and
* font supports U+FFFD REPLACEMENT CHARACTER, use that instead. */ * font supports U+FFFD REPLACEMENT CHARACTER, use that instead. */
hb_codepoint_t FFFD_glyph; hb_codepoint_t FFFD_glyph;
if (buffer->cur().codepoint > 0x10FFFF && c->font->get_glyph (0xFFFD, 0, &FFFD_glyph)) if (buffer->cur().codepoint > 0x10FFFFu && c->font->get_glyph (0xFFFDu, 0, &FFFD_glyph))
glyph = FFFD_glyph; glyph = FFFD_glyph;
next_char (buffer, glyph); /* glyph is initialized in earlier branches. */ next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
} }

View File

@ -238,11 +238,11 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font)
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
return; return;
if (!font->has_glyph (0x25CC)) if (!font->has_glyph (0x25CCu))
return; return;
hb_glyph_info_t dottedcircle; hb_glyph_info_t dottedcircle;
dottedcircle.codepoint = 0x25CC; dottedcircle.codepoint = 0x25CCu;
_hb_glyph_info_set_unicode_props (&dottedcircle, buffer->unicode); _hb_glyph_info_set_unicode_props (&dottedcircle, buffer->unicode);
buffer->clear_output (); buffer->clear_output ();
@ -321,7 +321,7 @@ hb_ot_shape_setup_masks_fraction (hb_ot_shape_context_t *c)
hb_glyph_info_t *info = buffer->info; hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 0; i < count; i++) for (unsigned int i = 0; i < count; i++)
{ {
if (info[i].codepoint == 0x2044) /* FRACTION SLASH */ if (info[i].codepoint == 0x2044u) /* FRACTION SLASH */
{ {
unsigned int start = i, end = i + 1; unsigned int start = i, end = i + 1;
while (start && while (start &&

View File

@ -57,7 +57,7 @@ hb_ot_old_tag_from_script (hb_script_t script)
} }
/* Else, just change first char to lowercase and return */ /* Else, just change first char to lowercase and return */
return ((hb_tag_t) script) | 0x20000000; return ((hb_tag_t) script) | 0x20000000u;
} }
static hb_script_t static hb_script_t
@ -70,13 +70,13 @@ hb_ot_old_tag_to_script (hb_tag_t tag)
/* Any spaces at the end of the tag are replaced by repeating the last /* Any spaces at the end of the tag are replaced by repeating the last
* letter. Eg 'nko ' -> 'Nkoo' */ * letter. Eg 'nko ' -> 'Nkoo' */
if (unlikely ((tag & 0x0000FF00) == 0x00002000)) if (unlikely ((tag & 0x0000FF00u) == 0x00002000u))
tag |= (tag >> 8) & 0x0000FF00; /* Copy second letter to third */ tag |= (tag >> 8) & 0x0000FF00u; /* Copy second letter to third */
if (unlikely ((tag & 0x000000FF) == 0x00000020)) if (unlikely ((tag & 0x000000FFu) == 0x00000020u))
tag |= (tag >> 8) & 0x000000FF; /* Copy third letter to fourth */ tag |= (tag >> 8) & 0x000000FFu; /* Copy third letter to fourth */
/* Change first char to uppercase and return */ /* Change first char to uppercase and return */
return (hb_script_t) (tag & ~0x20000000); return (hb_script_t) (tag & ~0x20000000u);
} }
static hb_tag_t static hb_tag_t
@ -146,7 +146,7 @@ hb_ot_tags_from_script (hb_script_t script,
hb_script_t hb_script_t
hb_ot_tag_to_script (hb_tag_t tag) hb_ot_tag_to_script (hb_tag_t tag)
{ {
if (unlikely ((tag & 0x000000FF) == '2')) if (unlikely ((tag & 0x000000FFu) == '2'))
return hb_ot_new_tag_to_script (tag); return hb_ot_new_tag_to_script (tag);
return hb_ot_old_tag_to_script (tag); return hb_ot_old_tag_to_script (tag);
@ -858,7 +858,7 @@ hb_ot_tag_from_language (hb_language_t language)
s = lang_str + strlen (lang_str); s = lang_str + strlen (lang_str);
if (s - lang_str == 3) { if (s - lang_str == 3) {
/* Assume it's ISO-639-3 and upper-case and use it. */ /* Assume it's ISO-639-3 and upper-case and use it. */
return hb_tag_from_string (lang_str, s - lang_str) & ~0x20202000; return hb_tag_from_string (lang_str, s - lang_str) & ~0x20202000u;
} }
return HB_OT_TAG_DEFAULT_LANGUAGE; return HB_OT_TAG_DEFAULT_LANGUAGE;
@ -877,7 +877,7 @@ hb_ot_tag_to_language (hb_tag_t tag)
return hb_language_from_string (ot_languages[i].language, -1); return hb_language_from_string (ot_languages[i].language, -1);
/* If tag starts with ZH, it's Chinese */ /* If tag starts with ZH, it's Chinese */
if ((tag & 0xFFFF0000) == 0x5A480000) { if ((tag & 0xFFFF0000u) == 0x5A480000u) {
switch (tag) { switch (tag) {
case HB_TAG('Z','H','H',' '): return hb_language_from_string ("zh-hk", -1); /* Hong Kong */ case HB_TAG('Z','H','H',' '): return hb_language_from_string ("zh-hk", -1); /* Hong Kong */
case HB_TAG('Z','H','S',' '): return hb_language_from_string ("zh-Hans", -1); /* Simplified */ case HB_TAG('Z','H','S',' '): return hb_language_from_string ("zh-Hans", -1); /* Simplified */

View File

@ -106,15 +106,15 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
modified_combining_class (hb_codepoint_t unicode) modified_combining_class (hb_codepoint_t unicode)
{ {
/* XXX This hack belongs to the Myanmar shaper. */ /* XXX This hack belongs to the Myanmar shaper. */
if (unlikely (unicode == 0x1037)) unicode = 0x103A; if (unlikely (unicode == 0x1037u)) unicode = 0x103Au;
/* XXX This hack belongs to the SEA shaper (for Tai Tham): /* XXX This hack belongs to the SEA shaper (for Tai Tham):
* Reorder SAKOT to ensure it comes after any tone marks. */ * Reorder SAKOT to ensure it comes after any tone marks. */
if (unlikely (unicode == 0x1A60)) return 254; if (unlikely (unicode == 0x1A60u)) return 254;
/* XXX This hack belongs to the Tibetan shaper: /* XXX This hack belongs to the Tibetan shaper:
* Reorder PADMA to ensure it comes after any vowel marks. */ * Reorder PADMA to ensure it comes after any vowel marks. */
if (unlikely (unicode == 0x0FC6)) return 254; if (unlikely (unicode == 0x0FC6u)) return 254;
return _hb_modified_combining_class[combining_class (unicode)]; return _hb_modified_combining_class[combining_class (unicode)];
} }
@ -122,10 +122,10 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
inline hb_bool_t inline hb_bool_t
is_variation_selector (hb_codepoint_t unicode) is_variation_selector (hb_codepoint_t unicode)
{ {
return unlikely (hb_in_ranges<hb_codepoint_t> (unicode, return unlikely (hb_in_ranges (unicode,
0x180B, 0x180D, /* MONGOLIAN FREE VARIATION SELECTOR ONE..THREE */ 0x180Bu, 0x180Du, /* MONGOLIAN FREE VARIATION SELECTOR ONE..THREE */
0xFE00, 0xFE0F, /* VARIATION SELECTOR-1..16 */ 0xFE00u, 0xFE0Fu, /* VARIATION SELECTOR-1..16 */
0xE0100, 0xE01EF)); /* VARIATION SELECTOR-17..256 */ 0xE0100u, 0xE01EFu)); /* VARIATION SELECTOR-17..256 */
} }
/* Default_Ignorable codepoints: /* Default_Ignorable codepoints:
@ -173,16 +173,16 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
/* BMP */ /* BMP */
hb_codepoint_t page = ch >> 8; hb_codepoint_t page = ch >> 8;
switch (page) { switch (page) {
case 0x00: return unlikely (ch == 0x00AD); case 0x00: return unlikely (ch == 0x00ADu);
case 0x03: return unlikely (ch == 0x034F); case 0x03: return unlikely (ch == 0x034Fu);
case 0x06: return unlikely (ch == 0x061C); case 0x06: return unlikely (ch == 0x061Cu);
case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4, 0x17B5); case 0x17: return hb_in_range (ch, 0x17B4u, 0x17B5u);
case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180B, 0x180E); case 0x18: return hb_in_range (ch, 0x180Bu, 0x180Eu);
case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200B, 0x200F, case 0x20: return hb_in_ranges (ch, 0x200Bu, 0x200Fu,
0x202A, 0x202E, 0x202Au, 0x202Eu,
0x2060, 0x206F); 0x2060u, 0x206Fu);
case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00, 0xFE0F) || ch == 0xFEFF; case 0xFE: return hb_in_range (ch, 0xFE00u, 0xFE0Fu) || ch == 0xFEFFu;
case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0, 0xFFF8); case 0xFF: return hb_in_range (ch, 0xFFF0u, 0xFFF8u);
default: return false; default: return false;
} }
} }
@ -190,9 +190,9 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
{ {
/* Other planes */ /* Other planes */
switch (plane) { switch (plane) {
case 0x01: return hb_in_ranges<hb_codepoint_t> (ch, 0x0001BCA0, 0x0001BCA3, case 0x01: return hb_in_ranges (ch, 0x1BCA0u, 0x1BCA3u,
0x0001D173, 0x0001D17A); 0x1D173u, 0x1D17Au);
case 0x0E: return hb_in_range<hb_codepoint_t> (ch, 0x000E0000, 0x000E0FFF); case 0x0E: return hb_in_range (ch, 0xE0000u, 0xE0FFFu);
default: return false; default: return false;
} }
} }

View File

@ -379,7 +379,7 @@ _hb_rename_font (hb_blob_t *blob, wchar_t *new_name)
OT::NameRecord &record = name.nameRecord[i]; OT::NameRecord &record = name.nameRecord[i];
record.platformID.set (3); record.platformID.set (3);
record.encodingID.set (1); record.encodingID.set (1);
record.languageID.set (0x0409); /* English */ record.languageID.set (0x0409u); /* English */
record.nameID.set (name_IDs[i]); record.nameID.set (name_IDs[i]);
record.length.set (name_str_len * 2); record.length.set (name_str_len * 2);
record.offset.set (0); record.offset.set (0);
@ -749,13 +749,13 @@ retry:
{ {
hb_codepoint_t c = buffer->info[i].codepoint; hb_codepoint_t c = buffer->info[i].codepoint;
buffer->info[i].utf16_index() = chars_len; buffer->info[i].utf16_index() = chars_len;
if (likely (c < 0x10000)) if (likely (c <= 0xFFFFu))
pchars[chars_len++] = c; pchars[chars_len++] = c;
else if (unlikely (c >= 0x110000)) else if (unlikely (c > 0x10FFFFu))
pchars[chars_len++] = 0xFFFD; pchars[chars_len++] = 0xFFFDu;
else { else {
pchars[chars_len++] = 0xD800 + ((c - 0x10000) >> 10); pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10);
pchars[chars_len++] = 0xDC00 + ((c - 0x10000) & ((1 << 10) - 1)); pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1 << 10) - 1));
} }
} }
@ -771,7 +771,7 @@ retry:
hb_codepoint_t c = buffer->info[i].codepoint; hb_codepoint_t c = buffer->info[i].codepoint;
unsigned int cluster = buffer->info[i].cluster; unsigned int cluster = buffer->info[i].cluster;
log_clusters[chars_len++] = cluster; log_clusters[chars_len++] = cluster;
if (c >= 0x10000 && c < 0x110000) if (hb_in_range (c, 0x10000u, 0x10FFFFu))
log_clusters[chars_len++] = cluster; /* Surrogates. */ log_clusters[chars_len++] = cluster; /* Surrogates. */
} }
} }

View File

@ -105,20 +105,20 @@ hb_utf_next (const uint16_t *text,
{ {
hb_codepoint_t c = *text++; hb_codepoint_t c = *text++;
if (likely (!hb_in_range<hb_codepoint_t> (c, 0xd800, 0xdfff))) if (likely (!hb_in_range (c, 0xD800u, 0xDFFFu)))
{ {
*unicode = c; *unicode = c;
return text; return text;
} }
if (likely (hb_in_range<hb_codepoint_t> (c, 0xd800, 0xdbff))) if (likely (hb_in_range (c, 0xD800u, 0xDBFFu)))
{ {
/* High-surrogate in c */ /* High-surrogate in c */
hb_codepoint_t l; hb_codepoint_t l;
if (text < end && ((l = *text), likely (hb_in_range<hb_codepoint_t> (l, 0xdc00, 0xdfff)))) if (text < end && ((l = *text), likely (hb_in_range (l, 0xDC00u, 0xDFFFu))))
{ {
/* Low-surrogate in l */ /* Low-surrogate in l */
*unicode = (c << 10) + l - ((0xd800 << 10) - 0x10000 + 0xdc00); *unicode = (c << 10) + l - ((0xD800u << 10) - 0x10000u + 0xDC00u);
text++; text++;
return text; return text;
} }
@ -136,20 +136,20 @@ hb_utf_prev (const uint16_t *text,
{ {
hb_codepoint_t c = *--text; hb_codepoint_t c = *--text;
if (likely (!hb_in_range<hb_codepoint_t> (c, 0xd800, 0xdfff))) if (likely (!hb_in_range (c, 0xD800u, 0xDFFFu)))
{ {
*unicode = c; *unicode = c;
return text; return text;
} }
if (likely (hb_in_range<hb_codepoint_t> (c, 0xdc00, 0xdfff))) if (likely (hb_in_range (c, 0xDC00u, 0xDFFFu)))
{ {
/* Low-surrogate in c */ /* Low-surrogate in c */
hb_codepoint_t h; hb_codepoint_t h;
if (start < text && ((h = *(text - 1)), likely (hb_in_range<hb_codepoint_t> (h, 0xd800, 0xdbff)))) if (start < text && ((h = *(text - 1)), likely (hb_in_range (h, 0xD800u, 0xDBFFu))))
{ {
/* High-surrogate in h */ /* High-surrogate in h */
*unicode = (h << 10) + c - ((0xd800 << 10) - 0x10000 + 0xdc00); *unicode = (h << 10) + c - ((0xD800u << 10) - 0x10000u + 0xDC00u);
text--; text--;
return text; return text;
} }