提交 db5227c4 编写于 作者: B Behdad Esfahbod

Move macros around

上级 07233581
......@@ -639,10 +639,8 @@ hb_ot_tag_from_language (hb_language_t language)
char tag[4];
int i;
lang_str += 6;
#define IS_LETTER(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
#define TO_UPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) + 'A' - 'a' : (c))
for (i = 0; i < 4 && IS_LETTER (lang_str[i]); i++)
tag[i] = TO_UPPER (lang_str[i]);
for (i = 0; i < 4 && ISALPHA (lang_str[i]); i++)
tag[i] = TOUPPER (lang_str[i]);
for (; i < 4; i++)
tag[i] = ' ';
return HB_TAG_CHAR4 (tag);
......
......@@ -263,6 +263,13 @@ typedef int hb_mutex_t;
#define hb_be_uint32_cmp(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3])
/* ASCII character handling */
#define ISALPHA(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
#define TOUPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c))
#define TOLOWER(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 'a' : (c))
/* Debug */
#ifndef HB_DEBUG
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册