mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-30 15:33:25 -04:00
Use "unsigned long" when we need an unsigned Unicode type
On 16-bit systems, "unsigned int" won't get us beyond the Basic Multilingual Plane.
This commit is contained in:
parent
51ffa3eb33
commit
0d85d45857
10
bedstead.c
10
bedstead.c
@ -3502,8 +3502,8 @@ compare_glyphs_by_ffid(const void *va, const void *vb)
|
||||
if (strcmp(a->name, ".notdef") == 0) return -1;
|
||||
if (strcmp(b->name, ".notdef") == 0) return +1;
|
||||
/* Then characters with Unicode code-points in order. */
|
||||
if ((unsigned int)a->unicode < (unsigned int)b->unicode) return -1;
|
||||
if ((unsigned int)a->unicode > (unsigned int)b->unicode) return +1;
|
||||
if ((unsigned long)a->unicode < (unsigned long)b->unicode) return -1;
|
||||
if ((unsigned long)a->unicode > (unsigned long)b->unicode) return +1;
|
||||
/* Finally sort by glyph name for an arbitrary stable order. */
|
||||
return namecmp(a->name, b->name);
|
||||
}
|
||||
@ -5159,9 +5159,9 @@ byunicode(const void *va, const void *vb)
|
||||
struct glyph const *a = *(struct glyph const **)va,
|
||||
*b = *(struct glyph const **)vb;
|
||||
|
||||
/* Cast to unsigned int so -1 sorts last. */
|
||||
if ((unsigned int)a->unicode < (unsigned int)b->unicode) return -1;
|
||||
if ((unsigned int)a->unicode > (unsigned int)b->unicode) return +1;
|
||||
/* Cast to unsigned long so -1 sorts last. */
|
||||
if ((unsigned long)a->unicode < (unsigned long)b->unicode) return -1;
|
||||
if ((unsigned long)a->unicode > (unsigned long)b->unicode) return +1;
|
||||
return namecmp(a->name, b->name);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user