From 71388b3ee71c7d3b79f842db7588bd683691797c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 24 Aug 2011 02:09:04 +0200 Subject: [PATCH] [uniscribe] Minor --- src/hb-uniscribe.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 77b0f009b..72b3b0a7c 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -92,12 +92,13 @@ populate_log_font (LOGFONTW *lf, } +static hb_user_data_key_t uniscribe_data_key; + + static struct hb_uniscribe_face_data_t { HANDLE fh; } _hb_uniscribe_face_data_nil = {0}; -static hb_user_data_key_t uniscribe_face_data_key; - static void _hb_uniscribe_face_data_destroy (hb_uniscribe_face_data_t *data) { @@ -109,7 +110,7 @@ _hb_uniscribe_face_data_destroy (hb_uniscribe_face_data_t *data) static hb_uniscribe_face_data_t * _hb_uniscribe_face_get_data (hb_face_t *face) { - hb_uniscribe_face_data_t *data = (hb_uniscribe_face_data_t *) hb_face_get_user_data (face, &uniscribe_face_data_key); + hb_uniscribe_face_data_t *data = (hb_uniscribe_face_data_t *) hb_face_get_user_data (face, &uniscribe_data_key); if (likely (data)) return data; data = (hb_uniscribe_face_data_t *) calloc (1, sizeof (hb_uniscribe_face_data_t)); @@ -128,12 +129,12 @@ _hb_uniscribe_face_get_data (hb_face_t *face) if (unlikely (!data->fh)) DEBUG_MSG (UNISCRIBE, face, "Face AddFontMemResourceEx() failed"); - if (unlikely (!hb_face_set_user_data (face, &uniscribe_face_data_key, data, + if (unlikely (!hb_face_set_user_data (face, &uniscribe_data_key, data, (hb_destroy_func_t) _hb_uniscribe_face_data_destroy, FALSE))) { _hb_uniscribe_face_data_destroy (data); - data = (hb_uniscribe_face_data_t *) hb_face_get_user_data (face, &uniscribe_face_data_key); + data = (hb_uniscribe_face_data_t *) hb_face_get_user_data (face, &uniscribe_data_key); if (data) return data; else @@ -151,8 +152,6 @@ static struct hb_uniscribe_font_data_t { SCRIPT_CACHE script_cache; } _hb_uniscribe_font_data_nil = {NULL, NULL, NULL}; -static hb_user_data_key_t uniscribe_font_data_key; - static void _hb_uniscribe_font_data_destroy (hb_uniscribe_font_data_t *data) { @@ -168,7 +167,7 @@ _hb_uniscribe_font_data_destroy (hb_uniscribe_font_data_t *data) static hb_uniscribe_font_data_t * _hb_uniscribe_font_get_data (hb_font_t *font) { - hb_uniscribe_font_data_t *data = (hb_uniscribe_font_data_t *) hb_font_get_user_data (font, &uniscribe_font_data_key); + hb_uniscribe_font_data_t *data = (hb_uniscribe_font_data_t *) hb_font_get_user_data (font, &uniscribe_data_key); if (likely (data)) return data; data = (hb_uniscribe_font_data_t *) calloc (1, sizeof (hb_uniscribe_font_data_t)); @@ -187,12 +186,12 @@ _hb_uniscribe_font_get_data (hb_font_t *font) DEBUG_MSG (UNISCRIBE, font, "Font SelectObject() failed"); } - if (unlikely (!hb_font_set_user_data (font, &uniscribe_font_data_key, data, + if (unlikely (!hb_font_set_user_data (font, &uniscribe_data_key, data, (hb_destroy_func_t) _hb_uniscribe_font_data_destroy, FALSE))) { _hb_uniscribe_font_data_destroy (data); - data = (hb_uniscribe_font_data_t *) hb_font_get_user_data (font, &uniscribe_font_data_key); + data = (hb_uniscribe_font_data_t *) hb_font_get_user_data (font, &uniscribe_data_key); if (data) return data; else