From: Behdad Esfahbod Date: Mon, 11 Apr 2011 17:16:08 +0000 (-0400) Subject: Move macros around X-Git-Tag: submit/2.0alpha-wayland/20121130.004132~9^2~390 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db5227c40e5c35fe2ffb750f32b639cb44424a1d;p=profile%2Fivi%2Forg.tizen.video-player.git Move macros around --- diff --git a/src/hb-ot-tag.c b/src/hb-ot-tag.c index 4017c88..8f62f84 100644 --- a/src/hb-ot-tag.c +++ b/src/hb-ot-tag.c @@ -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); diff --git a/src/hb-private.h b/src/hb-private.h index 98dc0bb..481015c 100644 --- a/src/hb-private.h +++ b/src/hb-private.h @@ -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