Make HB_TAG_CHAR4 private

It's just sugar.
This commit is contained in:
Behdad Esfahbod 2011-04-11 14:58:28 -04:00
parent 7ff7401c92
commit 4188096a77
3 changed files with 7 additions and 7 deletions

View File

@ -55,10 +55,7 @@ typedef int hb_bool_t;
typedef uint32_t hb_tag_t; typedef uint32_t hb_tag_t;
#define HB_TAG(a,b,c,d) ((hb_tag_t)((((uint8_t)(a))<<24)|(((uint8_t)(b))<<16)|(((uint8_t)(c))<<8)|((uint8_t)(d)))) #define HB_TAG(a,b,c,d) ((hb_tag_t)((((uint8_t)(a))<<24)|(((uint8_t)(b))<<16)|(((uint8_t)(c))<<8)|((uint8_t)(d))))
#define HB_TAG_CHAR4(s) (HB_TAG(((const char *) s)[0], \
((const char *) s)[1], \
((const char *) s)[2], \
((const char *) s)[3]))
#define HB_TAG_NONE HB_TAG(0,0,0,0) #define HB_TAG_NONE HB_TAG(0,0,0,0)
hb_tag_t hb_tag_from_string (const char *s); hb_tag_t hb_tag_from_string (const char *s);

View File

@ -263,12 +263,17 @@ 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]) #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 */ /* ASCII tag/character handling */
#define ISALPHA(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) #define ISALPHA(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
#define TOUPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c)) #define TOUPPER(c) (((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c))
#define TOLOWER(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 'a' : (c)) #define TOLOWER(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 'a' : (c))
#define HB_TAG_CHAR4(s) (HB_TAG(((const char *) s)[0], \
((const char *) s)[1], \
((const char *) s)[2], \
((const char *) s)[3]))
/* Debug */ /* Debug */

View File

@ -86,8 +86,6 @@ test_types_tag (void)
g_assert_cmphex (HB_TAG ('a','B','c','D'), ==, 0x61426344); g_assert_cmphex (HB_TAG ('a','B','c','D'), ==, 0x61426344);
g_assert_cmphex (HB_TAG_CHAR4 ("aBcD"), ==, 0x61426344);
g_assert_cmphex (hb_tag_from_string ("aBcDe"), ==, 0x61426344); g_assert_cmphex (hb_tag_from_string ("aBcDe"), ==, 0x61426344);
g_assert_cmphex (hb_tag_from_string ("aBcD"), ==, 0x61426344); g_assert_cmphex (hb_tag_from_string ("aBcD"), ==, 0x61426344);
g_assert_cmphex (hb_tag_from_string ("aBc"), ==, 0x61426320); g_assert_cmphex (hb_tag_from_string ("aBc"), ==, 0x61426320);